init: add --dumpname option to completion scripts

Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
This commit is contained in:
Xavier Delaruelle
2024-11-23 17:06:30 -05:00
parent 092fc17fa6
commit 00ffadfa17
5 changed files with 8 additions and 4 deletions

View File

@@ -119,7 +119,7 @@ endif
# define variables for shell completion
comp_cmds := add add-any apropos aliases avail append-path cachebuild cacheclear clear config del display edit help initadd initclear initlist initprepend initrm is-loaded is-saved is-used is-avail info-loaded keyword lint list load load-any mod-to-sh path paths purge prepend-path refresh reload reset restore rm remove remove-path save savelist saveshow saverm search show sh-to-mod source spider stash stashclear stashlist stashpop stashrm stashshow state swap switch test try-add try-load unload unuse use whatis
comp_long_opts := --debug --help --silent --trace --verbose --version --paginate --no-pager --color --color= --width --width= --ignore-cache --ignore-user-rc
comp_long_opts := --debug --dumpname --help --silent --trace --verbose --version --paginate --no-pager --color --color= --width --width= --ignore-cache --ignore-user-rc
comp_opts := -D -h -s -T -v -V -w $(comp_long_opts)
comp_load_opts := --auto --no-auto --force -f --icase -i --tag --tag=
comp_unload_opts := --auto --no-auto --force -f --icase -i

View File

@@ -107,7 +107,7 @@ _module() {
apropos|keyword|search)
COMPREPLY=( $(compgen -W "@comp_search_opts@" -- "$cur") );;
config|--reset) COMPREPLY=( $(compgen -W "@comp_config_opts@" -- "$cur") );;
-h|--help|-V|--version|purge|refresh|reload|sh-to-mod|source|state|reset|stash|stashclear|cacheclear)
-h|--help|-V|--version|--dumpname|purge|refresh|reload|sh-to-mod|source|state|reset|stash|stashclear|cacheclear)
;;
append-path|prepend-path)
COMPREPLY=( $(compgen -W "@comp_path_opts@" -- "$cur") );;
@@ -170,7 +170,7 @@ if type -t ml >/dev/null; then
apropos|keyword|search)
COMPREPLY=( $(compgen -W "@comp_search_opts@" -- "$cur") );;
config|--reset) COMPREPLY=( $(compgen -W "@comp_config_opts@" -- "$cur") );;
-h|--help|-V|--version|purge|refresh|reload|sh-to-mod|source|state|reset|stash|stashclear|cacheclear)
-h|--help|-V|--version|--dumpname|purge|refresh|reload|sh-to-mod|source|state|reset|stash|stashclear|cacheclear)
;;
append-path|prepend-path)
COMPREPLY=( $(compgen -W "@comp_path_opts@" -- "$cur") );;

View File

@@ -148,6 +148,7 @@ complete -f -n '__fish_module_no_subcommand' -c module -a 'cachebuild' --descrip
complete -f -n '__fish_module_no_subcommand' -c module -a 'cacheclear' --description 'Delete cache file in enabled modulepath(s)'
complete -c module -s V -l version --description 'Module version'
complete -c module -l dumpname --description 'Module implementation name'
complete -c module -s T -l trace --description 'Enable trace and debug messages'
complete -c module -s D -l debug --description 'Enable debug messages'
complete -c module -s v -l verbose --description 'Enable verbose messages'

View File

@@ -108,6 +108,7 @@ complete module 'C,/*,f,' 'C,.*,f,' 'C,~/*,f,' \
'n/--help/n/' \
'n/-V/n/' \
'n/--version/n/' \
'n/--dumpname/n/' \
'C/sw*/(switch)/' \
"p/1/(@comp_cmds@ @comp_opts@)/" \
"n/-*/(@comp_cmds@)/"

View File

@@ -127,6 +127,7 @@ _module() {
'(-s --silent)'{-s,--silent}'[Turn off error, warning and informational messages]' \
'(-h --help)'{-h,--help}'[Usage info]' \
'(-V --version)'{-V,--version}'[Module version]' \
'--dumpname[Module implementation name]' \
'(-w --width=)'{-w,--width=}'[Set output width]' \
'--paginate[Pipe mesg output into a pager if stream attached to terminal]' \
'--no-pager[Do not pipe message output into a pager]' \
@@ -209,7 +210,8 @@ _module() {
)
# show commands only with compatible options
if (( !$+opt_args[-h] && !$+opt_args[--help] \
&& !$+opt_args[-V] && !$+opt_args[--version] )); then
&& !$+opt_args[-V] && !$+opt_args[--version] \
&& !$+opt_args[--dumpname] )); then
_describe -t cmds 'Module Sub-Commands' cmds && ret=0
fi
;;