[Bash-completion-commits] [SCM] bash-completion branch, master, updated. 1.3-431-g8535fdc

Ville Skyttä ville.skytta at iki.fi
Wed Sep 21 17:30:18 UTC 2011


The following commit has been merged in the master branch:
commit 8535fdc9bf5d5f49780bb5ceae609ad4abdf77cb
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Wed Sep 21 20:29:41 2011 +0300

    lrzip: Add -? and -p argument (non-)completions.

diff --git a/completions/lrzip b/completions/lrzip
index 897f80e..3622271 100644
--- a/completions/lrzip
+++ b/completions/lrzip
@@ -10,7 +10,7 @@ _lrzip()
     local xspec="*.lrz"
 
     case $prev in
-        -w|-S|-V|-h)
+        -w|-S|-V|-h|-'?')
             return 0
             ;;
         -d)
@@ -36,6 +36,13 @@ _lrzip()
             COMPREPLY=( $( compgen -W '{-20..19}' -- "$cur" ) )
             return 0
             ;;
+        -p)
+            local var=NPROCESSORS_ONLN
+            [[ $OSTYPE == *linux* ]] && var=_$var
+            local n=$( getconf $var 2>/dev/null )
+            COMPREPLY=( $( compgen -W "{1..${n:-1}}" -- "$cur" ) )
+            return 0
+            ;;
     esac
 
     _expand || return 0

-- 
bash-completion



More information about the Bash-completion-commits mailing list