summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
Diffstat (limited to 'functions')
-rwxr-xr-xfunctions/arguments.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/functions/arguments.sh b/functions/arguments.sh
index b2089626c..6b3a5d117 100755
--- a/functions/arguments.sh
+++ b/functions/arguments.sh
@@ -10,11 +10,14 @@
Arguments ()
{
- ARGUMENTS="$(getopt --longoptions breakpoints,color,conffile:,debug,force,help,quiet,usage,verbose,version --name=${PROGRAM} --options c:huv --shell sh -- "${@}")"
+ local ERR=0
+ ARGUMENTS="$(getopt --longoptions breakpoints,color,conffile:,debug,force,help,quiet,usage,verbose,version --name=${PROGRAM} --options c:huv --shell sh -- "${@}")" || ERR=$?
- if [ $? -ne 0 ]
- then
- Echo_error "terminating" >&2
+ if [ $ERR -eq 1 ]; then
+ Echo_error "invalid arguments"
+ exit 1
+ elif [ $ERR -ne 0 ]; then
+ Echo_error "getop failure"
exit 1
fi