From c26d0b1bf7e76e54136e2f786cfe79ab2f925d28 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Tue, 27 Jul 2021 10:56:15 -0400 Subject: [PATCH] Add the warning when neither -m/--mode nor --mode-hw-default are specified As discussed in #22 --- scan | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scan b/scan index cb06317..8859050 100755 --- a/scan +++ b/scan @@ -155,10 +155,14 @@ if [[ $USEARRAY == 1 && $USEOUTPUT == 1 ]]; then fi 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 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 ), or specify --mode Lineart explicitly on the command line.' +fi + if [[ $USEOUTPUT == 1 && "$OUTPUT" == "" ]]; then echo >&2 "Output file must be specified. Aborting." exit 1