scanimage: Prevent --output-file and --batch to be used together

merge-requests/65/head
Povilas Kanapickas 2019-04-28 23:28:19 +03:00
rodzic 7f4944f0a7
commit 86e917b04b
1 zmienionych plików z 10 dodań i 2 usunięć

Wyświetl plik

@ -2256,7 +2256,8 @@ Parameters are separated by a blank from single-character options (e.g.\n\
%%m (model), %%t (type), %%i (index number), and\n\
%%n (newline)\n\
-b, --batch[=FORMAT] working in batch mode, FORMAT is `out%%d.pnm' `out%%d.tif'\n\
`out%%d.png' or `out%%d.jpg' by default depending on --format\n");
`out%%d.png' or `out%%d.jpg' by default depending on --format\n\
This option is incompatible with --output-file.");
printf ("\
--batch-start=# page number to start naming files with\n\
--batch-count=# how many pages to scan in batch mode\n\
@ -2268,7 +2269,8 @@ Parameters are separated by a blank from single-character options (e.g.\n\
printf ("\
--accept-md5-only only accept authorization requests using md5\n\
-p, --progress print progress messages\n\
-o, --output-file=PATH save output to the given file instead of stdout\n\
-o, --output-file=PATH save output to the given file instead of stdout.\n\
This option is incompatible with --batch.\n\
-n, --dont-scan only set options, don't actually scan\n\
-T, --test test backend thoroughly\n\
-A, --all-options list all available backend options\n\
@ -2279,6 +2281,12 @@ Parameters are separated by a blank from single-character options (e.g.\n\
-V, --version print version information\n");
}
if (batch && output_file != NULL)
{
fprintf(stderr, "--batch and --output-file can't be used together.\n");
exit(1);
}
if (output_format == OUTPUT_UNKNOWN)
{
printf("Output format is not set, using pnm as a default.\n");