mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-08 10:51:15 -03: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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user