Merge pull request #24 from p/mode-warning

Add the warning when neither -m/--mode nor --mode-hw-default are specified
This commit is contained in:
Raman Gupta 2021-07-27 11:04:15 -04:00 committed by GitHub
commit 084f0723b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

6
scan
View File

@ -155,10 +155,14 @@ if [[ $USEARRAY == 1 && $USEOUTPUT == 1 ]]; then
fi fi
if [[ $MODE_CHANGED == 1 && $MODE_HW_DEFAULT == 1 ]]; then if [[ $MODE_CHANGED == 1 && $MODE_HW_DEFAULT == 1 ]]; then
echo >&2 "Use one of --mode or --mode-hardware-default. Aborting." echo >&2 "Use one of -m/--mode or --mode-hardware-default. Aborting."
exit 1 exit 1
fi fi
if [[ $MODE_CHANGED == 0 && $MODE_HW_DEFAULT == 0 ]]; then
echo >&2 'Warning: neither the -m/--mode nor --mode-hw-default argument was specified. The current default is "Lineart", however -m/--mode is a SANE device-specific switch. Therefore, in a future version when --mode is not specified, `'"`basename "$0"`""'"' will defer to the device-specific default. If you wish to continue using "Lineart" as your scan mode, either verify that is the default for your scanner (scanadf --help -d <device>), or specify --mode Lineart explicitly on the command line.'
fi
if [[ $USEOUTPUT == 1 && "$OUTPUT" == "" ]]; then if [[ $USEOUTPUT == 1 && "$OUTPUT" == "" ]]; then
echo >&2 "Output file must be specified. Aborting." echo >&2 "Output file must be specified. Aborting."
exit 1 exit 1