From f3b1291ef29108b164c8c9dc63f1fbe2d712bf79 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 15 Nov 2017 18:00:52 +0100 Subject: [PATCH] Pmodules/modulecmd.bash.in: fixing #26 --- Pmodules/modulecmd.bash.in | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Pmodules/modulecmd.bash.in b/Pmodules/modulecmd.bash.in index c908b9e..10ec002 100755 --- a/Pmodules/modulecmd.bash.in +++ b/Pmodules/modulecmd.bash.in @@ -1930,13 +1930,22 @@ while (( $# > 0 )); do opts+=( "$1" ) ;; * ) - subcommand="$1" if [[ -z "${Subcommands[$1]}" ]]; then std::die 1 "${CMD}: unknown sub-command -- $1" fi + subcommand="$1" shift - opts+=( "$@" ) - shift $# + ;; + esac + shift +done + +while (( $# > 0 )); do + case "$1" in + -- ) + ;; + * ) + opts+=( "$1" ) ;; esac shift