Tue Apr 14 12:35:25 2009 Google Inc. <opensource@google.com>
* google-gflags: version 1.1
* Add both foo and nofoo for boolean flags, with --undefok (andychu)
* Better document how validators work (wojtekm)
* Improve binary-detection for bash-completion (mtamsky)
* Python: Add a concept of "key flags", used with --help (salcianu)
* Python: Robustify flag_values (salcianu)
* Python: Add a new DEFINE_bool alias (keir, andrewliu)
* Python: Do module introspection based on module name (dsturtevant)
* Fix autoconf a bit better, especially on windows and solaris (ajenjo)
* BUG FIX: gflags_nothreads was linking against the wrong lib (ajenjo)
* BUG FIX: threads-detection failed on FreeBSD; replace it (ajenjo)
* PORTABILITY: Quiet an internal compiler error with SUSE 10 (csilvers)
* PORTABILITY: Update deb.sh for more recenty debuilds (csilvers)
* PORTABILITY: #include more headers to satify new gcc's (csilvers)
* INSTALL: Updated to autoconf 2.61 and libtool 1.5.26 (csilvers)
git-svn-id: https://gflags.googlecode.com/svn/trunk@29 6586e3c6-dcc4-952a-343f-ff74eb82781d
diff --git a/src/gflags_completions.sh b/src/gflags_completions.sh
index 81c9674..2291b59 100755
--- a/src/gflags_completions.sh
+++ b/src/gflags_completions.sh
@@ -111,7 +111,9 @@
# If we think we have a reasonable command to execute, then execute it
# and hope for the best.
-if [ -f "$binary" ] && [ -x "$binary" ]; then
+candidate=$(type -p "$binary")
+if [ ! -z "$candidate" ]; then
+ eval "$candidate 2>/dev/null $params"
+elif [ -f "$binary" ] && [ -x "$binary" ]; then
eval "$binary 2>/dev/null $params"
fi
-