Added completion on fish shell for ml command - #657
Conversation
…nvmodules#417) Signed-off-by: Simon Éveillé <simon.eveille@asplus.fr>
There was a problem hiding this comment.
Many thanks for this contribution.
In addition to the other comments to address, a global point is the need to have 2 distinct completion files when Modules installs its completion files in the regular system directory (/usr/share/fish/vendor_completions.d). If there is only a module.fish there, ml will not have its completion activated until a first module is run.
Maybe to address this point, a generic module.fish.in template file can be used to generate both module.fish and ml.fish from makefile (use new fish-completions directory to mimic ksh or zsh files).
There may be alternatives for ml.fish to source module.fish and produce a different evaluation of this script based on its filename.
| complete -c $command -l width= --description 'Set output width' | ||
| complete -c $command -l ignore-cache --description 'Ignore $command cache' | ||
| complete -c $command -l ignore-user-rc --description 'Skip evaluation of user-specific $command rc file' | ||
| end |
There was a problem hiding this comment.
There are several tailing blank space that should be trimmed.
| complete -c $command -s p -l paginate --description 'Pipe mesg output into a pager if stream attached to terminal' | ||
| complete -c $command -s P -l no-pager --description 'Do not pipe message output into a pager' | ||
| complete -c $command -l auto --description 'Enable automated $command handling mode' | ||
| complete -c $command -l no-auto --description 'Disable automated $command handling mode' |
There was a problem hiding this comment.
"module" word should not be replaced by "$command" in descriptions
| return 1 | ||
| end | ||
|
|
||
| set commands module ml |
There was a problem hiding this comment.
put this set definition next to its for usage
| set commands module ml | ||
|
|
||
|
|
||
| complete -c ml -n '__fish_ml_avail' -f -a "(module avail --color=never -s -t -S --no-indepth -o 'alias:indesym' (commandline -ct) 2>&1)" |
There was a problem hiding this comment.
- arguments after the first one do not list the available modules
-<TAB>does not list the loaded modules that can be unloaded (in addition to options)
Resolves issue #417.
Added completion for fish shell.
No additional files were needed.
mlcommand now supports allmodulecommand options and also adds themodule availablelist as first complete option.