From f7708955b61fe09351bf8b75d0e64b9faeac34a2 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Fri, 26 Apr 2013 21:33:02 -0700 Subject: [PATCH] Make ack completion not spew to stderr if ack is not installed --- share/completions/ack.fish | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/share/completions/ack.fish b/share/completions/ack.fish index bde1c70ef..558ba9264 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