Skip to content

Commit

Permalink
init: complete long option on ml cmd on tcsh shell
Browse files Browse the repository at this point in the history
  • Loading branch information
xdelaruelle committed Apr 17, 2024
1 parent ca68a7a commit 04b585d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion init/Makefile
Expand Up @@ -119,7 +119,8 @@ 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 stash stashclear stashlist 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= --ignore-cache --ignore-user-rc
comp_long_opts := --debug --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
comp_list_opts := -a -j -l -o -t --all --json --long --output --output= --terse
Expand Down Expand Up @@ -148,6 +149,7 @@ sed -e 's|@prefix@|$(prefix)|g' \
-e 's|@bindir@|$(bindir)|g' \
-e 's|@mandir@|$(mandir)|g' \
-e 's|@comp_cmds@|$(comp_cmds)|g' \
-e 's|@comp_long_opts@|$(comp_long_opts)|g' \
-e 's|@comp_opts@|$(comp_opts)|g' \
-e 's|@comp_load_opts@|$(comp_load_opts)|g' \
-e 's|@comp_unload_opts@|$(comp_unload_opts)|g' \
Expand Down
6 changes: 4 additions & 2 deletions init/tcsh_completion.in
Expand Up @@ -108,6 +108,8 @@ complete module 'C,/*,f,' 'C,.*,f,' 'C,~/*,f,' \
"p/1/(@comp_cmds@ @comp_opts@)/" \
"n/-*/(@comp_cmds@)/"

complete ml 'c/-/`_module_loaded`/' \
'p/1-/`_module_not_yet_loaded`//'
complete ml \
"C/--*/(@comp_long_opts@)/" \
'c/-/`_module_loaded`/' \
'p/1-/`_module_not_yet_loaded`//'

0 comments on commit 04b585d

Please sign in to comment.