[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 96c641630923e8db735316e5a7f4bef8741cadc2

Ville Skyttä ville.skytta at iki.fi
Sun Oct 10 21:40:23 UTC 2010


The following commit has been merged in the master branch:
commit 52bfcefb3d3870c646273e5d0afa9e392cb37cc1
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Mon Oct 11 00:14:22 2010 +0300

    Simplify _parse_help somewhat.

diff --git a/bash_completion b/bash_completion
index e411ca6..d4244a0 100644
--- a/bash_completion
+++ b/bash_completion
@@ -676,8 +676,8 @@ _split_longopt()
 # @param $2  command options (default: --help)
 #
 _parse_help() {
-    $1 ${2:---help} 2>&1 | command grep -- "^[[:space:]]*-" | tr "," " " | \
-        awk '{print $1; if ($2 ~ /^-.*/) { print $2 } }' | sed -e "s:=.*::g"
+    $1 ${2:---help} 2>&1 | sed -e '/^[[:space:]]*-/!d' -e 's/,/ /g' | \
+        awk '{ print $1; if ($2 ~ /^-/) { print $2 } }' | sed -e 's|=.*||'
 }
 
 # This function completes on signal names

-- 
bash-completion



More information about the Bash-completion-commits mailing list