calcurse-upgrade: Error out on unknown option

Display an error message and bail out if an invalid command line option
is passed.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2012-06-01 13:36:40 +02:00
parent 0d50e4539f
commit 2afa0db66f

View File

@ -4,10 +4,15 @@ export TEXTDOMAIN='calcurse'
set -e
if [ "$1" = "--config" ]; then
CONFFILE=$HOME/.calcurse/conf
if [ "$#" -gt 0 ]; then
if [ "$1" = "--config" ]; then
CONFFILE=$2
else
CONFFILE=$HOME/.calcurse/conf
else
echo "$(gettext "unrecognized option:") \"$1\"" >&2
exit 1
fi
fi
if [ ! -e "$CONFFILE" ]; then