aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/completions/which.fish
diff options
context:
space:
mode:
authorGravatar Fabian Homborg <FHomborg@gmail.com>2015-11-23 13:37:29 +0100
committerGravatar Fabian Homborg <FHomborg@gmail.com>2015-11-23 13:37:53 +0100
commit3f12f758533ed4a1e19ef290118aa165f4bbd4cc (patch)
treebc96313ac90c7d45a594cefd440aed9aff1f9461 /share/completions/which.fish
parent917c7276197ba52545665596f8592afb27a62ca5 (diff)
Add completions for OSX which
Diffstat (limited to 'share/completions/which.fish')
-rw-r--r--share/completions/which.fish30
1 files changed, 17 insertions, 13 deletions
diff --git a/share/completions/which.fish b/share/completions/which.fish
index 1de1cfd7..567e0e92 100644
--- a/share/completions/which.fish
+++ b/share/completions/which.fish
@@ -1,15 +1,19 @@
-
-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 -l skip-alias --description "Ignore option '--read-alias'"
-complete -c which -l read-functions --description "Read shell function definitions from stdin, reporting matching ones on stdout"
-complete -c which -l skip-functions --description "Ignore option '--read-functions'"
-complete -c which -l skip-dot --description "Skip directories in PATH that start with a dot"
-complete -c which -l skip-tilde --description "Skip directories in PATH that start with a tilde and executables which reside in the HOME directory"
-complete -c which -l show-dot --description "If a directory in PATH starts with a dot and a matching executable was found for that path, then print './programname'"
-complete -c which -l show-tilde --description "Output a tilde when a directory matches the HOME directory"
-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 -l help --description "Display help and exit"
+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 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 read-functions --description "Read shell function definitions from stdin, reporting matching ones on stdout"
+ complete -c which -l skip-functions --description "Ignore option '--read-functions'"
+ complete -c which -l skip-dot --description "Skip directories in PATH that start with a dot"
+ complete -c which -l skip-tilde --description "Skip directories in PATH that start with a tilde and executables which reside in the HOME directory"
+ complete -c which -l show-dot --description "If a directory in PATH starts with a dot and a matching executable was found for that path, then print './programname'"
+ complete -c which -l show-tilde --description "Output a tilde when a directory matches the HOME directory"
+ 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 -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