__fish_config_interactive: tell complete that [ wraps test

We want to show our completions for the `[` (`test`) builtin, but
we don't want to create a [.fish.
This commit is contained in:
Aaron Gyes 2018-11-25 01:57:05 -08:00
parent a4f27bea36
commit c1af29f641
2 changed files with 6 additions and 4 deletions

View file

@ -1,6 +1,3 @@
complete -c [ --wraps test
#complete -c test -l help -d "Display help and exit"
#complete -c test -l version -d "Display version and exit"
complete -c test -f -a ! -d "Negate expression"
complete -c test -f -s a -d "Logical AND"
complete -c test -f -s o -d "Logical OR"
@ -35,4 +32,3 @@ complete -c test -f -s t -d "FD is a terminal"
complete -c test -s u -d "File set-user-ID bit is set"
complete -c test -s w -d "File is writable"
complete -c test -s x -d "File is executable"

View file

@ -186,6 +186,12 @@ function __fish_config_interactive -d "Initializations that should be performed
complete -x -p "/etc/init.d/*" -a reload --description 'Reload service configuration'
end
#
# We want to show our completions for the [ (test) builtin, but
# we don't want to create a [.fish. test.fish will not be loaded until
# the user tries [ interactively.
#
complete -c [ --wraps test
# Reload key bindings when binding variable change
function __fish_reload_key_bindings -d "Reload key bindings when binding variable change" --on-variable fish_key_bindings