From 18dae1f6df91a42ee4446b7f5f0886c862bea9b7 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Fri, 18 Feb 2022 13:08:13 +0100 Subject: [PATCH] modulecmd: improved output of available overlays in sub-cmd use --- Pmodules/modulecmd.bash.in | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/Pmodules/modulecmd.bash.in b/Pmodules/modulecmd.bash.in index cd30e73..a48d586 100644 --- a/Pmodules/modulecmd.bash.in +++ b/Pmodules/modulecmd.bash.in @@ -1362,16 +1362,20 @@ subcommand_use() { std::info '' std::info "Available overlays:" - local overlays - get_available_overlays overlays + local -a files + get_ol_config_files files + local -a ol_names=( $(get_ol_names "${files[@]}") ) local -- ol_name ol_type ol_install_dir - local -- ol - for ol in "${overlays[@]}"; do - local -a toks=( ${ol} ) - ol_name="${toks[0]}" - ol_type="${toks[1]}" - ol_dir="${toks[2]}" - ol_install_dir="${toks[3]}" + for ol_name in "${ol_names[@]}"; do + ol_type=$(get_ol_type \ + "${ol_names}" \ + "${files[@]}") + ol_install_dir=$(get_ol_install_root \ + "${ol_names}" \ + "${files[@]}") + ol_modulefiles_root=$(get_ol_modulefiles_root \ + "${ol_names}" \ + "${files[@]}") local txt='' case "${ol_type}" in "${ol_hiding}" )