diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2013-04-26 21:33:02 -0700 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2013-04-26 21:33:17 -0700 |
commit | f7708955b61fe09351bf8b75d0e64b9faeac34a2 (patch) | |
tree | 849a5d034d89555b60a6fb410ca29b9fe9f43980 /share/completions/ack.fish | |
parent | be9024767eb0db77bb0120ab8d5388126e739ad0 (diff) |
Make ack completion not spew to stderr if ack is not installed
Diffstat (limited to 'share/completions/ack.fish')
-rw-r--r-- | share/completions/ack.fish | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/share/completions/ack.fish b/share/completions/ack.fish index bde1c70e..558ba926 100644 --- a/share/completions/ack.fish +++ b/share/completions/ack.fish @@ -83,7 +83,9 @@ complete -c ack -l thpppt -d 'Bill the Cat' complete -c ack -l bar -d 'The warning admiral' # File types -for type in (ack --dump | perl -lne 'print $1 if /^\s+--type-add=([^:]+)/' | uniq) - complete -c ack -l $type -d "Allow $type file type" - complete -c ack -l no$type -l no-$type -d "Don't allow $type file type" +if type ack > /dev/null + for type in (ack --dump | perl -lne 'print $1 if /^\s+--type-add=([^:]+)/' | uniq) + complete -c ack -l $type -d "Allow $type file type" + complete -c ack -l no$type -l no-$type -d "Don't allow $type file type" + end end |