summaryrefslogtreecommitdiff
path: root/bash_completion
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2011-05-08 15:30:37 +0300
committerVille Skyttä <ville.skytta@iki.fi>2011-05-08 15:30:37 +0300
commit622d2bd25fab7b972b704575ada2762520749863 (patch)
treecffa4dab2d6e9483024141dec364f65d846bcef2 /bash_completion
parent2d23a3f47ca18aa2c06cda010c32b1611e98c539 (diff)
downloadbash-completion-622d2bd25fab7b972b704575ada2762520749863.tar.gz
_longopt: Use \{0,1\} instead of \? for sed (basic regex) portability.
Diffstat (limited to 'bash_completion')
-rw-r--r--bash_completion6
1 files changed, 3 insertions, 3 deletions
diff --git a/bash_completion b/bash_completion
index eaeb1fbd..950a1bb2 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