Skip to content

Commit

Permalink
init: add stashclear subcmd to completion scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
xdelaruelle committed Sep 29, 2022
1 parent a98ccf1 commit 0e756ba
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion init/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ quarvarsre += s/@.*RUNENV_VAR.*@//;'
endif

# define variables for shell completion
comp_cmds := add add-any apropos aliases avail append-path 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 stash stashpop stashrm stashshow state swap switch test try-add try-load unload unuse use whatis
comp_cmds := add add-any apropos aliases avail append-path 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 stash stashclear stashpop stashrm stashshow state swap switch test try-add try-load unload unuse use whatis
comp_opts := -D -h -s -T -v -V -w --debug --help --silent --trace --verbose --version --paginate --no-pager --color --color= --width --width=
comp_load_opts := --auto --no-auto --force -f --icase -i --tag --tag=
comp_unload_opts := --auto --no-auto --force -f --icase -i
Expand Down
4 changes: 2 additions & 2 deletions init/bash_completion.in
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,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|stashpop|stashrm|stashshow)
-h|--help|-V|--version|purge|refresh|reload|sh-to-mod|source|state|reset|stash|stashclear|stashpop|stashrm|stashshow)
;;
append-path|prepend-path)
COMPREPLY=( $(compgen -W "@comp_path_opts@" -- "$cur") );;
Expand Down Expand Up @@ -147,7 +147,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|stashpop|stashrm|stashshow)
-h|--help|-V|--version|purge|refresh|reload|sh-to-mod|source|state|reset|stash|stashclear|stashpop|stashrm|stashshow)
;;
append-path|prepend-path)
COMPREPLY=( $(compgen -W "@comp_path_opts@" -- "$cur") );;
Expand Down
3 changes: 2 additions & 1 deletion init/fish_completion
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

function __fish_module_no_subcommand --description 'Test if modulecmd has yet to be given the subcommand'
for i in (commandline -opc)
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 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
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 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
return 1
end
end
Expand Down Expand Up @@ -114,6 +114,7 @@ complete -f -n '__fish_module_no_subcommand' -c module -a 'lint' --description '
complete -f -n '__fish_module_no_subcommand' -c module -a 'mod-to-sh' --description 'Make shell code from modulefile env changes'
complete -f -n '__fish_module_no_subcommand' -c module -a 'reset' --description 'Restore initial environment'
complete -f -n '__fish_module_no_subcommand' -c module -a 'stash' --description 'Save current environment and reset'
complete -f -n '__fish_module_no_subcommand' -c module -a 'stashclear' --description 'Remove all stash collections'
complete -f -n '__fish_module_no_subcommand' -c module -a 'stashpop' --description 'Restore then remove stash collection'
complete -f -n '__fish_module_no_subcommand' -c module -a 'stashrm' --description 'Remove stash collection'
complete -f -n '__fish_module_no_subcommand' -c module -a 'stashshow' --description 'Display information about stash collection'
Expand Down
1 change: 1 addition & 0 deletions init/tcsh_completion.in
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ complete module 'n/help/`_module_avail`/' \
'n/mod-to-sh/`_module_not_yet_loaded; echo "@comp_modtosh_opts@"`/' \
"n/reset/n/" \
"n/stash/n/" \
"n/stashclear/n/" \
"n/stashpop/n/" \
"n/stashrm/n/" \
"n/stashshow/n/" \
Expand Down
1 change: 1 addition & 0 deletions init/zsh-functions/_module.in
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ _module() {
'mod-to-sh:Make shell code from modulefile env changes'
'reset:Restore initial environment'
'stash:Save current environment and reset'
'stashclear:Remove all stash collections'
'stashpop:Restore then remove stash collection'
'stashrm:Remove stash collection'
'stashshow:Display information about stash collection'
Expand Down

0 comments on commit 0e756ba

Please sign in to comment.