Commit 70f25c74 authored by Robert Sachunsky's avatar Robert Sachunsky

scribo-cli: quote arguments, improve description

parent fdb5e16e
...@@ -33,9 +33,9 @@ EOF ...@@ -33,9 +33,9 @@ EOF
usage() usage()
{ {
cat <<EOF cat <<EOF
Usage: $bin [version] [help] COMMAND [ARGS] Usage: $bin COMMAND [ARGS]
List of available COMMAND argument: List of available COMMAND options:
Full Toolchains Full Toolchains
--------------- ---------------
...@@ -76,9 +76,17 @@ List of available COMMAND argument: ...@@ -76,9 +76,17 @@ List of available COMMAND argument:
* Binarization * Binarization
sauvola Sauvola's algorithm. otsu Otsu's (1979) global thresholding algorithm.
sauvola-ms Multi-scale Sauvola's algorithm. niblack Niblack's (1985) local thresholding algorithm.
sauvola Sauvola and Pietikainen's (2000) local/adpative algorithm.
kim Kim's (2004) algorithm.
wolf Wolf and Jolion's (2004) algorithm.
sauvola-ms Lazzara's (2013) multi-scale Sauvola algorithm.
sauvola-ms-fg Extract foreground objects and run multi-scale sauvola-ms-fg Extract foreground objects and run multi-scale
Sauvola's algorithm. Sauvola's algorithm.
...@@ -86,8 +94,19 @@ List of available COMMAND argument: ...@@ -86,8 +94,19 @@ List of available COMMAND argument:
sauvola-ms-split Run multi-scale Sauvola's algorithm on each color sauvola-ms-split Run multi-scale Sauvola's algorithm on each color
component and merge results. component and merge results.
--------------------------------------------------------------------------- singh Singh's (2014) algorithm.
See '$bin COMMAND --help' for more information on a specific command.
Other
-----
version Show version and exit
help Show this message and exit
For command arguments, see '$bin COMMAND --help' for more information
on each specific COMMAND.
EOF EOF
} }
...@@ -101,55 +120,56 @@ run_cmd() ...@@ -101,55 +120,56 @@ run_cmd()
fi fi
shift; shift;
case $cmd in case "$cmd" in
doc-ppc) doc-ppc)
$bdir/text_in_doc_preprocess $@ "$bdir/text_in_doc_preprocess" "$@"
;; ;;
doc-ocr) doc-ocr)
$bdir/pbm_text_in_doc $@ "$bdir/pbm_text_in_doc" "$@"
;; ;;
doc-dia) doc-dia)
$bdir/content_in_doc $@ "$bdir/content_in_doc" "$@"
;; ;;
pic-loc) pic-loc)
$bdir/text_in_picture $@ "$bdir/text_in_picture" "$@"
;; ;;
pic-ocr) pic-ocr)
$bdir/text_recognition_in_picture $@ "$bdir/text_recognition_in_picture" "$@"
;; ;;
xml2doc) xml2doc)
$bdir/scribo-xml2doc $@ "$bdir/scribo-xml2doc" "$@"
;; ;;
sauvola) sauvola)
$bdir/sauvola $@ "$bdir/sauvola" "$@"
;; ;;
sauvola-ms) sauvola-ms)
$bdir/sauvola_ms $@ "$bdir/sauvola_ms" "$@"
;; ;;
sauvola-ms-fg) sauvola-ms-fg)
$bdir/sauvola_ms_fg $@ "$bdir/sauvola_ms_fg" "$@"
;; ;;
sauvola-ms-split) sauvola-ms-split)
$bdir/sauvola_ms_split $@ "$bdir/sauvola_ms_split" "$@"
;; ;;
*) *)
cmd_bin=`echo $cmd | sed -e 's/-/_/g'` cmd_bin=`echo "$cmd" | sed -e 's/-/_/g'`
if test -f $bdir/$cmd_bin; then if test -f "$bdir/$cmd_bin"; then
$bdir/$cmd_bin $@ "$bdir/$cmd_bin" "$@"
else else
echo "Error: Invalid command!" echo "Error: Invalid command '$cmd'" >&2
usage usage
exit 1
fi fi
esac esac
} }
...@@ -162,17 +182,13 @@ case $1 in ...@@ -162,17 +182,13 @@ case $1 in
;; ;;
help | --help) help | --help | -h)
usage usage
;; ;;
help)
;;
*) *)
run_cmd $@ run_cmd "$@"
;; ;;
esac esac
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment