[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-75-gf1b4f1b

Ville Skyttä ville.skytta at iki.fi
Sat Apr 16 17:43:00 UTC 2011


The following commit has been merged in the master branch:
commit f1b4f1b982d78a627f86f8aaf8747c968c985917
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Sat Apr 16 20:42:43 2011 +0300

    Parse help only when needed.

diff --git a/completions/bzip2 b/completions/bzip2
index 51026c5..f19ea7d 100644
--- a/completions/bzip2
+++ b/completions/bzip2
@@ -4,11 +4,10 @@ have bzip2 || have pbzip2 || return
 
 _bzip2()
 {
-    local cur prev xspec helpopts
+    local cur prev xspec
 
     COMPREPLY=()
     _get_comp_words_by_ref cur prev
-    helpopts=`_parse_help ${COMP_WORDS[0]}`
 
     case $prev in
         -b|-h|--help|-p)
@@ -17,6 +16,7 @@ _bzip2()
     esac
 
     if [[ "$cur" == -* ]]; then
+        local helpopts=`_parse_help ${COMP_WORDS[0]}`
         COMPREPLY=( $( compgen -W "${helpopts//#/} -2 -3 -4 -5 -6 -7 -8 -9" \
             -- "$cur" ) )
         return 0
diff --git a/completions/gzip b/completions/gzip
index d21390d..e63e7b9 100644
--- a/completions/gzip
+++ b/completions/gzip
@@ -4,11 +4,10 @@ have gzip || have pigz || return
 
 _gzip()
 {
-    local cur prev xspec helpopts
+    local cur prev xspec
 
     COMPREPLY=()
     _get_comp_words_by_ref cur prev
-    helpopts=`_parse_help ${COMP_WORDS[0]}`
 
     case $prev in
         -b|--blocksize|-p|--processes|-S|--suffix|-h|--help|-V|--version)
@@ -17,6 +16,7 @@ _gzip()
     esac
 
     if [[ "$cur" == -* ]]; then
+        local helpopts=`_parse_help ${COMP_WORDS[0]}`
         COMPREPLY=( $( compgen -W "$helpopts -1 -2 -3 -4 -5 -6 -7 -8 -9" \
             -- "$cur" ) )
         return 0

-- 
bash-completion



More information about the Bash-completion-commits mailing list