Skip to content

Commit 4194962

Browse files
committed
init: add disable subcmd to completion scripts
Signed-off-by: Xavier Delaruelle <[email protected]>
1 parent c276a2f commit 4194962

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

init/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ quarvarsre += s/@.*RUNENV_VAR.*@//;'
118118
endif
119119

120120
# define variables for shell completion
121-
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 update use whatis
121+
comp_cmds := add add-any apropos aliases avail append-path cachebuild cacheclear clear config del disable 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 update use whatis
122122
comp_long_opts := --debug --dumpname --help --silent --trace --verbose --version --paginate --no-pager --color --color= --width --width= --ignore-cache --ignore-user-rc
123123
comp_opts := -D -h -s -T -v -V -w $(comp_long_opts)
124124
comp_load_opts := --auto --no-auto --force -f --icase -i --tag --tag=

init/bash_completion.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ _module() {
8787
stashpop|stashshow|stashrm)
8888
COMPREPLY=( $(compgen -W "$(_module_stashlist)" -- "$cur") );;
8989
clear) COMPREPLY=( $(compgen -W "@comp_clear_opts@" -- "$cur") );;
90-
restore|save|saveshow|saverm|is-saved)
90+
restore|save|saveshow|saverm|disable|is-saved)
9191
COMPREPLY=( $(compgen -W "$(_module_savelist)" -- "$cur") );;
9292
rm|del|remove|unload)
9393
COMPREPLY=( $(compgen -W "@comp_unload_opts@ ${LOADEDMODULES//:/ }" -- "$cur") );;
@@ -150,7 +150,7 @@ if type -t ml >/dev/null; then
150150
stashpop|stashshow|stashrm)
151151
COMPREPLY=( $(compgen -W "$(_module_stashlist)" -- "$cur") );;
152152
clear) COMPREPLY=( $(compgen -W "@comp_clear_opts@" -- "$cur") );;
153-
restore|save|saveshow|saverm|is-saved)
153+
restore|save|saveshow|saverm|disable|is-saved)
154154
COMPREPLY=( $(compgen -W "$(_module_savelist)" -- "$cur") );;
155155
rm|del|remove|unload)
156156
COMPREPLY=( $(compgen -W "@comp_unload_opts@ ${LOADEDMODULES//:/ }" -- "$cur") );;

init/fish_completion

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
function __fish_module_no_subcommand --description 'Test if modulecmd has yet to be given the subcommand'
44
for i in (commandline -opc)
5-
if contains -- $i add add-any load load-any try-add try-load rm remove del unload swap switch show display lint list avail is-loaded is-saved is-used is-avail info-loaded aliases use unuse refresh reload purge source whatis apropos keyword search test save reset restore saverm saveshow savelist stash stashclear stashlist stashpop stashrm stashshow initadd initprepend initrm initswitch initlist initclear path paths append-path prepend-path remove-path clear config sh-to-mod edit state mod-to-sh cachebuild cacheclear spider update
5+
if contains -- $i add add-any load load-any try-add try-load rm remove del unload swap switch show display lint list avail is-loaded is-saved is-used is-avail info-loaded aliases use unuse refresh reload purge source whatis apropos keyword search test save reset restore saverm saveshow savelist stash stashclear stashlist stashpop stashrm stashshow initadd initprepend initrm initswitch initlist initclear path paths append-path prepend-path remove-path clear config sh-to-mod edit state mod-to-sh cachebuild cacheclear spider update disable
66
return 1
77
end
88
end
@@ -47,7 +47,7 @@ end
4747

4848
function __fish_module_use_savelist --description 'Test if module command should have saved collections as potential completion'
4949
for i in (commandline -opc)
50-
if contains -- $i save restore saverm saveshow savelist is-saved
50+
if contains -- $i save restore saverm disable saveshow savelist is-saved
5151
return 0
5252
end
5353
end
@@ -116,6 +116,7 @@ complete -f -n '__fish_module_no_subcommand' -c module -a 'test' --description '
116116
complete -f -n '__fish_module_no_subcommand' -c module -a 'save' --description 'Save current module list to collection'
117117
complete -f -n '__fish_module_no_subcommand' -c module -a 'restore' --description 'Restore module list from collection or file'
118118
complete -f -n '__fish_module_no_subcommand' -c module -a 'saverm' --description 'Remove saved collection'
119+
complete -f -n '__fish_module_no_subcommand' -c module -a 'disable' --description 'Remove saved collection'
119120
complete -f -n '__fish_module_no_subcommand' -c module -a 'saveshow' --description 'Display information about collection'
120121
complete -f -n '__fish_module_no_subcommand' -c module -a 'savelist' --description 'List all saved collections'
121122
complete -f -n '__fish_module_no_subcommand' -c module -a 'is-saved' --description 'Test if any of the collection(s) exists'

init/tcsh_completion.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ complete module 'C,/*,f,' 'C,.*,f,' 'C,~/*,f,' \
6161
"n/savelist/(@comp_list_opts@)/" \
6262
'n/saveshow/`_module_savelist`/' \
6363
'n/saverm/`_module_savelist`/' \
64+
'n/disable/`_module_savelist`/' \
6465
'n/save/`_module_savelist`/' \
6566
'n/is-saved/`_module_savelist`/' \
6667
"n/aliases/(@comp_aliases_opts@)/" \

init/zsh-functions/_module.in

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ _module() {
170170
'save:Save current module list to collection'
171171
'restore:Restore module list from collection or file'
172172
'saverm:Remove saved collection'
173+
'disable:Remove saved collection'
173174
'saveshow:Display information about collection'
174175
'savelist:List all saved collections'
175176
'is-saved:Test if any of the collection(s) exists'
@@ -300,7 +301,7 @@ _module() {
300301
_arguments \
301302
'(-f --force)'{-f,--force}'[Skip confirmation dialog]' && ret=0
302303
;;
303-
(restore|save|saveshow|saverm|is-saved)
304+
(restore|save|saveshow|saverm|disable|is-saved)
304305
_alternative 'avail-colls:collections:{_module_saved_colls}' \
305306
&& ret=0
306307
;;

0 commit comments

Comments
 (0)