diff --git a/nb_create.sh b/nb_create.sh index 028fc94..86013c6 100755 --- a/nb_create.sh +++ b/nb_create.sh @@ -88,16 +88,15 @@ if_no_file_then_exit() main() { OPT_DEBUG=False # By default, debugging is off - + 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