Commit 0f08af57 authored by gsell's avatar gsell
Browse files

scripts/Bootstrap/Pmodules/bash:

- bugfix in handling sub-command without arguments
parent 6eeb0a2f
...@@ -52,12 +52,13 @@ module() { ...@@ -52,12 +52,13 @@ module() {
if [[ ${subcommand} == '' ]]; then if [[ ${subcommand} == '' ]]; then
subcommand='help' subcommand='help'
fi fi
if (( ${#args} == 0 )); then if (( ${#args[@]} == 0 )); then
args+=( '' ) eval $( "${modulecmd}" bash ${switches[@]} "${subcommand}" "${sub_switches[@]}" )
else
for arg in "${args[@]}"; do
eval $( "${modulecmd}" bash ${switches[@]} "${subcommand}" "${sub_switches[@]}" "${arg}" )
done
fi fi
for arg in "${args[@]}"; do
eval $( "${modulecmd}" bash ${switches[@]} "${subcommand}" "${sub_switches[@]}" "${arg}" )
done
} }
export -f module export -f module
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment