Fix command line opts
This commit is contained in:
parent
ccc76cec6c
commit
fafce962b2
1 changed files with 7 additions and 6 deletions
11
nb_create.sh
11
nb_create.sh
|
|
@ -92,12 +92,11 @@ main()
|
|||
OPT_ALL="$(getopt -o dhm:p:r: -l debug,help,main:,project:,repo: --name "$0" -- "$@")"
|
||||
eval set -- "$OPT_ALL"
|
||||
|
||||
|
||||
while true ; do
|
||||
case $1 in
|
||||
-d | --debug)
|
||||
OPT_DEBUG=True
|
||||
shift
|
||||
shift 1
|
||||
;;
|
||||
-h | --help) # Call help
|
||||
help
|
||||
|
|
@ -105,26 +104,28 @@ main()
|
|||
;;
|
||||
-m | --main)
|
||||
OPT_MAIN=$2
|
||||
shift 2
|
||||
;;
|
||||
-p | --project)
|
||||
OPT_PROJECT=$2
|
||||
#shift 2
|
||||
shift 2
|
||||
;;
|
||||
-r | --repo )
|
||||
OPT_REPO=$2
|
||||
#shift 2
|
||||
shift 2
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
*)
|
||||
echo "Invalid argument" >&2
|
||||
echo "Invalid argument"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
if [[ $OPT_DEBUG == "True" ]]; then
|
||||
trap 'echo "At line $LINENO: $BASH_COMMAND"' DEBUG
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue