Permalink
Browse files

Safer testing if twidge exist on twidge.bash_completion.

  • Loading branch information...
1 parent e57161a commit a06fe547583715340c068902c65fd9a75c1b737a @jpablobr jpablobr committed Mar 20, 2011
Showing with 5 additions and 3 deletions.
  1. +5 −3 twidge.bash_completion
View
@@ -4,7 +4,9 @@
# Copyright 2010 Ernesto Hernández-Novich <emhn@itverx.com.ve>
# Licensed under the GNU General Public License, version 2
-have twidge &&
+: ${have=$(command -v twidge)}
+
+test -n "$have" &&
_twidge()
{
local cur
@@ -22,10 +24,10 @@ _twidge()
while [ $((--i)) -ge 0 ]; do
COMPREPLY[$i]=`printf %q "${COMPREPLY[$i]}"`
- COMPREPLY[$i]=${COMPREPLY[$i]#"$colonprefixes"}
+ COMPREPLY[$i]=${COMPREPLY[$i]#"$colonprefixes"}
done
return 0
}
-[ "$have" ] && complete -F _twidge -o default twidge
+test -n "$have" && complete -F _twidge -o default twidge

0 comments on commit a06fe54

Please sign in to comment.