mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 01:36:39 +08:00
Allow functions -e
completions to complete hidden __fish functions
...but only if the user has started their function name argument with an underscore.
This commit is contained in:
parent
092307d4c0
commit
144af5116a
|
@ -1,4 +1,13 @@
|
|||
complete -c functions -s e -l erase -d "Erase function" -x -a "(functions -n)"
|
||||
function __fish_maybe_list_all_functions
|
||||
# if the current commandline token starts with an _, list all functions
|
||||
if string match -qr -- '^_' (commandline -ct)
|
||||
functions -an
|
||||
else
|
||||
functions -n
|
||||
end
|
||||
end
|
||||
|
||||
complete -c functions -s e -l erase -d "Erase function" -x -a "(__fish_maybe_list_all_functions)"
|
||||
complete -c functions -xa "(functions -na)" -d "Function"
|
||||
complete -c functions -s a -l all -d "Show hidden functions"
|
||||
complete -c functions -s h -l help -d "Display help and exit"
|
||||
|
|
Loading…
Reference in New Issue
Block a user