Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add STDOUT output to mutool-convert #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions source/fitz/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ fz_new_output_with_path(fz_context *ctx, const char *filename, int append)
FILE *file;
fz_output *out;

if (filename == NULL)
fz_throw(ctx, FZ_ERROR_ARGUMENT, "no output to write to");
if (filename == NULL || !strcmp(filename, "-") || !fz_strcasecmp(filename, "stdout"))
return fz_new_output(ctx, 0, NULL, stdout_write, NULL, NULL);

if (!strcmp(filename, "/dev/null") || !fz_strcasecmp(filename, "nul:"))
return fz_new_output(ctx, 0, NULL, null_write, NULL, NULL);
Expand Down
2 changes: 1 addition & 1 deletion source/fitz/stext-output.c
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,6 @@ fz_new_text_writer_with_output(fz_context *ctx, const char *format, fz_output *o
fz_document_writer *
fz_new_text_writer(fz_context *ctx, const char *format, const char *path, const char *options)
{
fz_output *out = fz_new_output_with_path(ctx, path ? path : "out.txt", 0);
fz_output *out = fz_new_output_with_path(ctx, path, 0);
return fz_new_text_writer_with_output(ctx, format, out, options);
}
2 changes: 1 addition & 1 deletion source/tools/muconvert.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static int usage(void)
"\t-U -\tfile name of user stylesheet for EPUB layout\n"
"\t-X\tdisable document styles for EPUB layout\n"
"\n"
"\t-o -\toutput file name (%%d for page number)\n"
"\t-o -\toutput file name (%%d for page number, - for stdout)\n"
"\t-F -\toutput format (default inferred from output file name)\n"
"\t\t\traster: cbz, png, pnm, pgm, ppm, pam, pbm, pkm.\n"
"\t\t\tprint-raster: pcl, pclm, ps, pwg.\n"
Expand Down