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
No related branches found
No related tags found
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 @@ ...@@ -23,7 +23,7 @@
function print_the_help { function print_the_help {
echo "USAGE: $0 -i <PRIM_FILE> " echo "USAGE: $0 -i <PRIM_FILE> <slices ...> "
echo " OPTIONS: " echo " OPTIONS: "
echo " -t,--tag filename tag (default: view1)" echo " -t,--tag filename tag (default: view1)"
exit exit
...@@ -53,12 +53,16 @@ do ...@@ -53,12 +53,16 @@ do
shift # past argument shift # past argument
shift # past value shift # past value
;; ;;
*) # unknown option -[a-zA-Z]*) # unknown option
#POSITIONAL+=("$1") # save it in an array for later #POSITIONAL+=("$1") # save it in an array for later
echo "unknown option $1" echo "unknown option $1"
print_the_help print_the_help
shift # past argument shift # past argument
;; ;;
*) # positional options
#POSITIONAL+=("$1") # save it in an array for later
shift # past argument
;;
esac esac
done done
set -- "${POSITIONAL[@]}" # restore positional parameters 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