Use _get_comp_words_by_ref to set cur, prev, [..] instead of manually using COMP_WORDS

This commit is contained in:
David Paleino 2010-02-08 17:25:08 +01:00
parent 2cd91420d2
commit f8bafe285e
156 changed files with 370 additions and 581 deletions

View File

@ -1030,8 +1030,7 @@ _service()
local cur prev sysvdir local cur prev sysvdir
COMPREPLY=() COMPREPLY=()
prev=${COMP_WORDS[COMP_CWORD-1]} _get_comp_words_by_ref cur prev
cur=`_get_cword`
# don't complete for things like killall, ssh and mysql if it's # don't complete for things like killall, ssh and mysql if it's
# the standalone command, rather than the init script # the standalone command, rather than the init script
@ -1064,8 +1063,7 @@ _chown()
local cur prev split=false local cur prev split=false
# Get cur and prev words; but don't treat user:group as separate words. # Get cur and prev words; but don't treat user:group as separate words.
cur=`_get_cword :` _get_comp_words_by_ref -n : cur prev
prev=`_get_pword :`
_split_longopt && split=true _split_longopt && split=true
@ -1110,9 +1108,8 @@ _chgrp()
local cur prev split=false local cur prev split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
cur=${cur//\\\\/} cur=${cur//\\\\/}
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true
@ -1153,7 +1150,7 @@ _rmmod()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
_installed_modules "$cur" _installed_modules "$cur"
return 0 return 0
@ -1170,8 +1167,7 @@ _insmod()
local cur prev modpath local cur prev modpath
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
# behave like lsmod for modprobe -r # behave like lsmod for modprobe -r
if [[ ${1##*/} == modprobe && "${COMP_WORDS[1]}" == -r ]]; then if [[ ${1##*/} == modprobe && "${COMP_WORDS[1]}" == -r ]]; then
@ -1206,7 +1202,7 @@ _renice()
local command cur curopt i local command cur curopt i
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
command=$1 command=$1
i=0 i=0
@ -1237,7 +1233,7 @@ _kill()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ $COMP_CWORD -eq 1 && "$cur" == -* ]]; then if [[ $COMP_CWORD -eq 1 && "$cur" == -* ]]; then
# return list of available signals # return list of available signals
@ -1257,7 +1253,7 @@ _killall()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ $COMP_CWORD -eq 1 && "$cur" == -* ]]; then if [[ $COMP_CWORD -eq 1 && "$cur" == -* ]]; then
_signals _signals
@ -1278,7 +1274,7 @@ _pgrep()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
_pnames _pnames
@ -1297,7 +1293,7 @@ _ifupdown()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [ $COMP_CWORD -eq 1 ]; then if [ $COMP_CWORD -eq 1 ]; then
_configured_interfaces _configured_interfaces
@ -1317,8 +1313,7 @@ _ipsec()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [ $COMP_CWORD -eq 1 ]; then if [ $COMP_CWORD -eq 1 ]; then
COMPREPLY=( $( compgen -W 'auto barf eroute klipsdebug look manual \ COMPREPLY=( $( compgen -W 'auto barf eroute klipsdebug look manual \
@ -1359,7 +1354,7 @@ _user_at_host() {
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword :` _get_comp_words_by_ref -n : cur
if [[ $cur == *@* ]]; then if [[ $cur == *@* ]]; then
_known_hosts_real "$cur" _known_hosts_real "$cur"
@ -1565,7 +1560,8 @@ complete -F _known_hosts traceroute traceroute6 tracepath tracepath6 ping \
# #
_cd() _cd()
{ {
local IFS=$'\t\n' cur=`_get_cword` i j k local IFS=$'\t\n' i j k
_get_comp_words_by_ref cur
# try to allow variable completion # try to allow variable completion
if [[ "$cur" == ?(\\)\$* ]]; then if [[ "$cur" == ?(\\)\$* ]]; then
@ -1668,7 +1664,7 @@ _command_offset()
COMP_CWORD=$(( $COMP_CWORD - $word_offset )) COMP_CWORD=$(( $COMP_CWORD - $word_offset ))
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ $COMP_CWORD -eq 0 ]]; then if [[ $COMP_CWORD -eq 0 ]]; then
COMPREPLY=( $( compgen -c -- "$cur" ) ) COMPREPLY=( $( compgen -c -- "$cur" ) )
@ -1722,8 +1718,7 @@ _longopt()
{ {
local cur prev local cur prev
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
if _split_longopt; then if _split_longopt; then
case "$prev" in case "$prev" in
@ -1771,7 +1766,7 @@ _look()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [ $COMP_CWORD = 1 ]; then if [ $COMP_CWORD = 1 ]; then
COMPREPLY=( $( compgen -W '$(look "$cur" 2>/dev/null)' -- "$cur" ) ) COMPREPLY=( $( compgen -W '$(look "$cur" 2>/dev/null)' -- "$cur" ) )
@ -1787,7 +1782,7 @@ _id()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-a -g --group -G --groups -n --name\ COMPREPLY=( $( compgen -W '-a -g --group -G --groups -n --name\
@ -1804,7 +1799,7 @@ _filedir_xspec()
IFS=$'\t\n' IFS=$'\t\n'
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
_expand || return 0 _expand || return 0

View File

@ -49,8 +49,7 @@ _module ()
local cur prev options local cur prev options
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
if [ $COMP_CWORD -eq 1 ] ; then if [ $COMP_CWORD -eq 1 ] ; then
# First parameter on line -- we expect it to be a mode selection # First parameter on line -- we expect it to be a mode selection

View File

@ -10,7 +10,7 @@ _svn()
local cur prev commands options command local cur prev commands options command
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
commands='add blame praise annotate ann cat checkout co cleanup commit \ commands='add blame praise annotate ann cat checkout co cleanup commit \
ci copy cp delete del remove rm diff di export help ? h import \ ci copy cp delete del remove rm diff di export help ? h import \
@ -27,7 +27,6 @@ _svn()
fi fi
else else
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
--config-dir) --config-dir)
_filedir -d _filedir -d
@ -280,7 +279,7 @@ _svnadmin()
local cur prev commands options mode local cur prev commands options mode
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
commands='create deltify dump help ? hotcopy list-dblogs \ commands='create deltify dump help ? hotcopy list-dblogs \
list-unused-dblogs load lslocks lstxns recover rmlocks \ list-unused-dblogs load lslocks lstxns recover rmlocks \
@ -293,7 +292,6 @@ _svnadmin()
COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
fi fi
else else
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
--config-dir) --config-dir)
_filedir -d _filedir -d
@ -359,7 +357,7 @@ _svnlook()
local cur prev commands options mode local cur prev commands options mode
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
commands='author cat changed date diff dirs-changed help ? h history \ commands='author cat changed date diff dirs-changed help ? h history \
info lock log propget pget pg proplist plist pl tree uuid \ info lock log propget pget pg proplist plist pl tree uuid \

View File

@ -39,8 +39,7 @@ _yum()
local cur prev special i split=false local cur prev special i split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
if [[ ${COMP_WORDS[i]} == @(install|update|upgrade|remove|erase|deplist|info) ]]; then if [[ ${COMP_WORDS[i]} == @(install|update|upgrade|remove|erase|deplist|info) ]]; then

View File

@ -9,8 +9,7 @@ _repomanage()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
[[ "$prev" == -@(h|-help|k|-keep) ]] && return 0 [[ "$prev" == -@(h|-help|k|-keep) ]] && return 0

View File

@ -6,8 +6,7 @@ _abook()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
# abook only takes options, tabbing after command name adds a single # abook only takes options, tabbing after command name adds a single
# dash (bash4) # dash (bash4)

View File

@ -7,8 +7,7 @@ _ant()
local cur prev buildfile i local cur prev buildfile i
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-buildfile|-file|-f) -buildfile|-file|-f)

View File

@ -5,7 +5,7 @@ _apache2ctl() {
local APWORDS local APWORDS
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
APWORDS=$(apache2ctl 2>&1 >/dev/null | awk 'NR<2 { print $3; exit }' | \ APWORDS=$(apache2ctl 2>&1 >/dev/null | awk 'NR<2 { print $3; exit }' | \
tr "|" " ") tr "|" " ")

View File

@ -6,8 +6,7 @@ _apt_get()
local cur prev special i local cur prev special i
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
if [[ ${COMP_WORDS[i]} == @(install|remove|autoremove|purge|source|build-dep) ]]; then if [[ ${COMP_WORDS[i]} == @(install|remove|autoremove|purge|source|build-dep) ]]; then
@ -76,9 +75,7 @@ _apt_cache()
local cur prev special i local cur prev special i
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
if [ "$cur" != show ]; then if [ "$cur" != show ]; then
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do

View File

@ -6,8 +6,7 @@ _apt_build()
local cur prev special i local cur prev special i
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
if [[ ${COMP_WORDS[i]} == @(install|remove|source|info|clean) ]]; then if [[ ${COMP_WORDS[i]} == @(install|remove|source|info|clean) ]]; then

View File

@ -19,9 +19,7 @@ _aptitude()
local cur dashoptions prev special i local cur dashoptions prev special i
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
dashoptions='-S -u -i -h --help --version -s --simulate -d \ dashoptions='-S -u -i -h --help --version -s --simulate -d \
--download-only -P --prompt -y --assume-yes -F \ --download-only -P --prompt -y --assume-yes -F \

View File

@ -19,8 +19,7 @@ _aspell()
local cur prev split=false local cur prev split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true

View File

@ -6,7 +6,7 @@ _autorpm()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
COMPREPLY=( $( compgen -W '--notty --debug --help --version auto add \ COMPREPLY=( $( compgen -W '--notty --debug --help --version auto add \
fullinfo info help install list remove set' -- "$cur" ) ) fullinfo info help install list remove set' -- "$cur" ) )

View File

@ -5,7 +5,7 @@ _alias()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
case $COMP_LINE in case $COMP_LINE in
*[^=]) *[^=])
@ -26,7 +26,7 @@ _export()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
case $COMP_LINE in case $COMP_LINE in
*=\$*) *=\$*)
@ -52,8 +52,7 @@ _function()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
if [[ $1 == @(declare|typeset) ]]; then if [[ $1 == @(declare|typeset) ]]; then
if [ "$prev" = -f ]; then if [ "$prev" = -f ]; then
@ -76,8 +75,7 @@ _complete()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-o) -o)

View File

@ -6,7 +6,7 @@ _nslookup()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]#-} _get_comp_words_by_ref cur
COMPREPLY=( $( compgen -P '-' -W 'all class= debug d2 domain= srchlist= \ COMPREPLY=( $( compgen -P '-' -W 'all class= debug d2 domain= srchlist= \
defname search port= querytype= type= recurse retry root timeout vc \ defname search port= querytype= type= recurse retry root timeout vc \

View File

@ -5,7 +5,7 @@ _bk() {
local BKCMDS local BKCMDS
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
BKCMDS="$( bk help topics | awk '/^ bk/ { print $4 }' | \ BKCMDS="$( bk help topics | awk '/^ bk/ { print $4 }' | \
xargs printf '%s ' )" xargs printf '%s ' )"

View File

@ -7,8 +7,7 @@ _btdownload()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
--responsefile|--saveas) --responsefile|--saveas)

View File

@ -46,8 +46,7 @@ _hcitool()
local cur prev split=false local cur prev split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true
@ -129,8 +128,7 @@ _sdptool()
local cur prev split=false local cur prev split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true
@ -191,8 +189,7 @@ _l2ping()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-i) -i)
@ -215,8 +212,7 @@ _rfcomm()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-f|--config) -f|--config)
@ -261,8 +257,7 @@ _ciptool()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-i) -i)
@ -298,8 +293,7 @@ _dfutool()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-d|--device) -d|--device)
@ -330,7 +324,7 @@ _hciconfig()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
_get_command _get_command
if [ -z $command ]; then if [ -z $command ]; then
@ -376,7 +370,7 @@ _hciattach()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-n -p -t -b -s -l' -- "$cur" ) ) COMPREPLY=( $( compgen -W '-n -p -t -b -s -l' -- "$cur" ) )
@ -414,7 +408,7 @@ _hid2hci()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--help --quiet -0 --tohci -1 \ COMPREPLY=( $( compgen -W '--help --quiet -0 --tohci -1 \
@ -428,7 +422,7 @@ _avctrl()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--help --quiet' -- "$cur" ) ) COMPREPLY=( $( compgen -W '--help --quiet' -- "$cur" ) )

View File

@ -6,7 +6,7 @@ _brctl()
local cur command local cur command
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
command=${COMP_WORDS[1]} command=${COMP_WORDS[1]}
case $COMP_CWORD in case $COMP_CWORD in

View File

@ -6,8 +6,7 @@ _bzip2()
local cur prev xspec helpopts local cur prev xspec helpopts
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
helpopts=`_parse_help ${COMP_WORDS[0]}` helpopts=`_parse_help ${COMP_WORDS[0]}`
case $prev in case $prev in

View File

@ -6,7 +6,7 @@ _cardctl()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [ $COMP_CWORD -eq 1 ]; then if [ $COMP_CWORD -eq 1 ]; then
COMPREPLY=( $( compgen -W 'status config ident suspend \ COMPREPLY=( $( compgen -W 'status config ident suspend \

View File

@ -20,8 +20,7 @@ _cfagent()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-f|--file) -f|--file)
@ -38,10 +37,10 @@ complete -F _cfagent cfagent
_cfrun() _cfrun()
{ {
local i section cfinputs local i section cfinputs cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
section=1 section=1
for (( i=1; i < COMP_CWORD; i++ )); do for (( i=1; i < COMP_CWORD; i++ )); do
@ -52,7 +51,6 @@ _cfrun()
case $section in case $section in
1) 1)
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-f) -f)
_filedir _filedir

View File

@ -6,8 +6,7 @@ _chkconfig()
local cur prev split=false local cur prev split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true

View File

@ -5,8 +5,7 @@ _chsh()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
--list-shells|--help|-v|--version) --list-shells|--help|-v|--version)

View File

@ -3,15 +3,17 @@
have cksfv && have cksfv &&
_cksfv() _cksfv()
{ {
local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
if [ $COMP_CWORD -eq 1 ]; then if [ $COMP_CWORD -eq 1 ]; then
COMPREPLY=( $( compgen -W '-C -f -i -q -v' -- "$cur" ) ) COMPREPLY=( $( compgen -W '-C -f -i -q -v' -- "$cur" ) )
return 0 return 0
fi fi
case ${COMP_WORDS[$COMP_CWORD-1]} in case "$prev" in
-C) -C)
_filedir -d _filedir -d
return 0 return 0

View File

@ -7,7 +7,7 @@ _clisp()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
# completing an option (may or may not be separated by a space) # completing an option (may or may not be separated by a space)
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then

3
contrib/configure vendored
View File

@ -5,8 +5,7 @@ _configure()
local cur prev split=false local cur prev split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true

View File

@ -6,8 +6,7 @@ _cowsay()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-f) -f)

View File

@ -6,8 +6,7 @@ _cpan2dist()
local cur prev packagelist cpandirs local cur prev packagelist cpandirs
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
--format) --format)

View File

@ -11,8 +11,7 @@ _cpio()
local cur prev split=false local cur prev split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword :` _get_comp_words_by_ref -n : cur prev
prev=`_get_pword :`
_split_longopt && split=true _split_longopt && split=true

View File

@ -6,7 +6,7 @@ _cancel()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
COMPREPLY=( $( compgen -W "$( lpstat | cut -d' ' -f1 )" -- "$cur" ) ) COMPREPLY=( $( compgen -W "$( lpstat | cut -d' ' -f1 )" -- "$cur" ) )
} && } &&

View File

@ -60,8 +60,7 @@ _cvs()
local -a flags miss files entries changed newremoved local -a flags miss files entries changed newremoved
COMPREPLY=() COMPREPLY=()
cur=`_get_cword :` _get_comp_words_by_ref -n : cur prev
prev=`_get_pword :`
count=0 count=0
for i in "${COMP_WORDS[@]}"; do for i in "${COMP_WORDS[@]}"; do

View File

@ -4,7 +4,8 @@ have cvsps &&
_cvsps() _cvsps()
{ {
COMPREPLY=() COMPREPLY=()
local cur=`_get_cword :` prev=`_get_pword :` local cur prev
_get_comp_words_by_ref -n : cur prev
case $prev in case $prev in
-h|-z|-f|-d|-l|--diff-opts|--debuglvl) -h|-z|-f|-d|-l|--diff-opts|--debuglvl)

View File

@ -6,7 +6,7 @@ _dd()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword =` _get_comp_words_by_ref -n = cur
case $cur in case $cur in
if=*|of=*) if=*|of=*)

View File

@ -5,8 +5,7 @@ have dhclient && _dhclient()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-cf|-lf|-pf|-sf) -cf|-lf|-pf|-sf)

View File

@ -12,8 +12,7 @@ _dict()
local cur prev host port db dictfile local cur prev host port db dictfile
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
dictfile=/usr/share/dict/words dictfile=/usr/share/dict/words
for (( i=1; i < COMP_CWORD; i++ )); do for (( i=1; i < COMP_CWORD; i++ )); do

View File

@ -23,8 +23,7 @@ _dpkg()
local cur prev i local cur prev i
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
i=$COMP_CWORD i=$COMP_CWORD
_expand || return 0 _expand || return 0
@ -104,9 +103,7 @@ _dpkg_reconfigure()
local cur prev opt local cur prev opt
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-f|--frontend) -f|--frontend)
@ -146,8 +143,7 @@ _dpkg_source()
if [ "$1" != "dpkg-source" ]; then if [ "$1" != "dpkg-source" ]; then
return 1 return 1
fi fi
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
action="options" action="options"
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
if [[ ${COMP_WORDS[$i]} == "-x" ]]; then if [[ ${COMP_WORDS[$i]} == "-x" ]]; then

View File

@ -6,8 +6,7 @@ _dselect()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
--admindir) --admindir)

View File

@ -6,8 +6,7 @@ _arpspoof()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-i) -i)
@ -35,8 +34,7 @@ _dnsspoof()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-i) -i)
@ -62,8 +60,7 @@ _dsniff()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-r|-w|-f) -r|-w|-f)
@ -89,8 +86,7 @@ _snarf()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-i) -i)
@ -112,8 +108,7 @@ _macof()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-i) -i)
@ -136,7 +131,7 @@ _sshmitm()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-d -I -p' -- "$cur" ) ) COMPREPLY=( $( compgen -W '-d -I -p' -- "$cur" ) )
@ -153,8 +148,7 @@ _sshow()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-i) -i)
@ -176,8 +170,7 @@ _tcpkill()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-i) -i)
@ -199,8 +192,7 @@ _tcpnice()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-i) -i)
@ -222,8 +214,7 @@ _urlsnarf()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-i) -i)
@ -245,7 +236,7 @@ _webmitm()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-d' -- "$cur" ) ) COMPREPLY=( $( compgen -W '-d' -- "$cur" ) )

View File

@ -8,8 +8,7 @@ _find()
local cur prev i exprfound onlyonce local cur prev i exprfound onlyonce
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-maxdepth|-mindepth) -maxdepth|-mindepth)

View File

@ -6,8 +6,7 @@ _civserver()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-f|-g|-l|-r|--file|--log|--gamelog|--read) -f|-g|-l|-r|--file|--log|--gamelog|--read)
@ -31,8 +30,7 @@ _civclient()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-l|-S|-t|--log|--Sound|--tiles) -l|-S|-t|--log|--Sound|--tiles)

View File

@ -4,7 +4,8 @@ have fusermount &&
_fusermount() _fusermount()
{ {
COMPREPLY=() COMPREPLY=()
local cur=`_get_cword` prev=`_get_pword` local cur prev
_get_comp_words_by_ref cur prev
case $prev in case $prev in
-h|-V|-o) -h|-V|-o)

View File

@ -14,7 +14,7 @@ _gcc()
local cur cc backend local cur cc backend
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
_expand || return 0 _expand || return 0

View File

@ -7,7 +7,7 @@ _gcl()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
# completing an option (may or may not be separated by a space) # completing an option (may or may not be separated by a space)
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then

View File

@ -6,8 +6,7 @@ _gdb()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
if [ $COMP_CWORD -eq 1 ]; then if [ $COMP_CWORD -eq 1 ]; then
local IFS local IFS

View File

@ -6,8 +6,7 @@ _mkisofs()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-o|-abstract|-biblio|-check-session|-copyright|-log-file| \ -o|-abstract|-biblio|-check-session|-copyright|-log-file| \

View File

@ -6,8 +6,7 @@ _getent()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
passwd) passwd)

View File

@ -6,8 +6,7 @@ _gkrellm()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-t|--theme) -t|--theme)

View File

@ -6,7 +6,7 @@ _gnatmake()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
# relevant (and less relevant ;-) )options completion # relevant (and less relevant ;-) )options completion

View File

@ -6,8 +6,7 @@ _gpg()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-s|--sign|--clearsign|--decrypt-files|--load-extension) -s|--sign|--clearsign|--decrypt-files|--load-extension)

View File

@ -6,8 +6,7 @@ _gpg2 ()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
--homedir) --homedir)

View File

@ -6,8 +6,7 @@ _gzip()
local cur prev xspec helpopts local cur prev xspec helpopts
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
helpopts=`_parse_help ${COMP_WORDS[0]}` helpopts=`_parse_help ${COMP_WORDS[0]}`
case $prev in case $prev in

View File

@ -28,8 +28,7 @@ _ktutil()
local cur prev command options split=false local cur prev command options split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true

View File

@ -6,8 +6,7 @@ _iconv()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-f|-t|--from-code|--to-code) -f|-t|--from-code|--to-code)

View File

@ -3,8 +3,8 @@
have convert && { have convert && {
_ImageMagick() _ImageMagick()
{ {
local prev local cur prev
prev=${COMP_WORDS[COMP_CWORD-1]} _get_comp_words_by_ref cur prev
case $prev in case $prev in
-channel) -channel)
@ -135,7 +135,7 @@ _convert()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
_ImageMagick _ImageMagick
@ -196,7 +196,7 @@ _mogrify()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
_ImageMagick _ImageMagick
@ -252,7 +252,7 @@ _display()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
_ImageMagick _ImageMagick
@ -292,7 +292,7 @@ _animate()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
_ImageMagick _ImageMagick
@ -326,7 +326,7 @@ _identify()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
_ImageMagick _ImageMagick
@ -351,7 +351,7 @@ _montage()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
_ImageMagick _ImageMagick
@ -389,7 +389,7 @@ _composite()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
_ImageMagick _ImageMagick
@ -424,7 +424,7 @@ _compare()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
_ImageMagick _ImageMagick
@ -451,7 +451,7 @@ _conjure()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
_ImageMagick _ImageMagick
@ -471,7 +471,7 @@ _import()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
_ImageMagick _ImageMagick
@ -502,7 +502,7 @@ _stream()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
_ImageMagick _ImageMagick

View File

@ -6,7 +6,7 @@ _info()
local cur i infopath local cur i infopath
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
_expand || return 0 _expand || return 0

View File

@ -6,8 +6,7 @@ _ipmitool()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-I) -I)

View File

@ -6,8 +6,7 @@ _iptables()
local cur prev table chain local cur prev table chain
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
chain='s/^Chain \([^ ]\{1,\}\).*$/\1/p' chain='s/^Chain \([^ ]\{1,\}\).*$/\1/p'
if [[ $COMP_LINE == *-t\ *filter* ]]; then if [[ $COMP_LINE == *-t\ *filter* ]]; then

View File

@ -4,8 +4,9 @@ _ipv6calc()
local cur prev split=false local cur prev split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword =` _get_comp_words_by_ref -n = cur prev
prev=`_get_pword` #cur=`_get_cword =`
#prev=`_get_pword`
_split_longopt && split=true _split_longopt && split=true

View File

@ -4,7 +4,7 @@ have isql &&
_isql() _isql()
{ {
local cur local cur
cur=`_get_cword` _get_comp_words_by_ref cur
[ -f "$ODBCINI" ] \ [ -f "$ODBCINI" ] \
&& COMPREPLY=( $( command grep \\["$cur" "$ODBCINI" | tr -d \\[\\] ) ) && COMPREPLY=( $( command grep \\["$cur" "$ODBCINI" | tr -d \\[\\] ) )

View File

@ -6,7 +6,7 @@ _jar()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [ $COMP_CWORD = 1 ]; then if [ $COMP_CWORD = 1 ]; then
COMPREPLY=( $( compgen -W 'c t x u' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'c t x u' -- "$cur" ) )

View File

@ -121,8 +121,7 @@ _java()
local cur prev i local cur prev i
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
for ((i=1; i < $COMP_CWORD; i++)); do for ((i=1; i < $COMP_CWORD; i++)); do
case ${COMP_WORDS[$i]} in case ${COMP_WORDS[$i]} in
@ -174,8 +173,7 @@ _javadoc()
COMPREPLY=() COMPREPLY=()
local cur prev classpath local cur prev classpath
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-overview|-helpfile|-stylesheetfile) -overview|-helpfile|-stylesheetfile)
@ -222,8 +220,7 @@ _javac()
COMPREPLY=() COMPREPLY=()
local cur prev local cur prev
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-d) -d)
@ -253,7 +250,8 @@ have pack200 &&
_pack200() _pack200()
{ {
COMPREPLY=() COMPREPLY=()
local cur=`_get_cword` prev=`_get_pword` local cur prev
_get_comp_words_by_ref cur prev
case $prev in case $prev in
-S|--segment-limit|-P|--pass-file|-C|--class-attribute|\ -S|--segment-limit|-P|--pass-file|-C|--class-attribute|\
@ -320,7 +318,8 @@ have unpack200 &&
_unpack200() _unpack200()
{ {
COMPREPLY=() COMPREPLY=()
local cur=`_get_cword` prev=`_get_pword` local cur prev
_get_comp_words_by_ref cur prev
case $prev in case $prev in
'-?'|-h|--help|-V|--version|-J) '-?'|-h|--help|-V|--version|-J)
@ -365,7 +364,8 @@ have jarsigner &&
_jarsigner() _jarsigner()
{ {
COMPREPLY=() COMPREPLY=()
local cur=`_get_cword` prev=`_get_pword` local cur prev
_get_comp_words_by_ref cur prev
case $prev in case $prev in
-keystore) -keystore)

View File

@ -3,7 +3,8 @@
have k3b && have k3b &&
_k3b() _k3b()
{ {
local cur=`_get_cword` prev=${COMP_WORDS[COMP_CWORD-1]} local cur prev
_get_comp_words_by_ref cur prev
COMPREPLY=() COMPREPLY=()
case $prev in case $prev in

View File

@ -9,7 +9,7 @@ _kldload()
moddir=/modules/ moddir=/modules/
[ -d $moddir ] || moddir=/boot/kernel/ [ -d $moddir ] || moddir=/boot/kernel/
cur=`_get_cword` _get_comp_words_by_ref cur
COMPREPLY=( $( compgen -f "$moddir$cur" ) ) COMPREPLY=( $( compgen -f "$moddir$cur" ) )
COMPREPLY=( ${COMPREPLY[@]#$moddir} ) COMPREPLY=( ${COMPREPLY[@]#$moddir} )
@ -22,7 +22,7 @@ complete -F _kldload -o filenames kldload
_kldunload() _kldunload()
{ {
local cur local cur
cur=`_get_cword` _get_comp_words_by_ref cur
COMPREPLY=( $( kldstat | \ COMPREPLY=( $( kldstat | \
sed -ne "s/^.*[ \t]\{1,\}\($cur[a-z_]\{1,\}\).ko$/\1/p" ) ) sed -ne "s/^.*[ \t]\{1,\}\($cur[a-z_]\{1,\}\).ko$/\1/p" ) )
} }

View File

@ -6,8 +6,7 @@ _larch()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
if [[ $COMP_CWORD -eq 1 || "$prev" == -* ]]; then if [[ $COMP_CWORD -eq 1 || "$prev" == -* ]]; then
COMPREPLY=( $( compgen -W ' \ COMPREPLY=( $( compgen -W ' \

View File

@ -6,8 +6,7 @@ _ldapvi()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-h|--host) -h|--host)

View File

@ -6,8 +6,7 @@ _lftp()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-f) -f)
@ -34,7 +33,8 @@ have lftpget &&
_lftpget() _lftpget()
{ {
COMPREPLY=() COMPREPLY=()
local cur=`_get_cword` local cur
_get_comp_words_by_ref cur
if [[ "$cur" == -* ]] ; then if [[ "$cur" == -* ]] ; then
COMPREPLY=( $( compgen -W '-c -d -v' -- "$cur" ) ) COMPREPLY=( $( compgen -W '-c -d -v' -- "$cur" ) )

View File

@ -12,8 +12,7 @@ _lilo()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-C|-i|-m|-s|-S) -C|-i|-m|-s|-S)

View File

@ -6,7 +6,7 @@ _links()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
case $cur in case $cur in
--*) --*)

View File

@ -7,7 +7,7 @@ _lisp()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
# completing an option (may or may not be separated by a space) # completing an option (may or may not be separated by a space)
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then

View File

@ -49,7 +49,7 @@ _lvmdiskscan()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--debug --help \ COMPREPLY=( $( compgen -W '--debug --help \
@ -63,7 +63,7 @@ _pvscan()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--debug --exported --novolumegroup \ COMPREPLY=( $( compgen -W '--debug --exported --novolumegroup \
@ -78,8 +78,7 @@ _pvs()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-o|-O|--options|--sort) -o|-O|--options|--sort)
@ -111,8 +110,7 @@ _pvdisplay()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
--units) --units)
@ -135,8 +133,7 @@ _pvchange()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-A|-x|--autobackup|--allocatable) -A|-x|--autobackup|--allocatable)
@ -161,8 +158,7 @@ _pvcreate()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
--restorefile) --restorefile)
@ -200,8 +196,7 @@ _pvmove()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-A|--autobackup) -A|--autobackup)
@ -228,7 +223,7 @@ _pvremove()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--debug --force \ COMPREPLY=( $( compgen -W '--debug --force \
@ -244,7 +239,7 @@ _vgscan()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--debug --help \ COMPREPLY=( $( compgen -W '--debug --help \
@ -259,8 +254,7 @@ _vgs()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-o|-O|--options|--sort) -o|-O|--options|--sort)
@ -294,8 +288,7 @@ _vgdisplay()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
--units) --units)
@ -319,8 +312,7 @@ _vgchange()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-a|-A|-x|--available|--autobackup|--resizeable) -a|-A|-x|--available|--autobackup|--resizeable)
@ -346,8 +338,7 @@ _vgcreate()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-A|--autobackup) -A|--autobackup)
@ -385,7 +376,7 @@ _vgremove()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--debug --help --test \ COMPREPLY=( $( compgen -W '--debug --help --test \
@ -401,8 +392,7 @@ _vgrename()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-A|--autobackup) -A|--autobackup)
@ -425,8 +415,7 @@ _vgreduce()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-A|--autobackup) -A|--autobackup)
@ -456,8 +445,7 @@ _vgextend()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-A|--autobackup) -A|--autobackup)
@ -489,7 +477,7 @@ _vgport()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--all --debug \ COMPREPLY=( $( compgen -W '--all --debug \
@ -502,10 +490,10 @@ complete -F _vgport vgimport vgexport
_vgck() _vgck()
{ {
local cur prev local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--debug \ COMPREPLY=( $( compgen -W '--debug \
@ -521,8 +509,7 @@ _vgconvert()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-M|--metadatatype) -M|--metadatatype)
@ -554,8 +541,7 @@ _vgcfgbackup()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-f|--file) -f|--file)
@ -579,8 +565,7 @@ _vgcfgrestore()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-f|--file) -f|--file)
@ -612,8 +597,7 @@ _vgmerge()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-A|--autobackup) -A|--autobackup)
@ -636,8 +620,7 @@ _vgsplit()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-A|--autobackup) -A|--autobackup)
@ -670,7 +653,7 @@ _vgmknodes()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--debug --help --verbose \ COMPREPLY=( $( compgen -W '--debug --help --verbose \
@ -686,7 +669,7 @@ _lvscan()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--blockdevice --debug \ COMPREPLY=( $( compgen -W '--blockdevice --debug \
@ -701,8 +684,7 @@ _lvs()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-o|-O|--options|--sort) -o|-O|--options|--sort)
@ -733,8 +715,7 @@ _lvdisplay()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
--units) --units)
@ -757,8 +738,7 @@ _lvchange()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-a|-A|-C|-M|--available|--autobackup|--continguous|--persistent) -a|-A|-C|-M|--available|--autobackup|--continguous|--persistent)
@ -789,8 +769,7 @@ _lvcreate()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-A|-C|-M|-Z|--autobackup|--continguous|--persistent|--zero) -A|-C|-M|-Z|--autobackup|--continguous|--persistent|--zero)
@ -834,8 +813,7 @@ _lvremove()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-A|--autobackup) -A|--autobackup)
@ -858,8 +836,7 @@ _lvrename()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-A|--autobackup) -A|--autobackup)
@ -882,8 +859,7 @@ _lvreduce()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-A|--autobackup) -A|--autobackup)
@ -911,8 +887,7 @@ _lvresize()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-A|--autobackup) -A|--autobackup)
@ -946,8 +921,7 @@ _lvextend()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-A|--autobackup) -A|--autobackup)
@ -981,7 +955,7 @@ _lvm()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [ $COMP_CWORD -eq 1 ]; then if [ $COMP_CWORD -eq 1 ]; then
COMPREPLY=( $( compgen -W 'dumpconfig help lvchange \ COMPREPLY=( $( compgen -W 'dumpconfig help lvchange \

View File

@ -6,8 +6,7 @@ _lzma()
local cur prev xspec local cur prev xspec
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-1 -2 -3 -4 -5 -6 -7 -8 -9 \ COMPREPLY=( $( compgen -W '-1 -2 -3 -4 -5 -6 -7 -8 -9 \

View File

@ -6,8 +6,7 @@ _lzop()
local cur prev xspec local cur prev xspec
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-1 -2 -3 -4 -5 -6 -7 -8 -9 -P \ COMPREPLY=( $( compgen -W '-1 -2 -3 -4 -5 -6 -7 -8 -9 -P \

View File

@ -11,7 +11,7 @@ _list_lists()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--advertised --virtual-host-overview \ COMPREPLY=( $( compgen -W '--advertised --virtual-host-overview \
@ -28,8 +28,7 @@ _add_members()
local cur prev split=false local cur prev split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true
@ -63,8 +62,7 @@ _remove_members()
local cur prev split=false local cur prev split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true
@ -93,8 +91,7 @@ _find_member()
local cur prev split=false local cur prev split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true
@ -121,8 +118,7 @@ _clone_member()
local cur prev split=false local cur prev split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true
@ -149,8 +145,7 @@ _sync_members()
local cur prev split=false local cur prev split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true
@ -183,7 +178,7 @@ _unshunt()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--help' -- "$cur" ) ) COMPREPLY=( $( compgen -W '--help' -- "$cur" ) )
@ -200,7 +195,7 @@ _list_admins()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--all-vhost --all --help' -- "$cur" ) ) COMPREPLY=( $( compgen -W '--all-vhost --all --help' -- "$cur" ) )
@ -217,7 +212,7 @@ _list_owners()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--with-listnames --moderators \ COMPREPLY=( $( compgen -W '--with-listnames --moderators \
@ -235,8 +230,7 @@ _list_members()
local cur prev split=false local cur prev split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true
@ -274,8 +268,7 @@ _change_pw()
local cur prev split=false local cur prev split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true
@ -302,7 +295,7 @@ _withlist()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--lock --interactive \ COMPREPLY=( $( compgen -W '--lock --interactive \
@ -320,7 +313,7 @@ _newlist()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--language --quiet --help' -- "$cur" ) ) COMPREPLY=( $( compgen -W '--language --quiet --help' -- "$cur" ) )
@ -337,7 +330,7 @@ _rmlist()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--archives --help' -- "$cur" ) ) COMPREPLY=( $( compgen -W '--archives --help' -- "$cur" ) )
@ -354,8 +347,7 @@ _config_list()
local cur prev split=false local cur prev split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true
@ -386,8 +378,7 @@ _arch()
local cur prev split=false local cur prev split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true
@ -433,7 +424,7 @@ _cleanarch()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--status --dry-run --quiet \ COMPREPLY=( $( compgen -W '--status --dry-run --quiet \
@ -449,8 +440,7 @@ _inject()
local cur prev split=false local cur prev split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true
@ -478,7 +468,7 @@ _dumpdb()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--marshal --pickle --noprint \ COMPREPLY=( $( compgen -W '--marshal --pickle --noprint \
@ -496,7 +486,7 @@ _check_db()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--all --verbose --help' -- "$cur" ) ) COMPREPLY=( $( compgen -W '--all --verbose --help' -- "$cur" ) )
@ -513,7 +503,7 @@ _check_perms()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-f -v -h' -- "$cur" ) ) COMPREPLY=( $( compgen -W '-f -v -h' -- "$cur" ) )
@ -528,7 +518,7 @@ _genaliases()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--quiet --help' -- "$cur" ) ) COMPREPLY=( $( compgen -W '--quiet --help' -- "$cur" ) )
@ -543,7 +533,7 @@ _mmsitepass()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--listcreator --help' -- "$cur" ) ) COMPREPLY=( $( compgen -W '--listcreator --help' -- "$cur" ) )
@ -558,8 +548,7 @@ _qrunner()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && return 0 _split_longopt && return 0
@ -577,7 +566,7 @@ _mailmanctl()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--no-restart --run-as-user \ COMPREPLY=( $( compgen -W '--no-restart --run-as-user \

View File

@ -6,8 +6,7 @@ _make()
local file makef makef_dir="." makef_inc cur prev i split=false local file makef makef_dir="." makef_inc cur prev i split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true

View File

@ -11,8 +11,7 @@ _man()
mansect="@([0-9lnp]|[0-9][px]|3pm)" mansect="@([0-9lnp]|[0-9][px]|3pm)"
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
if [[ "$prev" == -l ]]; then if [[ "$prev" == -l ]]; then
_filedir $manext _filedir $manext

View File

@ -6,8 +6,7 @@ _mc()
local cur prev split=false local cur prev split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true

View File

@ -6,8 +6,7 @@ _mcrypt()
local cur prev i decrypt local cur prev i decrypt
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-g|--openpgp-z) -g|--openpgp-z)

View File

@ -75,8 +75,7 @@ _mdadm()
local cur prev mode options split=false local cur prev mode options split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true

View File

@ -6,8 +6,7 @@ _minicom()
local cur prev confdir local cur prev confdir
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-a|-c) -a|-c)

View File

@ -6,8 +6,7 @@ _mkinitrd()
local cur prev args split=false local cur prev args split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true

View File

@ -6,8 +6,7 @@ _mock()
local cur prev plugins cfgdir split=false local cur prev plugins cfgdir split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
plugins='tmpfs root_cache yum_cache bind_mount ccache' plugins='tmpfs root_cache yum_cache bind_mount ccache'
cfgdir=/etc/mock cfgdir=/etc/mock

View File

@ -4,7 +4,7 @@ have monodevelop &&
_monodevelop() _monodevelop()
{ {
local cur local cur
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-? -help -help2 -ipc-tcp -newwindow -nologo \ COMPREPLY=( $( compgen -W '-? -help -help2 -ipc-tcp -newwindow -nologo \
@ -23,8 +23,7 @@ _mdtool()
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
if [[ ${COMP_WORDS[i]} == @(build|generate-makefiles|setup) ]]; then if [[ ${COMP_WORDS[i]} == @(build|generate-makefiles|setup) ]]; then

View File

@ -12,8 +12,7 @@ _mount()
local cur sm host prev local cur sm host prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword ':'` _get_comp_words_by_ref -n : cur prev
prev=`_get_pword ':'`
[[ "$cur" == \\ ]] && cur="/" [[ "$cur" == \\ ]] && cur="/"
if [[ "$cur" == *:* ]]; then if [[ "$cur" == *:* ]]; then
@ -65,7 +64,7 @@ _umount()
local cur IFS=$'\n' local cur IFS=$'\n'
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
COMPREPLY=( $( compgen -W '$( mount | cut -d" " -f 3 )' -- "$cur" ) ) COMPREPLY=( $( compgen -W '$( mount | cut -d" " -f 3 )' -- "$cur" ) )

View File

@ -15,8 +15,7 @@ _mplayer()
COMPREPLY=() COMPREPLY=()
cmd=${COMP_WORDS[0]} cmd=${COMP_WORDS[0]}
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-[av][cfo]|-[av]fm|-vop|-fstype|-demuxer|-o[av]c|-of|-profile) -[av][cfo]|-[av]fm|-vop|-fstype|-demuxer|-o[av]c|-of|-profile)

View File

@ -6,11 +6,7 @@ _msynctool()
local cur prev anteprev local cur prev anteprev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev anteprev
prev=${COMP_WORDS[COMP_CWORD-1]}
if [ $COMP_CWORD -ge 2 ]; then
anteprev=${COMP_WORDS[COMP_CWORD-2]}
fi
case $anteprev in case $anteprev in
--configure) --configure)

View File

@ -6,8 +6,7 @@ _mtx()
local cur prev options tapes drives local cur prev options tapes drives
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
options="-f nobarcode invert noattach --version inquiry noattach \ options="-f nobarcode invert noattach --version inquiry noattach \
inventory status load unload eepos first last next" inventory status load unload eepos first last next"

View File

@ -6,8 +6,7 @@ _munin_run()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=`_get_pword`
case $prev in case $prev in
--config|--sconffile) --config|--sconffile)
@ -36,8 +35,7 @@ _munindoc()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=`_get_pword`
COMPREPLY=( $( compgen -W '$( command ls /usr/share/munin/plugins )' \ COMPREPLY=( $( compgen -W '$( command ls /usr/share/munin/plugins )' \
-- "$cur" ) ) -- "$cur" ) )
@ -50,8 +48,7 @@ _munin_update()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=`_get_pword`
case $prev in case $prev in
--config) --config)
@ -78,8 +75,7 @@ _munin_node_configure()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=`_get_pword`
case $prev in case $prev in
--config) --config)

View File

@ -137,8 +137,9 @@ _muttfiledir()
_mutt() _mutt()
{ {
local cur prev local cur prev
cur=`_get_cword =+!` _get_comp_words_by_ref -n =+! cur prev
prev=`_get_pword =+!` #cur=`_get_cword =+!`
#prev=`_get_pword =+!`
COMPREPLY=() COMPREPLY=()

View File

@ -6,8 +6,7 @@ _mysqladmin()
local cur prev split=false local cur prev split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true

View File

@ -6,7 +6,7 @@ _ncftp()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
if [[ $COMP_CWORD -eq 1 && -f ~/.ncftp/bookmarks ]]; then if [[ $COMP_CWORD -eq 1 && -f ~/.ncftp/bookmarks ]]; then
COMPREPLY=( $( compgen -W '$( sed -ne "s/^\([^,]\{1,\}\),.*$/\1/p" \ COMPREPLY=( $( compgen -W '$( sed -ne "s/^\([^,]\{1,\}\),.*$/\1/p" \

View File

@ -6,8 +6,7 @@ _mii_tool()
local cur prev split=false local cur prev split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true
@ -41,8 +40,7 @@ _mii_diag()
local cur prev split=false local cur prev split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true
@ -76,8 +74,7 @@ _route()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
if [ "$prev" = dev ]; then if [ "$prev" = dev ]; then
_available_interfaces _available_interfaces

View File

@ -6,8 +6,7 @@ _ntpdate()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-k) -k)

View File

@ -16,8 +16,7 @@ _ldapsearch()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-h) -h)
@ -64,8 +63,7 @@ _ldapaddmodify()
local cur prev options local cur prev options
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-h) -h)
@ -102,8 +100,7 @@ _ldapdelete()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-h) -h)
@ -136,8 +133,7 @@ _ldapcompare()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-h) -h)
@ -170,8 +166,7 @@ _ldapmodrdn()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-h) -h)
@ -204,8 +199,7 @@ _ldapwhoami()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-h) -h)
@ -238,8 +232,7 @@ _ldappasswd()
local cur prev local cur prev
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-h) -h)

View File

@ -32,7 +32,7 @@ _openssl()
local cur prev commands command options formats local cur prev commands command options formats
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
commands='asn1parse ca ciphers crl crl2pkcs7 dgst dh dhparam dsa \ commands='asn1parse ca ciphers crl crl2pkcs7 dgst dh dhparam dsa \
dsaparam ec ecparam enc engine errstr gendh gendsa genrsa \ dsaparam ec ecparam enc engine errstr gendh gendsa genrsa \
@ -53,7 +53,6 @@ _openssl()
COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) )
else else
command=${COMP_WORDS[1]} command=${COMP_WORDS[1]}
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in case $prev in
-CA|-CAfile|-CAkey|-CAserial|-cert|-certfile|-config|-content| \ -CA|-CAfile|-CAkey|-CAserial|-cert|-certfile|-config|-content| \
-dcert|-dkey|-dhparam|-extfile|-in|-inkey|-kfile|-key|-keyout| \ -dcert|-dkey|-dhparam|-extfile|-in|-inkey|-kfile|-key|-keyout| \

View File

@ -6,8 +6,7 @@ _p4()
local cur prev preprev p4commands p4filetypes local cur prev preprev p4commands p4filetypes
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev preprev
prev=${COMP_WORDS[COMP_CWORD-1]}
# rename isn't really a command # rename isn't really a command
p4commands="$( p4 help commands | awk 'NF>3 {print $1}' )" p4commands="$( p4 help commands | awk 'NF>3 {print $1}' )"
@ -31,7 +30,6 @@ _p4()
;; ;;
esac esac
elif [ $COMP_CWORD -gt 2 ]; then elif [ $COMP_CWORD -gt 2 ]; then
preprev=${COMP_WORDS[COMP_CWORD-2]}
case $prev in case $prev in
-t) -t)
case $preprev in case $preprev in

View File

@ -14,8 +14,7 @@ _perl()
local optPrefix optSuffix local optPrefix optSuffix
COMPREPLY=() COMPREPLY=()
cur=`_get_cword :` _get_comp_words_by_ref -n : cur prev
prev=`_get_pword :`
prefix="" prefix=""
# If option not followed by whitespace, reassign prev and cur # If option not followed by whitespace, reassign prev and cur
@ -55,8 +54,7 @@ _perldoc()
local cur prev prefix temp local cur prev prefix temp
COMPREPLY=() COMPREPLY=()
cur=`_get_cword :` _get_comp_words_by_ref -n : cur prev
prev=`_get_pword :`
prefix="" prefix=""
# completing an option (may or may not be separated by a space) # completing an option (may or may not be separated by a space)

View File

@ -6,7 +6,7 @@ _pineaddr()
local cur local cur
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur
COMPREPLY=( $( compgen -W '$( awk "{print \$1}" ~/.addressbook \ COMPREPLY=( $( compgen -W '$( awk "{print \$1}" ~/.addressbook \
2>/dev/null)' -- "$cur" ) ) 2>/dev/null)' -- "$cur" ) )

View File

@ -6,8 +6,7 @@ _pkg_config()
local cur prev split=false local cur prev split=false
COMPREPLY=() COMPREPLY=()
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true _split_longopt && split=true

View File

@ -8,8 +8,7 @@ _pkg_delete()
local cur pkgdir prev local cur pkgdir prev
pkgdir=${PKG_DBDIR:-/var/db/pkg}/ pkgdir=${PKG_DBDIR:-/var/db/pkg}/
cur=`_get_cword` _get_comp_words_by_ref cur prev
prev=${COMP_WORDS[COMP_CWORD-1]}
[[ "$prev" == -o || "$prev" == -p || "$prev" == -W ]] && return 0 [[ "$prev" == -o || "$prev" == -p || "$prev" == -W ]] && return 0

Some files were not shown because too many files have changed in this diff Show More