bash completion: parse short options too
authorGuido Günther <agx@sigxcpu.org>
Mon, 3 Jan 2011 21:46:09 +0000 (22:46 +0100)
committerGuido Günther <agx@sigxcpu.org>
Mon, 3 Jan 2011 21:48:20 +0000 (22:48 +0100)
debian/git-buildpackage.bash-completion

index c6a1c82..ff71753 100644 (file)
@@ -16,7 +16,7 @@ _gbp_branches ()
 
 _gbp_options ()
 {
-    $1 --help | egrep -o '^ +\-\-[a-z\-]+=?'
+    $1 --help | sed -ne  's/^ \+\(\(\-[a-z]\), \)\?\(\-\-[a-z\-]\+\=\?\).*/\2 \3/p'
 }