[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-274-g622d2bd

Ville Skyttä ville.skytta at iki.fi
Sun May 8 12:37:15 UTC 2011


The following commit has been merged in the master branch:
commit 622d2bd25fab7b972b704575ada2762520749863
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sun May 8 15:30:37 2011 +0300

    _longopt: Use \{0,1\} instead of \? for sed (basic regex) portability.

diff --git a/bash_completion b/bash_completion
index eaeb1fb..950a1bb 100644
--- a/bash_completion
+++ b/bash_completion
@@ -1700,8 +1700,8 @@ _longopt()
             return 0
             ;;
         --+([-a-z0-9_]))
-            local argtype=$( $1 --help 2>&1 | \
-                sed -ne "s|.*$prev\[\?=[<[]\?\([-A-Za-z0-9_]\{1,\}\).*|\1|p" )
+            local argtype=$( $1 --help 2>&1 | sed -ne \
+                "s|.*$prev\[\{0,1\}=[<[]\{0,1\}\([-A-Za-z0-9_]\{1,\}\).*|\1|p" )
             case ${argtype,,} in
                 *dir*)
                     compopt +o default
@@ -1720,7 +1720,7 @@ _longopt()
 
     if [[ "$cur" == -* ]]; then
         COMPREPLY=( $( compgen -W "$( $1 --help 2>&1 | \
-            sed -ne 's/.*\(--[-A-Za-z0-9]\{1,\}=\?\).*/\1/p' | sort -u )" \
+            sed -ne 's/.*\(--[-A-Za-z0-9]\{1,\}=\{0,1\}\).*/\1/p' | sort -u )" \
             -- "$cur" ) )
         [[ $COMPREPLY == *= ]] && compopt -o nospace
     elif [[ "$1" == @(mk|rm)dir ]]; then

-- 
bash-completion



More information about the Bash-completion-commits mailing list