Fix file completion for builtins "set" and "test -f" and others

This commit is contained in:
Johannes Altmanninger 2019-10-27 08:07:54 +01:00
parent a930cabb91
commit 56b4763c67
2 changed files with 17 additions and 17 deletions

View file

@ -15,20 +15,20 @@ complete -c test -f -o ne -d "Left number != right number"
#complete -c test -o ef -d "Left file equal to right file"
#complete -c test -o nt -d "Left file newer than right file"
#complete -c test -o ot -d "Left file older than right file"
complete -c test -s b -d "File is block device"
complete -c test -s c -d "File is character device"
complete -c test -s d -d "File is directory"
complete -c test -s e -d "File exists"
complete -c test -s f -d "File is regular"
complete -c test -s g -d "File is set-group-ID"
complete -c test -s G -d "File owned by our effective group ID"
complete -c test -s L -d "File is a symlink"
complete -c test -s O -d "File owned by our effective user ID"
complete -c test -s p -d "File is a named pipe"
complete -c test -s r -d "File is readable"
complete -c test -s s -d "File size is non-zero"
complete -c test -s S -d "File is a socket"
complete -c test -s b -r -d "File is block device"
complete -c test -s c -r -d "File is character device"
complete -c test -s d -r -d "File is directory"
complete -c test -s e -r -d "File exists"
complete -c test -s f -r -d "File is regular"
complete -c test -s g -r -d "File is set-group-ID"
complete -c test -s G -r -d "File owned by our effective group ID"
complete -c test -s L -r -d "File is a symlink"
complete -c test -s O -r -d "File owned by our effective user ID"
complete -c test -s p -r -d "File is a named pipe"
complete -c test -s r -r -d "File is readable"
complete -c test -s s -r -d "File size is non-zero"
complete -c test -s S -r -d "File is a socket"
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"
complete -c test -s u -r -d "File set-user-ID bit is set"
complete -c test -s w -r -d "File is writable"
complete -c test -s x -r -d "File is executable"

View file

@ -167,7 +167,7 @@ function __fish_config_interactive -d "Initializations that should be performed
#
# Only a few builtins take filenames; initialize the rest with no file completions
#
complete -c(builtin -n | string match -rv 'source|cd|exec|realpath') --no-files
complete -c(builtin -n | string match -rv 'source|cd|exec|realpath|set|\[|test') --no-files
# 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