From 50ef08ca2f7f886fd30b67dcd292bfc8cddbcb13 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Wed, 3 Aug 2022 16:37:58 +0200 Subject: [PATCH] modulecmd: parsing the args of sub-cmds simplified --- Pmodules/modulecmd.bash.in | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Pmodules/modulecmd.bash.in b/Pmodules/modulecmd.bash.in index 25f1036..cecce8a 100644 --- a/Pmodules/modulecmd.bash.in +++ b/Pmodules/modulecmd.bash.in @@ -2925,12 +2925,10 @@ case ${subcommand} in ;; esac - -tmp=$("${getopt}" --name="${CMD}" ${Options[${subcommand}]} -- "${opts[@]}" "$@" ) \ - || print_help "${subcommand}" -eval args=( "$tmp" ) -unset tmp -subcommand_${Subcommands[$subcommand]} "${args[@]}" +# parse arguments of the sub-command and call it +set -- $("${getopt}" --unquoted --name="${CMD}" ${Options[${subcommand}]} -- "${opts[@]}" "$@" ) \ + || print_help "${subcommand}" +subcommand_${Subcommands[$subcommand]} $@ # Local Variables: # mode: sh