Merge branch 'master' into 1.x

This commit is contained in:
David Paleino 2010-06-11 11:12:11 +02:00
commit f85f534727
163 changed files with 547 additions and 656 deletions

View File

@ -204,6 +204,68 @@ dequote()
}
# Assign variable one scope above the caller
# Usage: local "$1" && _upvar $1 "value(s)"
# Param: $1 Variable name to assign value to
# Param: $* Value(s) to assign. If multiple values, an array is
# assigned, otherwise a single value is assigned.
# NOTE: For assigning multiple variables, use '_upvars'. Do NOT
# use multiple '_upvar' calls, since one '_upvar' call might
# reassign a variable to be used by another '_upvar' call.
# See: http://fvue.nl/wiki/Bash:_Passing_variables_by_reference
_upvar() {
if unset -v "$1"; then # Unset & validate varname
if (( $# == 2 )); then
eval $1=\"\$2\" # Return single value
else
eval $1=\(\"\${@:2}\"\) # Return array
fi
fi
}
# Assign variables one scope above the caller
# Usage: local varname [varname ...] &&
# _upvars [-v varname value] | [-aN varname [value ...]] ...
# Available OPTIONS:
# -aN Assign next N values to varname as array
# -v Assign single value to varname
# Return: 1 if error occurs
# See: http://fvue.nl/wiki/Bash:_Passing_variables_by_reference
_upvars() {
if ! (( $# )); then
echo "${FUNCNAME[0]}: usage: ${FUNCNAME[0]} [-v varname"\
"value] | [-aN varname [value ...]] ..." 1>&2
return 2
fi
while (( $# )); do
case $1 in
-a*)
# Error checking
[[ ${1#-a} ]] || { echo "bash: ${FUNCNAME[0]}: \`$1': missing"\
"number specifier" 1>&2; return 1; }
printf %d "${1#-a}" &> /dev/null || { echo "bash:"\
"${FUNCNAME[0]}: \`$1': invalid number specifier" 1>&2
return 1; }
# Assign array of -aN elements
[[ "$2" ]] && unset -v "$2" && eval $2=\(\"\${@:3:${1#-a}}\"\) &&
shift $((${1#-a} + 2)) || { echo "bash: ${FUNCNAME[0]}:"\
"\`$1${2+ }$2': missing argument(s)" 1>&2; return 1; }
;;
-v)
# Assign single value
[[ "$2" ]] && unset -v "$2" && eval $2=\"\$3\" &&
shift 3 || { echo "bash: ${FUNCNAME[0]}: $1: missing"\
"argument(s)" 1>&2; return 1; }
;;
*)
echo "bash: ${FUNCNAME[0]}: $1: invalid option" 1>&2
return 1 ;;
esac
done
}
# Reassemble command line words, excluding specified characters from the
# list of word completion separators (COMP_WORDBREAKS).
# @param $1 chars Characters out of $COMP_WORDBREAKS which should
@ -267,30 +329,10 @@ __reassemble_comp_words_by_ref() {
# @param $4 cur Name of variable to return current word to complete to
# @see ___get_cword_at_cursor_by_ref()
__get_cword_at_cursor_by_ref() {
# NOTE: The call to the main function ___get_cword_at_cursor_by_ref() is
# wrapped to make collisions with local variable names less likely.
local __words __cword __cur
___get_cword_at_cursor_by_ref "$1" __words __cword __cur
eval $2=\( \"\${__words[@]}\" \)
eval $3=\$__cword
eval $4=\$__cur
}
# @param $1 exclude
# @param $2 words Name of variable to return words to
# @param $3 cword Name of variable to return cword to
# @param $4 cur Name of variable to return current word to complete to
# @note Do not call this function directly but call
# `__get_cword_at_cursor_by_ref()' instead to make variable name collisions
# less likely
# @see __get_cword_at_cursor_by_ref()
___get_cword_at_cursor_by_ref() {
local cword words
local cword words=()
__reassemble_comp_words_by_ref "$1" words cword
local i
local i cur2
local cur="$COMP_LINE"
local index="$COMP_POINT"
for (( i = 0; i <= cword; ++i )); do
@ -318,13 +360,13 @@ ___get_cword_at_cursor_by_ref() {
if [[ "${words[cword]:0:${#cur}}" != "$cur" ]]; then
# We messed up. At least return the whole word so things keep working
eval $4=\"\${words[cword]}\"
cur2=${words[cword]}
else
eval $4=\"\${cur:0:\$index}\"
cur2=${cur:0:$index}
fi
eval $2=\( \"\${words[@]}\" \)
eval $3=\$cword
local "$2" "$3" "$4" &&
_upvars -a${#words[@]} $2 "${words[@]}" -v $3 "$cword" -v $4 "$cur2"
}
@ -334,62 +376,66 @@ ___get_cword_at_cursor_by_ref() {
# (For example, if the line is "ls foobar",
# and the cursor is here --------> ^
# Also one is able to cross over possible wordbreak characters.
# Usage: _get_comp_words_by_ref [OPTIONS] VAR1 [VAR2 [VAR3]]
# Usage: _get_comp_words_by_ref [OPTIONS] [VARNAMES]
# Available VARNAMES:
# cur Return cur via $cur
# prev Return prev via $prev
# words Return words via $words
# cword Return cword via $cword
#
# Available OPTIONS:
# -n EXCLUDE Characters out of $COMP_WORDBREAKS which should NOT be
# considered word breaks. This is useful for things like scp
# where we want to return host:path and not only path, so we
# would pass the colon (:) as -n option in this case. Bash-3
# doesn't do word splitting, so this ensures we get the same
# word on both bash-3 and bash-4.
# -c VARNAME Return cur via $VARNAME
# -p VARNAME Return prev via $VARNAME
# -w VARNAME Return words via $VARNAME
# -i VARNAME Return cword via $VARNAME
#
# Example usage:
#
# $ _get_comp_words_by_ref -n : cur prev
#
# Options: -n EXCLUDE Characters out of $COMP_WORDBREAKS which should NOT
# be considered word breaks. This is useful for things like scp where
# we want to return host:path and not only path, so we would pass the
# colon (:) as -n option in this case. Bash-3 doesn't do word splitting,
# so this ensures we get the same word on both bash-3 and bash-4.
# @see __get_comp_words_by_ref
_get_comp_words_by_ref() {
# NOTE: The call to the main function __get_comp_words_by_ref() is wrapped
# to make collisions with local variable name less likely.
local __words __cword __cur __var __vars
__get_comp_words_by_ref __words __cword __cur __vars "$@"
set -- "${__vars[@]}"
eval $1=\$__cur
shift
for __var; do
((__cword--))
[[ ${__words[__cword]} ]] && eval $__var=\${__words[__cword]}
done
}
# @param $1 words Name of variable to return words to
# @param $2 cword Name of variable to return cword to
# @param $3 cur Name of variable to return current word to complete to
# @param $4 varnames Name of variable to return array of variable names to
# @param $@ Arguments to _get_comp_words_by_ref()
# @note Do not call this function directly but call `_get_comp_words_by_ref()'
# instead to make variable name collisions less likely
# @see _get_comp_words_by_ref()
__get_comp_words_by_ref()
_get_comp_words_by_ref()
{
local exclude flag i OPTIND=5 # Skip first four arguments
local cword words cur varnames=()
while getopts "n:" flag "$@"; do
local exclude flag i OPTIND=1
local cur cword words=()
local upargs=() upvars=() vcur vcword vprev vwords
while getopts "c:i:n:p:w:" flag "$@"; do
case $flag in
c) vcur=$OPTARG ;;
i) vcword=$OPTARG ;;
n) exclude=$OPTARG ;;
p) vprev=$OPTARG ;;
w) vwords=$OPTARG ;;
esac
done
varnames=( ${!OPTIND} )
let "OPTIND += 1"
while [[ $# -ge $OPTIND ]]; do
varnames+=( ${!OPTIND} )
case ${!OPTIND} in
cur) vcur=cur ;;
prev) vprev=prev ;;
cword) vcword=cword ;;
words) vwords=words ;;
*) echo "bash: $FUNCNAME(): \`${!OPTIND}': unknown argument" \
1>&2; return 1
esac
let "OPTIND += 1"
done
__get_cword_at_cursor_by_ref "$exclude" words cword cur
eval $1=\( \"\${words[@]}\" \)
eval $2=\$cword
eval $3=\$cur
eval $4=\( \"\${varnames[@]}\" \)
[[ $vcur ]] && { upvars+=("$vcur" ); upargs+=(-v $vcur "$cur" ); }
[[ $vcword ]] && { upvars+=("$vcword"); upargs+=(-v $vcword "$cword"); }
[[ $vprev ]] && { upvars+=("$vprev" ); upargs+=(-v $vprev
"${words[cword - 1]}"); }
[[ $vwords ]] && { upvars+=("$vwords"); upargs+=(-a${#words[@]} $vwords
"${words[@]}"); }
(( ${#upvars[@]} )) && local "${upvars[@]}" && _upvars "${upargs[@]}"
}
@ -407,7 +453,8 @@ __get_comp_words_by_ref()
# current word (default is 0, previous is 1), respecting the exclusions
# given at $1. For example, `_get_cword "=:" 1' returns the word left of
# the current word, respecting the exclusions "=:".
#
# @deprecated Use `_get_comp_words_by_ref cur' instead
# @see _get_comp_words_by_ref()
_get_cword()
{
local LC_CTYPE=C
@ -461,7 +508,8 @@ _get_cword()
# This is a good alternative to `prev=${COMP_WORDS[COMP_CWORD-1]}' because bash4
# will properly return the previous word with respect to any given exclusions to
# COMP_WORDBREAKS.
# @see _get_cword()
# @deprecated Use `_get_comp_words_by_ref cur prev' instead
# @see _get_comp_words_by_ref()
#
_get_pword()
{
@ -786,7 +834,7 @@ __expand_tilde_by_ref() {
# becomes "~a". Double quotes allow eval.
# 2: Remove * before the first slash (/), i.e. "~a/b"
# becomes "b". Single quotes prevent eval.
# +-----1----+ +---2----+
# +-----1----+ +---2----+
eval $1="${!1/%\/*}"/'${!1#*/}'
else
# No, $1 doesn't contain slash
@ -1088,7 +1136,7 @@ _user_at_host() {
local cur
COMPREPLY=()
cur=`_get_cword :`
_get_comp_words_by_ref -n : cur
if [[ $cur == *@* ]]; then
_known_hosts_real "$cur"
@ -1294,7 +1342,8 @@ complete -F _known_hosts traceroute traceroute6 tracepath tracepath6 ping \
#
_cd()
{
local IFS=$'\t\n' cur=`_get_cword` i j k
local cur IFS=$'\t\n' i j k
_get_comp_words_by_ref cur
# try to allow variable completion
if [[ "$cur" == ?(\\)\$* ]]; then
@ -1397,7 +1446,7 @@ _command_offset()
COMP_CWORD=$(( $COMP_CWORD - $word_offset ))
COMPREPLY=()
cur=`_get_cword`
_get_comp_words_by_ref cur
if [[ $COMP_CWORD -eq 0 ]]; then
COMPREPLY=( $( compgen -c -- "$cur" ) )
@ -1452,8 +1501,7 @@ _longopt()
{
local cur prev
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
_get_comp_words_by_ref cur prev
if _split_longopt; then
case "$prev" in
@ -1499,7 +1547,7 @@ _filedir_xspec()
IFS=$'\t\n'
COMPREPLY=()
cur=`_get_cword`
_get_comp_words_by_ref cur
_expand || return 0

View File

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

View File

@ -49,8 +49,7 @@ _module ()
local cur prev options
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
_get_comp_words_by_ref cur prev
if [ $COMP_CWORD -eq 1 ] ; then
# 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
COMPREPLY=()
cur=`_get_cword`
_get_comp_words_by_ref cur prev
commands='add blame praise annotate ann cat checkout co cleanup commit \
ci copy cp delete del remove rm diff di export help ? h import \
@ -27,7 +27,6 @@ _svn()
fi
else
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in
--config-dir)
_filedir -d
@ -280,7 +279,7 @@ _svnadmin()
local cur prev commands options mode
COMPREPLY=()
cur=`_get_cword`
_get_comp_words_by_ref cur prev
commands='create deltify dump help ? hotcopy list-dblogs \
list-unused-dblogs load lslocks lstxns recover rmlocks \
@ -293,7 +292,6 @@ _svnadmin()
COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
fi
else
prev=${COMP_WORDS[COMP_CWORD-1]}
case $prev in
--config-dir)
_filedir -d
@ -359,7 +357,7 @@ _svnlook()
local cur prev commands options mode
COMPREPLY=()
cur=`_get_cword`
_get_comp_words_by_ref cur
commands='author cat changed date diff dirs-changed help ? h history \
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
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
_get_comp_words_by_ref cur prev
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
if [[ ${COMP_WORDS[i]} == @(install|update|upgrade|remove|erase|deplist|info) ]]; then

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -33,8 +33,7 @@ _hcitool()
local cur prev split=false arg
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
_get_comp_words_by_ref cur prev
_split_longopt && split=true
@ -116,8 +115,7 @@ _sdptool()
local cur prev split=false
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
_get_comp_words_by_ref cur prev
_split_longopt && split=true
@ -178,8 +176,7 @@ _l2ping()
local cur prev
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
_get_comp_words_by_ref cur prev
case $prev in
-i)
@ -202,8 +199,7 @@ _rfcomm()
local cur prev
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
_get_comp_words_by_ref cur prev
case $prev in
-f|--config)
@ -248,8 +244,7 @@ _ciptool()
local cur prev
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
_get_comp_words_by_ref cur prev
case $prev in
-i)
@ -285,8 +280,7 @@ _dfutool()
local cur prev
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
_get_comp_words_by_ref cur prev
case $prev in
-d|--device)
@ -317,7 +311,7 @@ _hciconfig()
local cur
COMPREPLY=()
cur=`_get_cword`
_get_comp_words_by_ref cur
_get_first_arg
if [ -z $arg ]; then
@ -363,7 +357,7 @@ _hciattach()
local cur
COMPREPLY=()
cur=`_get_cword`
_get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-n -p -t -b -s -l' -- "$cur" ) )
@ -401,7 +395,7 @@ _hid2hci()
local cur
COMPREPLY=()
cur=`_get_cword`
_get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--help --quiet -0 --tohci -1 \
@ -415,7 +409,7 @@ _avctrl()
local cur
COMPREPLY=()
cur=`_get_cword`
_get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--help --quiet' -- "$cur" ) )

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

3
contrib/configure vendored
View File

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

View File

@ -8,8 +8,7 @@ _chown()
local cur prev split=false
# Get cur and prev words; but don't treat user:group as separate words.
cur=`_get_cword :`
prev=`_get_pword :`
_get_comp_words_by_ref -n : cur prev
_split_longopt && split=true
@ -59,9 +58,8 @@ _chgrp()
local cur prev split=false
COMPREPLY=()
cur=`_get_cword`
_get_comp_words_by_ref cur prev
cur=${cur//\\\\/}
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true
@ -104,7 +102,7 @@ _id()
local cur
COMPREPLY=()
cur=`_get_cword`
_get_comp_words_by_ref cur
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-a -g --group -G --groups -n --name\

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,7 +6,7 @@ _ifupdown()
local cur
COMPREPLY=()
cur=`_get_cword`
_get_comp_words_by_ref cur
if [ $COMP_CWORD -eq 1 ]; then
_configured_interfaces

View File

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

View File

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

View File

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

View File

@ -6,7 +6,7 @@ _ipsec()
local cur
COMPREPLY=()
cur=`_get_cword`
_get_comp_words_by_ref cur
if [ $COMP_CWORD -eq 1 ]; then

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -9,7 +9,7 @@ _rmmod()
local cur
COMPREPLY=()
cur=`_get_cword`
_get_comp_words_by_ref cur
_installed_modules "$cur"
return 0
@ -26,8 +26,7 @@ _insmod()
local cur prev modpath
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
_get_comp_words_by_ref cur prev
# behave like lsmod for modprobe -r
if [[ ${1##*/} == modprobe && "${COMP_WORDS[1]}" == -r ]]; then

View File

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

View File

@ -80,8 +80,7 @@ _mount()
local cur sm host prev
COMPREPLY=()
cur=`_get_cword ':'`
prev=`_get_pword ':'`
_get_comp_words_by_ref -n : cur prev
case $prev in
-t|--types)
@ -138,10 +137,10 @@ complete -F _mount -o default -o dirnames mount
have umount &&
_umount()
{
local cur
_get_comp_words_by_ref cur
COMPREPLY=()
local cur=`_get_cword`
if [[ $(uname -s) = Linux && -r /proc/mounts ]]; then
# Linux /proc/mounts is properly quoted. This is important when
# unmounting usb devices with pretty names.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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