2018-06-28 03:42:42 +08:00
|
|
|
function __fish_maybe_list_all_functions
|
2019-05-05 18:53:09 +08:00
|
|
|
# if the current commandline token starts with an _, list all functions
|
|
|
|
if string match -qr -- '^_' (commandline -ct)
|
|
|
|
functions -an
|
|
|
|
else
|
|
|
|
functions -n
|
|
|
|
end
|
2018-06-28 03:42:42 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
complete -c functions -s e -l erase -d "Erase function" -x -a "(__fish_maybe_list_all_functions)"
|
2020-03-10 02:36:12 +08:00
|
|
|
complete -c functions -xa "(functions -na)" -d Function
|
2017-10-12 01:17:35 +08:00
|
|
|
complete -c functions -s a -l all -d "Show hidden functions"
|
|
|
|
complete -c functions -s h -l help -d "Display help and exit"
|
|
|
|
complete -c functions -s d -l description -d "Set function description" -x
|
|
|
|
complete -c functions -s q -l query -d "Test if function is defined"
|
|
|
|
complete -c functions -s n -l names -d "List the names of the functions, but not their definition"
|
|
|
|
complete -c functions -s c -l copy -d "Copy the specified function to the specified new name"
|
|
|
|
complete -c functions -s D -l details -d "Display information about the function"
|
|
|
|
complete -c functions -s v -l verbose -d "Print more output"
|
2018-03-10 18:08:33 +08:00
|
|
|
complete -c functions -s H -l handlers -d "Show event handlers"
|
|
|
|
complete -c functions -s t -l handlers-type -d "Show event handlers matching the given type" -x -a "signal variable exit job-id generic"
|