Skip to content
Snippets Groups Projects
Commit f1a19237 authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

Only print help on options with -[a-zA-Z]*

parent 298eb713
Branches
Tags
No related merge requests found
This commit is part of merge request !170. Comments created here will be created in the context of that merge request.
......@@ -23,7 +23,7 @@
function print_the_help {
echo "USAGE: $0 -i <PRIM_FILE> "
echo "USAGE: $0 -i <PRIM_FILE> <slices ...> "
echo " OPTIONS: "
echo " -t,--tag filename tag (default: view1)"
exit
......@@ -53,12 +53,16 @@ do
shift # past argument
shift # past value
;;
*) # unknown option
-[a-zA-Z]*) # unknown option
#POSITIONAL+=("$1") # save it in an array for later
echo "unknown option $1"
print_the_help
shift # past argument
;;
*) # positional options
#POSITIONAL+=("$1") # save it in an array for later
shift # past argument
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment