Commit ccb02fdf authored by gsell's avatar gsell

modulecmd.bash.in: implement use-flags with arrays

parent 800f4b76
...@@ -463,15 +463,21 @@ subcommand_load() { ...@@ -463,15 +463,21 @@ subcommand_load() {
fi fi
fi fi
local found='' local found=''
for flag in "${UseFlags[@]/#/_}" ""; do for flag in "${!UseFlags[@]}"; do
# :FIXME: this doesn't work if ${m} is a # :FIXME: this doesn't work if ${m} is a
# modulename without version # modulename without version
if is_available "${m}${flag}"; then if is_available "${m}_${flag}"; then
m+="${flag}" m+="_${flag}"
found=':' found=':'
break break
fi fi
done done
if [[ ! "${found}" ]]; then
# no use-flags set
if is_available "${m}"; then
found=':'
fi
fi
if [[ ! "${found}" ]]; then if [[ ! "${found}" ]]; then
std::info "%s %s: module unavailable -- %s\n" \ std::info "%s %s: module unavailable -- %s\n" \
"${CMD}" 'load' "${m}" "${CMD}" 'load' "${m}"
......
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