Commit 2f5642f5 authored by Vitaly Lipatov's avatar Vitaly Lipatov

erc: parse all options

parent 332a9e16
...@@ -210,12 +210,14 @@ force= ...@@ -210,12 +210,14 @@ force=
target= target=
verbose=--verbose verbose=--verbose
if [ -z "$" ] ; then
echo "Etersoft archive manager version @VERSION@" >&2
echo "Run $0 --help to get help" >&2
exit 1
fi
while [ -n "$1" ] ; do
case "$1" in case "$1" in
"")
echo "Etersoft archive manager version @VERSION@" >&2
echo "Run $0 --help to get help" >&2
exit 1
;;
-h|--help|help) # HELPOPT: this help -h|--help|help) # HELPOPT: this help
phelp phelp
exit exit
...@@ -226,13 +228,19 @@ case "$1" in ...@@ -226,13 +228,19 @@ case "$1" in
;; ;;
-q|--quiet) # HELPOPT: be silent -q|--quiet) # HELPOPT: be silent
verbose= verbose=
shift
;; ;;
-f|--force) # HELPOPT: override target -f|--force) # HELPOPT: override target
force=-f force=-f
shift ;;
-*)
fatal "Unknown option '$1'"
;;
*)
break
;; ;;
esac esac
shift
done
cmd="$1" cmd="$1"
......
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