calcurse-upgrade: Add "-h" and "-v" options

Add "-h"/"--help" options to print a usage message and "-v"/"--version"
to print the current version.

Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2012-06-01 14:18:05 +02:00
parent 9be3a9c1f0
commit 1022781821

View File

@ -9,6 +9,15 @@ CONFFILE=$HOME/.calcurse/conf
if [ "$#" -gt 0 ]; then
if [ "$1" = "--config" ]; then
CONFFILE=$2
elif [ "$1" = "-h" -o "$1" = "--help" ]; then
echo "calcurse-upgrade @PACKAGE_VERSION@"
echo "$(gettext "Usage: calcurse-upgrade [-h|-v|--config <file>]")"
elif [ "$1" = "-v" -o "$1" = "--version" ]; then
echo "calcurse-upgrade @PACKAGE_VERSION@"
echo "$(gettext "
Copyright (c) 2004-2012 calcurse Development Team.
This is free software; see the source for copying conditions.
")"
else
echo "$(gettext "unrecognized option:") \"$1\"" >&2
exit 1