scripts/Bootstrap/Pmodules/bash:

- bugfix in handling sub-command without arguments
This commit is contained in:
2015-04-08 18:46:01 +02:00
parent 6eeb0a2f69
commit 0f08af57cb

View File

@@ -52,12 +52,13 @@ module() {
if [[ ${subcommand} == '' ]]; then
subcommand='help'
fi
if (( ${#args} == 0 )); then
args+=( '' )
if (( ${#args[@]} == 0 )); then
eval $( "${modulecmd}" bash ${switches[@]} "${subcommand}" "${sub_switches[@]}" )
else
for arg in "${args[@]}"; do
eval $( "${modulecmd}" bash ${switches[@]} "${subcommand}" "${sub_switches[@]}" "${arg}" )
done
fi
for arg in "${args[@]}"; do
eval $( "${modulecmd}" bash ${switches[@]} "${subcommand}" "${sub_switches[@]}" "${arg}" )
done
}
export -f module