Commit ccb02fdf authored by gsell's avatar gsell

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

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