scripts/Bootstrap/Pmodules/bash:
- bugfix in handling sub-command without arguments
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user