diff --git a/README.md b/README.md index 4645aa3..d7fe2e1 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ to see the exact location) for configuration. For example, if one wishes to scan receipts always with crop, deskew, unpaper post-processing, and making them searchable via OCR, a `receipt` option group -can be created by writing the following to a file named `recept` in the +can be created by writing the following to a file named `receipt` in the config directory: ``` @@ -136,7 +136,13 @@ SEARCHABLE=1 ``` Command-line arguments will overwride settings in the default and named -configurations. +configurations. All command line flags support prefixing with `no-` in order to +override configuration settings. For example, to scan receipts using the option +group above, but without making it searchable, you would do: + +``` +--option-group receipt --no-searchable +``` ### Tips diff --git a/scan b/scan index 9d32a08..27962c8 100755 --- a/scan +++ b/scan @@ -83,16 +83,24 @@ while [[ $# > 0 ]]; do -v|--verbose) VERBOSE=1 ;; + --no-verbose) VERBOSE=0 ;; + -d|--duplex) DUPLEX=1 ;; + -d|--no-duplex) DUPLEX=0 ;; + -m|--mode) shift; MODE=$1; MODE_CHANGED=1 ;; --mode-hw-default) MODE_HW_DEFAULT=1 ;; + --no-mode-hw-default) MODE_HW_DEFAULT=0 ;; + -r|--resolution) shift; RESOLUTION=$1 ;; -a|--append) APPEND=1 ;; + --no-append) APPEND=0 ;; + -e|--max) shift; MAXPAGE=$1 ;; -t|--truncate) shift; TRUNCPAGE=$1 ;; @@ -110,16 +118,26 @@ while [[ $# > 0 ]]; do --crop) CROP=1 ;; + --no-crop) CROP=0 ;; + --deskew) DESKEW=1 ;; + --no-deskew) DESKEW=0 ;; + --unpaper) UNPAPER=1 ;; + --no-unpaper) UNPAPER=0 ;; + --searchable|--ocr) SEARCHABLE=1 ;; + --no-searchable|--no-ocr) SEARCHABLE=0 ;; + --language) shift; LANGUAGE=$1 ;; --skip-empty-pages) SKIP_EMPTY_PAGES=1 ;; + --no-skip-empty-pages) SKIP_EMPTY_PAGES=0 ;; + --white-threshold) shift; WHITE_THRESHOLD=$1 ;; -o|--output) shift; USEOUTPUT=1; OUTPUT="$1" ;; @@ -134,6 +152,8 @@ while [[ $# > 0 ]]; do --open) OPENSCAN=1 ;; + --no-open) OPENSCAN=0 ;; + # ignore, already handled -og|--option-group) shift ;;