Add completions for OSX which

This commit is contained in:
Fabian Homborg 2015-11-23 13:37:29 +01:00
parent 917c727619
commit 3f12f75853

View file

@ -1,4 +1,4 @@
if which -v > /dev/null ^ /dev/null # GNU
complete -c which -s a -l all --description "Print all matching executables in PATH, not just the first" complete -c which -s a -l all --description "Print all matching executables in PATH, not just the first"
complete -c which -s i -l read-alias --description "Read aliases from stdin, reporting matching ones on stdout" complete -c which -s i -l read-alias --description "Read aliases from stdin, reporting matching ones on stdout"
complete -c which -l skip-alias --description "Ignore option '--read-alias'" complete -c which -l skip-alias --description "Ignore option '--read-alias'"
@ -11,5 +11,9 @@ complete -c which -l show-tilde --description "Output a tilde when a directory m
complete -c which -l tty-only --description "Stop processing options on the right if not on tty" complete -c which -l tty-only --description "Stop processing options on the right if not on tty"
complete -c which -s v -s V -l version --description "Display version and exit" complete -c which -s v -s V -l version --description "Display version and exit"
complete -c which -l help --description "Display help and exit" complete -c which -l help --description "Display help and exit"
else # OSX
complete -c which -s a --description "Print all matching executables in PATH, not just the first"
complete -c which -s s --description "Print no output, only return 0 if found"
end
complete -c which -a "(complete -C(commandline -ct))" -x complete -c which -a "(complete -C(commandline -ct))" -x