From bd6ec0e2c625250ffe80f086f472f0117e708321 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Thu, 17 Jul 2025 17:15:22 +0200 Subject: [PATCH] modulecmd: output hints in help sub-command if module is unavailable --- Pmodules/modulecmd.bash.in | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Pmodules/modulecmd.bash.in b/Pmodules/modulecmd.bash.in index ec79e9d..66f0e10 100644 --- a/Pmodules/modulecmd.bash.in +++ b/Pmodules/modulecmd.bash.in @@ -3246,20 +3246,20 @@ DOCUMENTATION: http://pmodules.gitpages.psi.ch ' #.............................................................................. +print_help_hints(){ + local -- pattern="$1" + local -- modules='' + find_matching_modules modules "${pattern}" -a + + std::info "A module with the name '${pattern}' is not available in the current module path!\n" + local -- output='' + create_module_tab output "${modules}" || return 0 + std::info "The following modules are matching the given name:\n" + std::info "${output}" + std::info "To get info for a specific module, the runtime dependencies must be loaded first!" +} + subcommand_help() { - print_help_hints(){ - local -- pattern="$1" - local -- modules='' - find_matching_modules modules "${pattern}" -a - - std::info "A module with the name '${pattern}' is not available in the current module path!\n" - local -- output='' - create_module_tab output "${modules}" || return 0 - std::info "The following modules are matching the given name:\n" - std::info "${output}" - std::info "To get help for a specific module, the runtime dependencies must be loaded first!" - } - local -r __doc__='Implementation of the sub-command help.' local -a args=() while (( $# > 0 )); do