summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-06-01 13:36:40 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2012-06-01 15:51:00 +0200
commit2afa0db66f14f4adc9e0f76b893ee0dc580ad557 (patch)
tree58a5be66121bf2d820b54bb091a5b60be423bc77
parent0d50e4539f860c9605300cd71b77f593dac2bdce (diff)
downloadcalcurse-2afa0db66f14f4adc9e0f76b893ee0dc580ad557.zip
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>
-rw-r--r--scripts/calcurse-upgrade.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/calcurse-upgrade.sh b/scripts/calcurse-upgrade.sh
index 5c7aaea..bf3f92e 100644
--- a/scripts/calcurse-upgrade.sh
+++ b/scripts/calcurse-upgrade.sh
@@ -4,10 +4,15 @@ export TEXTDOMAIN='calcurse'
set -e
-if [ "$1" = "--config" ]; then
- CONFFILE=$2
-else
- CONFFILE=$HOME/.calcurse/conf
+CONFFILE=$HOME/.calcurse/conf
+
+if [ "$#" -gt 0 ]; then
+ if [ "$1" = "--config" ]; then
+ CONFFILE=$2
+ else
+ echo "$(gettext "unrecognized option:") \"$1\"" >&2
+ exit 1
+ fi
fi
if [ ! -e "$CONFFILE" ]; then