modulecmd: parsing the args of sub-cmds simplified

This commit is contained in:
2022-08-03 16:37:58 +02:00
parent 8d7bba9631
commit 50ef08ca2f
+4 -6
View File
@@ -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