diff -Nru bash-completion-1.1/aclocal.m4 bash-completion-1.2/aclocal.m4 --- bash-completion-1.1/aclocal.m4 2009-10-10 15:24:37.000000000 +0100 +++ bash-completion-1.2/aclocal.m4 2010-06-16 16:45:21.000000000 +0100 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.11 -*- Autoconf -*- +# generated automatically by aclocal 1.11.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. @@ -13,8 +13,8 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.64],, -[m4_warning([this file was generated for autoconf 2.64. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],, +[m4_warning([this file was generated for autoconf 2.65. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) @@ -34,7 +34,7 @@ [am__api_version='1.11' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11], [], +m4_if([$1], [1.11.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -50,7 +50,7 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11])dnl +[AM_AUTOMAKE_VERSION([1.11.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) diff -Nru bash-completion-1.1/bash_completion bash-completion-1.2/bash_completion --- bash-completion-1.1/bash_completion 2009-10-10 14:45:12.000000000 +0100 +++ bash-completion-1.2/bash_completion 2010-06-16 16:44:20.000000000 +0100 @@ -1,9 +1,8 @@ # -# bash_completion - programmable completion functions for bash 3.x -# (backwards compatible with bash 2.05b) +# bash_completion - programmable completion functions for bash 3.2+ # # Copyright © 2006-2008, Ian Macdonald -# © 2009, Bash Completion Maintainers +# © 2009-2010, Bash Completion Maintainers # # # This program is free software; you can redistribute it and/or modify @@ -56,33 +55,6 @@ *) USERLAND=${UNAME} ;; esac -# features supported by bash 2.05 and higher -if [ ${BASH_VERSINFO[0]} -eq 2 ] && [[ ${BASH_VERSINFO[1]} > 04 ]] || - [ ${BASH_VERSINFO[0]} -gt 2 ]; then - declare -r bash205=$BASH_VERSION 2>/dev/null || : - default="-o default" - dirnames="-o dirnames" - filenames="-o filenames" - compopt=: -fi -# features supported by bash 2.05b and higher -if [ ${BASH_VERSINFO[0]} -eq 2 ] && [[ ${BASH_VERSINFO[1]} = "05b" ]] || - [ ${BASH_VERSINFO[0]} -gt 2 ]; then - declare -r bash205b=$BASH_VERSION 2>/dev/null || : - nospace="-o nospace" -fi -# features supported by bash 3.0 and higher -if [ ${BASH_VERSINFO[0]} -gt 2 ]; then - declare -r bash3=$BASH_VERSION 2>/dev/null || : - bashdefault="-o bashdefault" - plusdirs="-o plusdirs" -fi -# features supported by bash 4.0 and higher -if [ ${BASH_VERSINFO[0]} -gt 3 ]; then - declare -r bash4=$BASH_VERSION 2>/dev/null || : - compopt=compopt -fi - # Turn on extended globbing and programmable completion shopt -s extglob progcomp @@ -97,11 +69,11 @@ # # START exclude -- do NOT remove this line # bzcmp, bzdiff, bz*grep, bzless, bzmore intentionally not here, see Debian: #455510 -complete -f -X '!*.?(t)bz?(2)' bunzip2 bzcat -complete -f -X '!*.@(zip|ZIP|jar|JAR|exe|EXE|pk3|war|wsz|ear|zargo|xpi|sxw|ott|od[fgpst]|epub)' unzip zipinfo +complete -f -X '!*.?(t)bz?(2)' bunzip2 bzcat pbunzip2 pbzcat +complete -f -X '!*.@(zip|ZIP|[ejw]ar|[EJW]AR|exe|EXE|pk3|wsz|zargo|xpi|sxw|o[tx]t|od[fgpst]|epub)' unzip zipinfo complete -f -X '*.Z' compress znew # zcmp, zdiff, z*grep, zless, zmore intentionally not here, see Debian: #455510 -complete -f -X '!*.@(Z|gz|tgz|Gz|dz)' gunzip zcat +complete -f -X '!*.@(Z|[gGd]z|t[ag]z)' gunzip zcat unpigz complete -f -X '!*.Z' uncompress # lzcmp, lzdiff intentionally not here, see Debian: #455510 complete -f -X '!*.lzma' lzcat lzegrep lzfgrep lzgrep lzless lzmore unlzma @@ -114,13 +86,13 @@ complete -f -X '!*.@(dvi|DVI)' dvips dviselect dvitype dvipdf advi dvipdfm dvipdfmx complete -f -X '!*.@(pdf|PDF)' acroread gpdf xpdf complete -f -X '!*.@(?(e)ps|?(E)PS|pdf|PDF)' kpdf -complete -f -X '!*.@(@(?(e)ps|?(E)PS|pdf|PDF|dvi|DVI)?(.gz|.GZ|.bz2|.BZ2)|cb[rz]|CB[RZ]|djv?(u)|DJV?(U)|dvi|DVI|gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|GIF|JP?(E)G|MIFF|TIF?(F)|PN[GM]|P[BGP]M|BMP|XPM|ICO|XWD|TGA|PCX)' evince -complete -f -X '!*.@(?(e|x)ps|?(E|X)PS|pdf|PDF|dvi|DVI|cb[rz]|CB[RZ]|djv?(u)|DJV?(U)|dvi|DVI|gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|GIF|JP?(E)G|MIFF|TIF?(F)|PN[GM]|P[BGP]M|BMP|XPM|ICO|XWD|TGA|PCX|epub|EPUB|odt|ODT|fb|FB|mobi|MOBI|g3|G3|chm|CHM)?(.?(gz|GZ|bz2|BZ2))' okular +complete -f -X '!*.@(@(?(e)ps|?(E)PS|pdf|PDF|dvi|DVI)?(.gz|.GZ|.bz2|.BZ2)|cb[rz]|CB[RZ]|djv?(u)|DJV?(U)|dvi|DVI|gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|GIF|JP?(E)G|MIFF|TIF?(F)|PN[GM]|P[BGP]M|BMP|XPM|ICO|XWD|TGA|PCX|fdf|FDF)' evince +complete -f -X '!*.@(okular|@(?(e|x)ps|?(E|X)PS|pdf|PDF|dvi|DVI|cb[rz]|CB[RZ]|djv?(u)|DJV?(U)|dvi|DVI|gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|GIF|JP?(E)G|MIFF|TIF?(F)|PN[GM]|P[BGP]M|BMP|XPM|ICO|XWD|TGA|PCX|epub|EPUB|odt|ODT|fb|FB|mobi|MOBI|g3|G3|chm|CHM|fdf|FDF)?(.?(gz|GZ|bz2|BZ2)))' okular complete -f -X '!*.@(?(e)ps|?(E)PS|pdf|PDF)' ps2pdf ps2pdf12 ps2pdf13 ps2pdf14 ps2pdfwr complete -f -X '!*.texi*' makeinfo texi2html -complete -f -X '!*.@(?(la)tex|?(LA)TEX|texi|TEXI|dtx|DTX|ins|INS)' tex latex slitex jadetex pdfjadetex pdftex pdflatex texi2dvi +complete -f -X '!*.@(?(la)tex|?(LA)TEX|texi|TEXI|dtx|DTX|ins|INS|ltx|LTX)' tex latex slitex jadetex pdfjadetex pdftex pdflatex texi2dvi complete -f -X '!*.@(mp3|MP3)' mpg123 mpg321 madplay -complete -f -X '!*@(.@(mp?(e)g|MP?(E)G|wma|avi|AVI|asf|vob|VOB|bin|dat|divx|DIVX|vcd|ps|pes|fli|flv|FLV|viv|rm|ram|yuv|mov|MOV|qt|QT|wmv|mp[234]|MP[234]|m4[pv]|M4[PV]|mkv|MKV|og[gmv]|OG[GMV]|wav|WAV|asx|ASX|mng|MNG|srt|m[eo]d|M[EO]D|s[3t]m|S[3T]M|it|IT|xm|XM)|+([0-9]).@(vdr|VDR))' xine aaxine fbxine kaffeine +complete -f -X '!*@(.@(mp?(e)g|MP?(E)G|wma|avi|AVI|asf|vob|VOB|bin|dat|divx|DIVX|vcd|ps|pes|fli|flv|FLV|fxm|FXM|viv|rm|ram|yuv|mov|MOV|qt|QT|wmv|mp[234]|MP[234]|m4[pv]|M4[PV]|mkv|MKV|og[gmv]|OG[GMV]|t[ps]|T[PS]|wav|WAV|flac|FLAC|asx|ASX|mng|MNG|srt|m[eo]d|M[EO]D|s[3t]m|S[3T]M|it|IT|xm|XM)|+([0-9]).@(vdr|VDR))' xine aaxine fbxine kaffeine dragon complete -f -X '!*.@(avi|asf|wmv)' aviplay complete -f -X '!*.@(rm?(j)|ra?(m)|smi?(l))' realplay complete -f -X '!*.@(mpg|mpeg|avi|mov|qt)' xanim @@ -129,12 +101,12 @@ complete -f -X '!*.fig' xfig complete -f -X '!*.@(mid?(i)|MID?(I)|cmf|CMF)' playmidi complete -f -X '!*.@(mid?(i)|MID?(I)|rmi|RMI|rcp|RCP|[gr]36|[GR]36|g18|G18|mod|MOD|xm|XM|it|IT|x3m|X3M|s[3t]m|S[3T]M|kar|KAR)' timidity -complete -f -X '!*.@(m[eo]d|M[EO]D|s[3t]m|S[3T]M|xm|XM|it|IT)' modplugplay -complete -f -X '*.@(o|so|so.!(conf)|a|rpm|gif|GIF|jp?(e)g|JP?(E)G|mp3|MP3|mp?(e)g|MPG|avi|AVI|asf|ASF|ogg|OGG|class|CLASS)' vi vim gvim rvim view rview rgvim rgview gview -complete -f -X '*.@(o|so|so.!(conf)|a|rpm|gif|GIF|jp?(e)g|JP?(E)G|mp3|MP3|mp?(e)g|MPG|avi|AVI|asf|ASF|ogg|OGG|class|CLASS)' emacs -complete -f -X '!*.@(exe|EXE|com|COM|scr|SCR|exe.so)' wine +complete -f -X '!*.@(m[eo]d|M[EO]D|s[3t]m|S[3T]M|xm|XM|it|IT)' modplugplay modplug123 +complete -f -X '*.@(o|so|so.!(conf)|a|rpm|gif|GIF|jp?(e)g|JP?(E)G|mp3|MP3|mp?(e)g|MPG|avi|AVI|asf|ASF|ogg|OGG|class|CLASS)' vi vim gvim rvim view rview rgvim rgview gview emacs xemacs sxemacs kate kwrite +complete -f -X '!*.@([eE][xX][eE]?(.[sS][oO])|[cC][oO][mM]|[sS][cC][rR])' wine complete -f -X '!*.@(zip|ZIP|z|Z|gz|GZ|tgz|TGZ)' bzme -complete -f -X '!*.@(?([xX]|[sS])[hH][tT][mM]?([lL]))' netscape mozilla lynx opera galeon curl dillo elinks amaya +# konqueror not here on purpose, it's more than a web/html browser +complete -f -X '!*.@(?([xX]|[sS])[hH][tT][mM]?([lL]))' netscape mozilla lynx opera galeon dillo elinks amaya firefox mozilla-firefox iceweasel google-chrome chromium-browser epiphany complete -f -X '!*.@(sxw|stw|sxg|sgl|doc?([mx])|dot?([mx])|rtf|txt|htm|html|odt|ott|odm)' oowriter complete -f -X '!*.@(sxi|sti|pps?(x)|ppt?([mx])|pot?([mx])|odp|otp)' ooimpress complete -f -X '!*.@(sxc|stc|xls?([bmx])|xlw|xlt?([mx])|[ct]sv|ods|ots)' oocalc @@ -142,12 +114,15 @@ complete -f -X '!*.@(sxm|smf|mml|odf)' oomath complete -f -X '!*.odb' oobase complete -f -X '!*.rpm' rpm2cpio -complete -f -X '!*.sqlite' sqlite3 +complete -f -X '!*.s@(qlite?(3)|?(3)db)' sqlite3 complete -f -X '!*.aux' bibtex complete -f -X '!*.po' poedit gtranslator kbabel lokalize complete -f -X '!*.@([Pp][Rr][Gg]|[Cc][Ll][Pp])' harbour gharbour hbpp complete -f -X '!*.[Hh][Rr][Bb]' hbrun complete -f -X '!*.ly' lilypond ly2dvi +complete -f -X '!*.@(dif?(f)|?(d)patch)?(.@([gx]z|bz2|lzma))' cdiff +complete -f -X '!*.@(dif?(f)|?(d)patch)' kompare +complete -f -X '!*.lyx' lyx # FINISH exclude -- do not remove this line # start of section containing compspecs that can be handled within bash @@ -193,14 +168,12 @@ have() { unset -v have + # Completions for system administrator commands are installed as well in + # case completion is attempted via `sudo command ...'. PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type $1 &>/dev/null && have="yes" } -# use GNU sed if we have it, since its extensions are still used in our code -# -[ $USERLAND != GNU ] && have gsed && alias sed=gsed - # This function checks whether a given readline variable # is `on'. # @@ -215,19 +188,14 @@ echo \'${1//\'/\'\\\'\'}\' #'# Help vim syntax highlighting } -# This function quotes the argument in a way so that readline dequoting -# results in the original argument +# @see _quote_readline_by_ref() quote_readline() { - if [ -n "$bash4" ] ; then - # This function isn't really necessary on bash 4 - # See: http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00155.html - echo "${1}" - return - fi - local t="${1//\\/\\\\}" - echo \'${t//\'/\'\\\'\'}\' #'# Help vim syntax highlighting -} + local quoted + _quote_readline_by_ref "$1" ret + printf %s "$ret" +} # quote_readline() + # This function shell-dequotes the argument dequote() @@ -235,189 +203,490 @@ eval echo "$1" 2> /dev/null } -# Get the word to complete. + +# 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 +# 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 $1 here. +# @param $2 words Name of variable to return words to +# @param $3 cword Name of variable to return cword to +# +__reassemble_comp_words_by_ref() { + local exclude i j ref + # Exclude word separator characters? + if [[ $1 ]]; then + # Yes, exclude word separator characters; + # Exclude only those characters, which were really included + exclude="${1//[^$COMP_WORDBREAKS]}" + fi + + # Default to cword unchanged + eval $3=$COMP_CWORD + # Are characters excluded which were former included? + if [[ $exclude ]]; then + # Yes, list of word completion separators has shrunk; + # Re-assemble words to complete + for (( i=0, j=0; i < ${#COMP_WORDS[@]}; i++, j++)); do + # Is current word not word 0 (the command itself) and is word not + # empty and is word made up of just word separator characters to be + # excluded? + while [[ $i -gt 0 && ${COMP_WORDS[$i]} && + ${COMP_WORDS[$i]//[^$exclude]} == ${COMP_WORDS[$i]} + ]]; do + [ $j -ge 2 ] && ((j--)) + # Append word separator to current word + ref="$2[$j]" + eval $2[$j]=\${!ref}\${COMP_WORDS[i]} + # Indicate new cword + [ $i = $COMP_CWORD ] && eval $3=$j + # Indicate next word if available, else end *both* while and for loop + (( $i < ${#COMP_WORDS[@]} - 1)) && ((i++)) || break 2 + done + # Append word to current word + ref="$2[$j]" + eval $2[$j]=\${!ref}\${COMP_WORDS[i]} + # Indicate new cword + [ $i = $COMP_CWORD ] && [[ ${COMP_WORDS[i]} ]] && eval $3=$j + done + else + # No, list of word completions separators hasn't changed; + eval $2=\( \"\${COMP_WORDS[@]}\" \) + fi +} # __reassemble_comp_words_by_ref() + + +# @param $1 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 $1 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. +# @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 +# @see ___get_cword_at_cursor_by_ref() +__get_cword_at_cursor_by_ref() { + local cword words=() + __reassemble_comp_words_by_ref "$1" words cword + + local i cur2 + local cur="$COMP_LINE" + local index="$COMP_POINT" + for (( i = 0; i <= cword; ++i )); do + while [[ + # Current word fits in $cur? + "${#cur}" -ge ${#words[i]} && + # $cur doesn't match cword? + "${cur:0:${#words[i]}}" != "${words[i]}" + ]]; do + # Strip first character + cur="${cur:1}" + # Decrease cursor position + ((index--)) + done + + # Does found word matches cword? + if [[ "$i" -lt "$cword" ]]; then + # No, cword lies further; + local old_size="${#cur}" + cur="${cur#${words[i]}}" + local new_size="${#cur}" + index=$(( index - old_size + new_size )) + fi + done + + if [[ "${words[cword]:0:${#cur}}" != "$cur" ]]; then + # We messed up. At least return the whole word so things keep working + cur2=${words[cword]} + else + cur2=${cur:0:$index} + fi + + local "$2" "$3" "$4" && + _upvars -a${#words[@]} $2 "${words[@]}" -v $3 "$cword" -v $4 "$cur2" +} + + +# Get the word to complete and optional previous words. # This is nicer than ${COMP_WORDS[$COMP_CWORD]}, since it handles cases # where the user is completing in the middle of a word. # (For example, if the line is "ls foobar", # and the cursor is here --------> ^ -# it will complete just "foo", not "foobar", which is what the user wants.) -# @param $1 string (optional) 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. -# NOTE: This parameter only applies to bash-4. +# Also one is able to cross over possible wordbreak characters. +# 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 +# +_get_comp_words_by_ref() +{ + local exclude flag i OPTIND=1 + local cur cword words=() + local upargs=() upvars=() vcur vcword vprev vwords -_get_cword() -{ - if [ -n "$bash4" ] ; then - __get_cword4 "$@" - else - __get_cword3 - fi -} # _get_cword() + 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 + while [[ $# -ge $OPTIND ]]; do + 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 -# Get the word to complete on bash-3, where words are not broken by -# COMP_WORDBREAKS characters and the COMP_CWORD variables look like this, for -# example: -# -# $ a b:c -# COMP_CWORD: 1 -# COMP_CWORDS: -# 0: a -# 1: b:c -# -# See also: -# _get_cword, main routine -# __get_cword4, bash-4 variant -# -__get_cword3() + [[ $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[@]}" +} + + +# Get the word to complete. +# This is nicer than ${COMP_WORDS[$COMP_CWORD]}, since it handles cases +# where the user is completing in the middle of a word. +# (For example, if the line is "ls foobar", +# and the cursor is here --------> ^ +# @param $1 string 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 $1 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. +# @param $2 integer Index number of word to return, negatively offset to the +# 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() { - if [[ "${#COMP_WORDS[COMP_CWORD]}" -eq 0 ]] || [[ "$COMP_POINT" == "${#COMP_LINE}" ]]; then - printf "%s" "${COMP_WORDS[COMP_CWORD]}" + local LC_CTYPE=C + local cword words + __reassemble_comp_words_by_ref "$1" words cword + + # return previous word offset by $2 + if [[ ${2//[^0-9]/} ]]; then + printf "%s" "${words[cword-$2]}" + elif [[ "${#words[cword]}" -eq 0 ]] || [[ "$COMP_POINT" == "${#COMP_LINE}" ]]; then + printf "%s" "${words[cword]}" else local i local cur="$COMP_LINE" local index="$COMP_POINT" - for (( i = 0; i <= COMP_CWORD; ++i )); do + for (( i = 0; i <= cword; ++i )); do while [[ - # Current COMP_WORD fits in $cur? - "${#cur}" -ge ${#COMP_WORDS[i]} && - # $cur doesn't match COMP_WORD? - "${cur:0:${#COMP_WORDS[i]}}" != "${COMP_WORDS[i]}" - ]]; do + # Current word fits in $cur? + "${#cur}" -ge ${#words[i]} && + # $cur doesn't match cword? + "${cur:0:${#words[i]}}" != "${words[i]}" + ]]; do # Strip first character cur="${cur:1}" # Decrease cursor position - index="$(( index - 1 ))" + ((index--)) done - # Does found COMP_WORD matches COMP_CWORD? - if [[ "$i" -lt "$COMP_CWORD" ]]; then - # No, COMP_CWORD lies further; + # Does found word matches cword? + if [[ "$i" -lt "$cword" ]]; then + # No, cword lies further; local old_size="${#cur}" - cur="${cur#${COMP_WORDS[i]}}" + cur="${cur#${words[i]}}" local new_size="${#cur}" - index="$(( index - old_size + new_size ))" + index=$(( index - old_size + new_size )) fi done - if [[ "${COMP_WORDS[COMP_CWORD]:0:${#cur}}" != "$cur" ]]; then + if [[ "${words[cword]:0:${#cur}}" != "$cur" ]]; then # We messed up! At least return the whole word so things # keep working - printf "%s" "${COMP_WORDS[COMP_CWORD]}" + printf "%s" "${words[cword]}" else printf "%s" "${cur:0:$index}" fi fi -} # __get_cword3() +} # _get_cword() -# Get the word to complete on bash-4, where words are splitted by -# COMP_WORDBREAKS characters (default is " \t\n\"'><=;|&(:") and the COMP_CWORD -# variables look like this, for example: -# -# $ a b:c -# COMP_CWORD: 3 -# COMP_CWORDS: -# 0: a -# 1: b -# 2: : -# 3: c -# -# @oaram $1 string -# $1 string (optional) 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. -# See also: -# _get_cword, main routine -# __get_cword3, bash-3 variant -# -__get_cword4() -{ - local i - local LC_CTYPE=C - local WORDBREAKS=$COMP_WORDBREAKS - # Strip single quote (') and double quote (") from WORDBREAKS to - # workaround a bug in bash-4.0, where quoted words are split - # unintended, see: - # http://www.mail-archive.com/bug-bash@gnu.org/msg06095.html - # This fixes simple quoting (e.g. $ a "b returns "b instead of b) - # but still fails quoted spaces (e.g. $ a "b c returns c instead - # of "b c). - WORDBREAKS=${WORDBREAKS//\"/} - WORDBREAKS=${WORDBREAKS//\'/} - if [ -n "$1" ]; then - for (( i=0; i<${#1}; ++i )); do - local char=${1:$i:1} - WORDBREAKS=${WORDBREAKS//$char/} +# Get word previous to the current word. +# 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. +# @deprecated Use `_get_comp_words_by_ref cur prev' instead +# @see _get_comp_words_by_ref() +# +_get_pword() +{ + if [ $COMP_CWORD -ge 1 ]; then + _get_cword "${@:-}" 1; + fi +} + + +# If the word-to-complete contains a colon (:), left-trim COMPREPLY items with +# word-to-complete. +# On bash-3, and bash-4 with a colon in COMP_WORDBREAKS, words containing +# colons are always completed as entire words if the word to complete contains +# a colon. This function fixes this, by removing the colon-containing-prefix +# from COMPREPLY items. +# The preferred solution is to remove the colon (:) from COMP_WORDBREAKS in +# your .bashrc: +# +# # Remove colon (:) from list of word completion separators +# COMP_WORDBREAKS=${COMP_WORDBREAKS//:} +# +# See also: Bash FAQ - E13) Why does filename completion misbehave if a colon +# appears in the filename? - http://tiswww.case.edu/php/chet/bash/FAQ +# @param $1 current word to complete (cur) +# @modifies global array $COMPREPLY +# +__ltrim_colon_completions() { + # If word-to-complete contains a colon, + # and bash-version < 4, + # or bash-version >= 4 and COMP_WORDBREAKS contains a colon + if [[ + "$1" == *:* && ( + ${BASH_VERSINFO[0]} -lt 4 || + (${BASH_VERSINFO[0]} -ge 4 && "$COMP_WORDBREAKS" == *:*) + ) + ]]; then + # Remove colon-word prefix from COMPREPLY items + local colon_word=${1%${1##*:}} + local i=${#COMPREPLY[*]} + while [ $((--i)) -ge 0 ]; do + COMPREPLY[$i]=${COMPREPLY[$i]#"$colon_word"} done fi - local cur=${COMP_LINE:0:$COMP_POINT} - local tmp=$cur - local word_start=`expr "$tmp" : '.*['"$WORDBREAKS"']'` - while [ "$word_start" -ge 2 ]; do - # Get character before $word_start - local char=${cur:$(( $word_start - 2 )):1} - # If the WORDBREAK character isn't escaped, exit loop - if [ "$char" != "\\" ]; then - break +} # __ltrim_colon_completions() + + +# This function quotes the argument in a way so that readline dequoting +# results in the original argument. This is necessary for at least +# `compgen' which requires its arguments quoted/escaped: +# +# $ ls "a'b/" +# c +# $ compgen -f "a'b/" # Wrong, doesn't return output +# $ compgen -f "a\'b/" # Good (bash-4) +# a\'b/c +# $ compgen -f "a\\\\\'b/" # Good (bash-3) +# a\'b/c +# +# See also: http://lists.gnu.org/archive/html/bug-bash/2009-03/msg00155.html +# @param $1 Argument to quote +# @param $2 Name of variable to return result to +_quote_readline_by_ref() +{ + if [[ ${1:0:1} == "'" ]]; then + # Quote word, leaving out first character + printf -v $2 %q "${1:1}" + if [[ ${BASH_VERSINFO[0]} -le 3 ]]; then + # Double-quote word on bash-3 + printf -v $2 %q ${!2} fi - # The WORDBREAK character is escaped; - # Recalculate $word_start - tmp=${COMP_LINE:0:$(( $word_start - 2 ))} - word_start=`expr "$tmp" : '.*['"$WORDBREAKS"']'` - done + elif [[ ${BASH_VERSINFO[0]} -le 3 && ${1:0:1} == '"' ]]; then + printf -v $2 %q "${1:1}" + else + printf -v $2 %q "$1" + fi - cur=${cur:$word_start} - printf "%s" "$cur" -} # __get_cword4() + # If result becomes quoted like this: $'string', re-evaluate in order to + # drop the additional quoting. See also: http://www.mail-archive.com/ + # bash-completion-devel@lists.alioth.debian.org/msg01942.html + [[ ${!2:0:1} == '$' ]] && eval $2=${!2} +} # _quote_readline_by_ref() # This function performs file and directory completion. It's better than # simply using 'compgen -f', because it honours spaces in filenames. -# If passed -d, it completes only on directories. If passed anything else, -# it's assumed to be a file glob to complete on. +# @param $1 If `-d', complete only on directories. Otherwise filter/pick only +# completions with `.$1' as file extension. # _filedir() { - local IFS=$'\t\n' xspec + local i IFS=$'\t\n' xspec - _expand || return 0 + __expand_tilde_by_ref cur local -a toks - local tmp + local quoted tmp - # TODO: I've removed a "[ -n $tmp ] &&" before `echo $tmp', - # and everything works again. If this bug - # suddenly appears again (i.e. "cd /b" - # becomes "cd /"), remember to check for - # other similar conditionals (here and - # _filedir_xspec()). --David - # NOTE: The comment above has been moved outside of the subshell below, - # because quotes-in-comments-in-a-subshell cause errors on - # bash-3.1. See also: - # http://www.mail-archive.com/bug-bash@gnu.org/msg01667.html + _quote_readline_by_ref "$cur" quoted toks=( ${toks[@]-} $( - compgen -d -- "$(quote_readline "$cur")" | { - while read -r tmp; do - echo $tmp - done -} -)) + compgen -d -- "$quoted" | { + while read -r tmp; do + # TODO: I have removed a "[ -n $tmp ] &&" before 'printf ..', + # and everything works again. If this bug suddenly + # appears again (i.e. "cd /b" becomes "cd /"), + # remember to check for other similar conditionals (here + # and _filedir_xspec()). --David + printf '%s\n' $tmp + done + } + )) -if [[ "$1" != -d ]]; then - xspec=${1:+"!*.$1"} - toks=( ${toks[@]-} $( - compgen -f -X "$xspec" -- "$(quote_readline "$cur")" | { - while read -r tmp; do - [ -n $tmp ] && echo $tmp - done -} -)) + # On bash-3, special characters need to be escaped extra. This is + # unless the first character is a single quote ('). If the single + # quote appears further down the string, bash default completion also + # fails, e.g.: + # + # $ ls 'a&b/' + # f + # $ foo 'a&b/ # Becomes: foo 'a&b/f' + # $ foo a'&b/ # Nothing happens + # + if [[ "$1" != -d ]]; then + xspec=${1:+"!*.$1"} + if [[ ${cur:0:1} == "'" && ${BASH_VERSINFO[0]} -ge 4 ]]; then + toks=( ${toks[@]-} $( + eval compgen -f -X \"\$xspec\" -- $quoted + ) ) + else + toks=( ${toks[@]-} $( + compgen -f -X "$xspec" -- $quoted + ) ) + fi + if [ ${#toks[@]} -ne 0 ]; then + # If `compopt' is available, set `-o filenames' + compopt &>/dev/null && compopt -o filenames || + # No, `compopt' isn't available; + # Is `-o filenames' set? + [[ ( + ${COMP_WORDS[0]} && + "$(complete -p ${COMP_WORDS[0]})" == *"-o filenames"* + ) ]] || { + # No, `-o filenames' isn't set; + # Emulate `-o filenames' + # NOTE: A side-effect of emulating `-o filenames' is that + # backslash escape characters are visible within the list + # of presented completions, e.g. the completions look + # like: + # + # $ foo a + # a\ b/ a\$b/ + # + # whereas with `-o filenames' active the completions look + # like: + # + # $ ls a + # a b/ a$b/ + # + for ((i=0; i < ${#toks[@]}; i++)); do + # If directory exists, append slash (/) + if [[ ${cur:0:1} != "'" ]]; then + [[ -d ${toks[i]} ]] && toks[i]="${toks[i]}"/ + if [[ ${cur:0:1} == '"' ]]; then + toks[i]=${toks[i]//\\/\\\\} + toks[i]=${toks[i]//\"/\\\"} + toks[i]=${toks[i]//\$/\\\$} + else + toks[i]=$(printf %q ${toks[i]}) + fi + fi + done + } + fi fi COMPREPLY=( "${COMPREPLY[@]}" "${toks[@]}" ) -} +} # _filedir() + # This function splits $cur=--foo=bar into $prev=--foo, $cur=bar, making it # easier to support both "--foo bar" and "--foo=bar" style completions. @@ -441,11 +710,8 @@ _parse_help() { local cmd cmd=$1 - $cmd --help | \ - grep -- "^[[:space:]]*-" | \ - tr "," " " | \ - awk '{print $1; if ($2 ~ /-.*/) { print $2 } }' | \ - sed -e "s:=.*::g" + $cmd --help 2>&1 | command grep -- "^[[:space:]]*-" | tr "," " " | \ + awk '{print $1; if ($2 ~ /-.*/) { print $2 } }' | sed -e "s:=.*::g" } # This function completes on signal names @@ -464,29 +730,49 @@ done } +# This function completes on known mac addresses +# +_mac_addresses() +{ + local re='\([A-Fa-f0-9]\{2\}:\)\{5\}[A-Fa-f0-9]\{2\}' + local PATH="$PATH:/sbin:/usr/sbin" + + # Local interfaces (Linux only?) + COMPREPLY=( "${COMPREPLY[@]}" $( ifconfig -a 2>/dev/null | sed -ne \ + "s/.*[[:space:]]HWaddr[[:space:]]\{1,\}\($re\)[[:space:]]*$/\1/p" ) ) + + # ARP cache + COMPREPLY=( "${COMPREPLY[@]}" $( arp -an 2>/dev/null | sed -ne \ + "s/.*[[:space:]]\($re\)[[:space:]].*/\1/p" -ne \ + "s/.*[[:space:]]\($re\)[[:space:]]*$/\1/p" ) ) + + COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) ) + __ltrim_colon_completions "$cur" +} + # This function completes on configured network interfaces # _configured_interfaces() { if [ -f /etc/debian_version ]; then # Debian system - COMPREPLY=( $( sed -ne 's|^iface \([^ ]\+\).*$|\1|p' \ - /etc/network/interfaces ) ) + COMPREPLY=( $( compgen -W "$( sed -ne 's|^iface \([^ ]\{1,\}\).*$|\1|p'\ + /etc/network/interfaces )" -- "$cur" ) ) elif [ -f /etc/SuSE-release ]; then # SuSE system - COMPREPLY=( $( command ls \ - /etc/sysconfig/network/ifcfg-* | \ - sed -ne 's|.*ifcfg-\('"$cur"'.*\)|\1|p' ) ) + COMPREPLY=( $( compgen -W "$( printf '%s\n' \ + /etc/sysconfig/network/ifcfg-* | \ + sed -ne 's|.*ifcfg-\(.*\)|\1|p' )" -- "$cur" ) ) elif [ -f /etc/pld-release ]; then # PLD Linux - COMPREPLY=( $( command ls -B \ - /etc/sysconfig/interfaces | \ - sed -ne 's|.*ifcfg-\('"$cur"'.*\)|\1|p' ) ) + COMPREPLY=( $( compgen -W "$( command ls -B \ + /etc/sysconfig/interfaces | \ + sed -ne 's|.*ifcfg-\(.*\)|\1|p' )" -- "$cur" ) ) else # Assume Red Hat - COMPREPLY=( $( command ls \ - /etc/sysconfig/network-scripts/ifcfg-* | \ - sed -ne 's|.*ifcfg-\('"$cur"'.*\)|\1|p' ) ) + COMPREPLY=( $( compgen -W "$( printf '%s\n' \ + /etc/sysconfig/network-scripts/ifcfg-* | \ + sed -ne 's|.*ifcfg-\(.*\)|\1|p' )" -- "$cur" ) ) fi } @@ -513,10 +799,51 @@ cmd="ifconfig -a" fi - COMPREPLY=( $( eval $cmd 2>/dev/null | \ - sed -ne 's|^\('"$cur"'[^[:space:][:punct:]]\{1,\}\).*$|\1|p') ) + COMPREPLY=( $( eval PATH="$PATH:/sbin" $cmd 2>/dev/null | \ + awk '/^[^ \t]/ { print $1 }' ) ) + COMPREPLY=( $( compgen -W '${COMPREPLY[@]/%[[:punct:]]/}' -- "$cur" ) ) } + +# Expand variable starting with tilde (~) +# Only the first portion of the variable from the tilde up to the first slash +# (~../) is expanded. The remainder of the variable, containing for example +# a dollar sign variable ($) or asterisk (*) is not expanded. +# Example usage: +# +# $ v="~"; __expand_tilde_by_ref v; echo "$v" +# +# Example output: +# +# v output +# -------- ---------------- +# ~ /home/user +# ~foo/bar /home/foo/bar +# ~foo/$HOME /home/foo/$HOME +# ~foo/a b /home/foo/a b +# ~foo/* /home/foo/* +# +# @param $1 Name of variable (not the value of the variable) to expand +__expand_tilde_by_ref() { + # Does $1 start with tilde (~)? + if [ "${!1:0:1}" = "~" ]; then + # Does $1 contain slash (/)? + if [ "${!1}" != "${!1//\/}" ]; then + # Yes, $1 contains slash; + # 1: Remove * including and after first slash (/), i.e. "~a/b" + # becomes "~a". Double quotes allow eval. + # 2: Remove * before the first slash (/), i.e. "~a/b" + # becomes "b". Single quotes prevent eval. + # +-----1----+ +---2----+ + eval $1="${!1/%\/*}"/'${!1#*/}' + else + # No, $1 doesn't contain slash + eval $1="${!1}" + fi + fi +} # __expand_tilde_by_ref() + + # This function expands tildes in pathnames # _expand() @@ -540,7 +867,7 @@ # This function completes on process IDs. # AIX and Solaris ps prefers X/Open syntax. -[ $UNAME = SunOS -o $UNAME = AIX ] && +[[ $UNAME == SunOS || $UNAME == AIX ]] && _pids() { COMPREPLY=( $( compgen -W '$( command ps -efo pid | sed 1d )' -- "$cur" )) @@ -552,7 +879,7 @@ # This function completes on process group IDs. # AIX and SunOS prefer X/Open, all else should be BSD. -[ $UNAME = SunOS -o $UNAME = AIX ] && +[[ $UNAME == SunOS || $UNAME == AIX ]] && _pgids() { COMPREPLY=( $( compgen -W '$( command ps -efo pgid | sed 1d )' -- "$cur" )) @@ -564,13 +891,11 @@ # This function completes on process names. # AIX and SunOS prefer X/Open, all else should be BSD. -[ $UNAME = SunOS -o $UNAME = AIX ] && +[[ $UNAME == SunOS || $UNAME == AIX ]] && _pnames() { - COMPREPLY=( $( compgen -W '$( command ps -efo comm | \ - sed -e 1d -e "s:.*/::" -e "s/^-//" \ - -e "s/^$//")' \ - -- "$cur" ) ) + COMPREPLY=( $( compgen -X '' -W '$( command ps -efo comm | \ + sed -e 1d -e "s:.*/::" -e "s/^-//" | sort -u )' -- "$cur" ) ) } || _pnames() { @@ -582,11 +907,9 @@ # for now. # Not using "ps axo comm" because under some Linux kernels, it # truncates command names (see e.g. http://bugs.debian.org/497540#19) - COMPREPLY=( $( compgen -W '$( command ps axo command= | \ - sed -e "s/ .*//; s:.*/::; s/:$//;" \ - -e "s/^[[(-]//; s/[])]$//" \ - -e "s/^$//")' \ - -- "$cur" ) ) + COMPREPLY=( $( compgen -X '' -W '$( command ps axo command= | \ + sed -e "s/ .*//" -e "s:.*/::" -e "s/:$//" -e "s/^[[(-]//" \ + -e "s/[])]$//" | sort -u )' -- "$cur" ) ) } # This function completes on user IDs @@ -608,14 +931,13 @@ _gids() { if type getent &>/dev/null; then - COMPREPLY=( $( getent group | \ - awk -F: '{if ($3 ~ /^'"$cur"'/) print $3}' ) ) + COMPREPLY=( $( compgen -W '$( getent group | cut -d: -f3 )' \ + -- "$cur" ) ) elif type perl &>/dev/null; then COMPREPLY=( $( compgen -W '$( perl -e '"'"'while (($gid) = (getgrent)[2]) { print $gid . "\n" }'"'"' )' -- "$cur" ) ) else # make do with /etc/group - COMPREPLY=( $( awk 'BEGIN {FS=":"} {if ($3 ~ /^'"$cur"'/) print $3}'\ - /etc/group ) ) + COMPREPLY=( $( compgen -W '$( cut -d: -f3 /etc/group )' -- "$cur" ) ) fi } @@ -626,10 +948,12 @@ local sysvdir famdir [ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d || sysvdir=/etc/init.d famdir=/etc/xinetd.d - COMPREPLY=( $( builtin echo $sysvdir/!(*.rpm@(orig|new|save)|*~|functions)) ) + COMPREPLY=( $( printf '%s\n' \ + $sysvdir/!(*.rpm@(orig|new|save)|*~|functions) ) ) if [ -d $famdir ]; then - COMPREPLY=( "${COMPREPLY[@]}" $( builtin echo $famdir/!(*.rpm@(orig|new|save)|*~)) ) + COMPREPLY=( "${COMPREPLY[@]}" $( printf '%s\n' \ + $famdir/!(*.rpm@(orig|new|save)|*~) ) ) fi COMPREPLY=( $( compgen -W '${COMPREPLY[@]#@($sysvdir|$famdir)/}' -- "$cur" ) ) @@ -641,8 +965,8 @@ { local modpath modpath=/lib/modules/$1 - COMPREPLY=( $( command ls -R $modpath | \ - sed -ne 's/^\('"$cur"'.*\)\.k\?o\(\|.gz\)$/\1/p') ) + COMPREPLY=( $( compgen -W "$( command ls -R $modpath | \ + sed -ne 's/^\(.*\)\.k\{0,1\}o\(\.gz\)\{0,1\}$/\1/p' )" -- "$cur" ) ) } # This function completes on installed modules @@ -650,22 +974,41 @@ _installed_modules() { COMPREPLY=( $( compgen -W "$( PATH="$PATH:/sbin" lsmod | \ - awk '{if (NR != 1) print $1}' )" -- $1 ) ) + awk '{if (NR != 1) print $1}' )" -- "$1" ) ) } -# This function completes on user:group format +# This function completes on user or user:group format; as for chown and cpio. # +# The : must be added manually; it will only complete usernames initially. +# The legacy user.group format is not supported. +# +# It assumes compopt -o filenames; but doesn't touch it. _usergroup() { local IFS=$'\n' - cur=${cur//\\\\ / } - if [[ $cur = *@(\\:|.)* ]] && [ -n "$bash205" ]; then - user=${cur%%*([^:.])} - COMPREPLY=( $(compgen -P ${user/\\\\} -g -- ${cur##*[.:]}) ) - elif [[ $cur = *:* ]] && [ -n "$bash205" ]; then - COMPREPLY=( $( compgen -g -- ${cur##*[.:]} ) ) + if [[ $cur = *\\\\* || $cur = *:*:* ]]; then + # Give up early on if something seems horribly wrong. + return + elif [[ $cur = *\\:* ]]; then + # Completing group after 'user\:gr'. + # Reply with a list of groups prefixed with 'user:', readline will + # escape to the colon. + local prefix + prefix=${cur%%*([^:])} + prefix=${prefix//\\} + COMPREPLY=( $( compgen -P "$prefix" -g -- "${cur#*[:]}" ) ) + elif [[ $cur = *:* ]]; then + # Completing group after 'user:gr'. + # Reply with a list of unprefixed groups since readline with split on : + # and only replace the 'gr' part + COMPREPLY=( $( compgen -g -- "${cur#*:}" ) ) else - COMPREPLY=( $( compgen -S : -u -- "$cur" ) ) + # Completing a partial 'usernam'. + # + # Don't suffix with a : because readline will escape it and add a + # slash. It's better to complete into 'chown username ' than 'chown + # username\:'. + COMPREPLY=( $( compgen -u -- "$cur" ) ) fi } @@ -673,8 +1016,32 @@ # _shells() { - COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W '$( grep "^[[:space:]]*/" \ - /etc/shells 2>/dev/null )' -- "$cur" ) ) + COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W \ + '$( command grep "^[[:space:]]*/" /etc/shells 2>/dev/null )' \ + -- "$cur" ) ) +} + +# This function completes on valid filesystem types +# +_fstypes() +{ + local fss + + if [ -e /proc/filesystems ] ; then + # Linux + fss="$( cut -d$'\t' -f2 /proc/filesystems ) + $( awk '! /\*/ { print $NF }' /etc/filesystems 2>/dev/null )" + else + # Generic + fss="$( awk '/^[ \t]*[^#]/ { print $3 }' /etc/fstab 2>/dev/null ) + $( awk '/^[ \t]*[^#]/ { print $3 }' /etc/mnttab 2>/dev/null ) + $( awk '/^[ \t]*[^#]/ { print $4 }' /etc/vfstab 2>/dev/null ) + $( awk '{ print $1 }' /etc/dfs/fstypes 2>/dev/null ) + $( [ -d /etc/fs ] && command ls /etc/fs )" + fi + + [ -n "$fss" ] && \ + COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W "$fss" -- "$cur" ) ) } # Get real command. @@ -682,28 +1049,47 @@ # - stdout: Filename of command in PATH with possible symbolic links resolved. # Empty string if command not found. # - return: True (0) if command found, False (> 0) if not. -_realcommand() { +_realcommand() +{ type -P "$1" > /dev/null && { - if type -p realpath > /dev/null; then - realpath "$(type -P "$1")" - elif type -p readlink > /dev/null; then - readlink -f "$(type -P "$1")" - else - type -P "$1" - fi + if type -p realpath > /dev/null; then + realpath "$(type -P "$1")" + elif type -p readlink > /dev/null; then + readlink -f "$(type -P "$1")" + else + type -P "$1" + fi + } } + +# This function returns the first arugment, excluding options +# @param $1 chars Characters out of $COMP_WORDBREAKS which should +# NOT be considered word breaks. See __reassemble_comp_words_by_ref. +_get_first_arg() +{ + local i + + arg= + for (( i=1; i < COMP_CWORD; i++ )); do + if [[ "${COMP_WORDS[i]}" != -* ]]; then + arg=${COMP_WORDS[i]} + break + fi + done } -# this function count the number of mandatory args -# +# This function counts the number of args, excluding options +# @param $1 chars Characters out of $COMP_WORDBREAKS which should +# NOT be considered word breaks. See __reassemble_comp_words_by_ref. _count_args() { + local i cword words + __reassemble_comp_words_by_ref "$1" words cword + args=1 - for (( i=1; i < COMP_CWORD; i++ )); do - if [[ "${COMP_WORDS[i]}" != -* ]]; then - args=$(($args+1)) - fi + for i in "${words[@]:1:cword-1}"; do + [[ "$i" != -* ]] && args=$(($args+1)) done } @@ -712,7 +1098,7 @@ _pci_ids() { COMPREPLY=( ${COMPREPLY[@]:-} $( compgen -W \ - "$( PATH="$PATH:/sbin" lspci -n | awk '{print $3}')" -- "$cur" ) ) + "$( PATH="$PATH:/sbin" lspci -n | awk '{print $3}')" -- "$cur" ) ) } # This function completes on USB IDs @@ -720,411 +1106,29 @@ _usb_ids() { COMPREPLY=( ${COMPREPLY[@]:-} $( compgen -W \ - "$( PATH="$PATH:/sbin" lsusb | awk '{print $6}' )" -- "$cur" ) ) -} - -# start of section containing completion functions for external programs - -# a little help for FreeBSD ports users -[ $UNAME = FreeBSD ] && complete -W 'index search fetch fetch-list \ -extract patch configure build install reinstall \ -deinstall clean clean-depends kernel buildworld' make - -# This completes on a list of all available service scripts for the -# 'service' command and/or the SysV init.d directory, followed by -# that script's available commands -# -{ have service || [ -d /etc/init.d/ ]; } && - _service() - { - local cur prev sysvdir - - COMPREPLY=() - prev=${COMP_WORDS[COMP_CWORD-1]} - cur=`_get_cword` - - # don't complete for things like killall, ssh and mysql if it's - # the standalone command, rather than the init script - [[ ${COMP_WORDS[0]} != @(*init.d/!(functions|~)|service) ]] && return 0 - - # don't complete past 2nd token - [ $COMP_CWORD -gt 2 ] && return 0 - - [ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d \ - || sysvdir=/etc/init.d - - if [[ $COMP_CWORD -eq 1 ]] && [[ $prev == "service" ]]; then - _services - else - COMPREPLY=( $( compgen -W '`sed -ne "y/|/ /; \ - s/^.*\(U\|msg_u\)sage.*{\(.*\)}.*$/\1/p" \ - $sysvdir/${prev##*/} 2>/dev/null`' -- "$cur" ) ) - fi - - return 0 - } && - complete -F _service service - [ -d /etc/init.d/ ] && complete -F _service $default \ - $(for i in /etc/init.d/*; do echo ${i##*/}; done) - - # chown(1) completion - # - _chown() - { - local cur prev split=false - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} - - _split_longopt && split=true - - case "$prev" in - --from) - _usergroup - return 0 - ;; - --reference) - _filedir - return 0 - ;; - esac - - $split && return 0 - - # options completion - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes \ - --dereference --no-dereference --from --silent --quiet \ - --reference --recursive --verbose --help --version' -- "$cur" ) ) - else - _count_args - - case $args in - 1) - _usergroup - ;; - *) - _filedir - ;; - esac - fi - } - complete -F _chown $filenames chown - - # chgrp(1) completion - # - _chgrp() - { - local cur prev split=false - - COMPREPLY=() - cur=`_get_cword` - cur=${cur//\\\\/} - prev=${COMP_WORDS[COMP_CWORD-1]} - - _split_longopt && split=true - - if [[ "$prev" == --reference ]]; then - _filedir - return 0 - fi - - $split && return 0 - - # options completion - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes \ - --dereference --no-dereference --silent --quiet \ - --reference --recursive --verbose --help --version' -- "$cur" ) ) - return 0 - fi - - # first parameter on line or first since an option? - if [ $COMP_CWORD -eq 1 ] && [[ "$cur" != -* ]] || \ - [[ "$prev" == -* ]] && [ -n "$bash205" ]; then - local IFS=$'\n' - COMPREPLY=( $( compgen -g "$cur" 2>/dev/null ) ) - else - _filedir || return 0 - fi - - return 0 - } - complete -F _chgrp $filenames chgrp - - # umount(8) completion. This relies on the mount point being the third - # space-delimited field in the output of mount(8) - # - _umount() - { - local cur IFS=$'\n' - - COMPREPLY=() - cur=`_get_cword` - - COMPREPLY=( $( compgen -W '$( mount | cut -d" " -f 3 )' -- "$cur" ) ) - - return 0 - } - complete -F _umount $dirnames umount - - # mount(8) completion. This will pull a list of possible mounts out of - # /etc/{,v}fstab, unless the word being completed contains a ':', which - # would indicate the specification of an NFS server. In that case, we - # query the server for a list of all available exports and complete on - # that instead. - # - _mount() - { - local cur i sm host prev - - COMPREPLY=() - cur=`_get_cword` - [[ "$cur" == \\ ]] && cur="/" - prev=${COMP_WORDS[COMP_CWORD-1]} - - for i in {,/usr}/{,s}bin/showmount; do [ -x $i ] && sm=$i && break; done - - if [ -n "$sm" ] && [[ "$cur" == *:* ]]; then - COMPREPLY=( $( $sm -e ${cur%%:*} | sed 1d | \ - grep ^${cur#*:} | awk '{print $1}' ) ) - elif [[ "$cur" == //* ]]; then - host=${cur#//} - host=${host%%/*} - if [ -n "$host" ]; then - COMPREPLY=( $( compgen -W "$( echo $( smbclient -d 0 -NL $host 2>/dev/null| - sed -ne '/^['"$'\t '"']*Sharename/,/^$/p' | - sed -ne '3,$s|^[^A-Za-z]*\([^'"$'\t '"']*\).*$|//'$host'/\1|p' ) )" -- "$cur" ) ) - fi - elif [ -r /etc/vfstab ]; then - # Solaris - COMPREPLY=( $( compgen -W "$( awk '! /^[ \t]*#/ {if ($3 ~ /\//) print $3}' /etc/vfstab )" -- "$cur" ) ) - elif [ ! -e /etc/fstab ]; then - # probably Cygwin - COMPREPLY=( $( compgen -W "$( mount | awk '! /^[ \t]*#/ {if ($3 ~ /\//) print $3}' )" -- "$cur" ) ) - else - # probably Linux - if [ $prev = -L ]; then - COMPREPLY=( $( compgen -W '$(sed -ne "s/^[[:space:]]*LABEL=\([^[:space:]]*\).*/\1/p" /etc/fstab )' -- "$cur" ) ) - elif [ $prev = -U ]; then - COMPREPLY=( $( compgen -W '$(sed -ne "s/^[[:space:]]*UUID=\([^[:space:]]*\).*/\1/p" /etc/fstab )' -- "$cur" ) ) - else - COMPREPLY=( $( compgen -W "$( awk '! /^[ \t]*#/ {if ($2 ~ /\//) print $2}' /etc/fstab )" -- "$cur" ) ) - fi - fi - - return 0 - } - complete -F _mount $default $dirnames mount - - # Linux rmmod(8) completion. This completes on a list of all currently - # installed kernel modules. - # - have rmmod && { - _rmmod() - { - local cur - - COMPREPLY=() - cur=`_get_cword` - - _installed_modules "$cur" - return 0 - } - complete -F _rmmod rmmod - - # Linux insmod(8), modprobe(8) and modinfo(8) completion. This completes on a - # list of all available modules for the version of the kernel currently - # running. - # - _insmod() - { - local cur prev modpath - - COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} - - # behave like lsmod for modprobe -r - if [ $1 = "modprobe" ] && - [ "${COMP_WORDS[1]}" = "-r" ]; then - _installed_modules "$cur" - return 0 - fi - - # do filename completion if we're giving a path to a module - if [[ "$cur" == */* ]]; then - _filedir '@(?(k)o?(.gz))' - return 0 - fi - - if [ $COMP_CWORD -gt 1 ] && - [[ "${COMP_WORDS[COMP_CWORD-1]}" != -* ]]; then - # do module parameter completion - COMPREPLY=( $( /sbin/modinfo -p ${COMP_WORDS[1]} 2>/dev/null | \ - awk '{if ($1 ~ /^parm:/ && $2 ~ /^'"$cur"'/) { print $2 } \ - else if ($1 !~ /:/ && $1 ~ /^'"$cur"'/) { print $1 }}' ) ) - else - _modules $(uname -r) - fi - - return 0 - } - complete -F _insmod $filenames insmod modprobe modinfo + "$( PATH="$PATH:/sbin" lsusb | awk '{print $6}' )" -- "$cur" ) ) } -# renice(8) completion -# -_renice() +# CD device names +_cd_devices() { - local command cur curopt i - - COMPREPLY=() - cur=`_get_cword` - command=$1 - - i=0 - # walk back through command line and find last option - while [ $i -le $COMP_CWORD -a ${#COMPREPLY[@]} -eq 0 ]; do - curopt=${COMP_WORDS[COMP_CWORD-$i]} - case "$curopt" in - -u) - COMPREPLY=( $( compgen -u -- "$cur" ) ) - ;; - -g) - _pgids - ;; - -p|$command) - _pids - ;; - esac - i=$(( ++i )) - done + COMPREPLY=( "${COMPREPLY[@]}" + $( compgen -f -d -X "!*/?([amrs])cd*" -- "${cur:-/dev/}" ) ) } -complete -F _renice renice -# kill(1) completion -# -_kill() +# DVD device names +_dvd_devices() { - local cur - - COMPREPLY=() - cur=`_get_cword` - - if [ $COMP_CWORD -eq 1 ] && [[ "$cur" == -* ]]; then - # return list of available signals - _signals - else - # return list of available PIDs - _pids - fi -} -complete -F _kill kill - -# killall(1) (Linux and FreeBSD) and pkill(1) completion. -# -[ $UNAME = Linux -o $UNAME = FreeBSD ] || have pkill && -_killall() -{ - local cur - - COMPREPLY=() - cur=`_get_cword` - - if [ $COMP_CWORD -eq 1 ] && [[ "$cur" == -* ]]; then - _signals - else - _pnames - fi - - return 0 + COMPREPLY=( "${COMPREPLY[@]}" + $( compgen -f -d -X "!*/?(r)dvd*" -- "${cur:-/dev/}" ) ) } -[ $UNAME = Linux -o $UNAME = FreeBSD ] && complete -F _killall killall -have pkill && complete -F _killall pkill -# pgrep(1) completion. -# -[ $UNAME = Linux ] || have pgrep && -_pgrep() -{ - local cur - - COMPREPLY=() - cur=`_get_cword` - - _pnames - - return 0 -} -have pgrep && complete -F _pgrep pgrep - -# Linux pidof(8) completion. -[ $UNAME = Linux ] && complete -F _pgrep pidof - -# Red Hat & Debian GNU/Linux if{up,down} completion -# -[ $USERLAND = GNU ] && { have ifup || have ifdown; } && -_ifupdown() -{ - local cur - - COMPREPLY=() - cur=`_get_cword` - - if [ $COMP_CWORD -eq 1 ]; then - _configured_interfaces - COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") ) - fi - - return 0 -} && -complete -F _ifupdown ifup ifdown -[ $USERLAND = GNU ] && have ifstatus && complete -F _ifupdown ifstatus - -# Linux ipsec(8) completion (for FreeS/WAN) -# -[ $UNAME = Linux ] && have ipsec && -_ipsec() -{ - local cur - - COMPREPLY=() - cur=`_get_cword` - - - if [ $COMP_CWORD -eq 1 ]; then - COMPREPLY=( $( compgen -W 'auto barf eroute klipsdebug look \ - manual pluto ranbits rsasigkey \ - setup showdefaults showhostkey spi \ - spigrp tncfg whack' -- "$cur" ) ) - return 0 - fi - - case ${COMP_WORDS[1]} in - auto) - COMPREPLY=( $( compgen -W '--asynchronous --up --add --delete \ - --replace --down --route --unroute \ - --ready --status --rereadsecrets' \ - -- "$cur" ) ) - ;; - manual) - COMPREPLY=( $( compgen -W '--up --down --route --unroute \ - --union' -- "$cur" ) ) - ;; - ranbits) - COMPREPLY=( $( compgen -W '--quick --continuous --bytes' \ - -- "$cur" ) ) - ;; - setup) - COMPREPLY=( $( compgen -W '--start --stop --restart' -- "$cur" ) ) - ;; - *) - ;; - esac +# start of section containing completion functions for external programs - return 0 -} && -complete -F _ipsec ipsec +# a little help for FreeBSD ports users +[ $UNAME = FreeBSD ] && complete -W 'index search fetch fetch-list extract \ + patch configure build install reinstall deinstall clean clean-depends \ + kernel buildworld' make # This function provides simple user@host completion # @@ -1132,7 +1136,7 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref -n : cur if [[ $cur == *@* ]]; then _known_hosts_real "$cur" @@ -1142,7 +1146,7 @@ return 0 } -shopt -u hostcomplete && complete -F _user_at_host $nospace talk ytalk finger +shopt -u hostcomplete && complete -F _user_at_host -o nospace talk ytalk finger # NOTE: Using this function as a helper function is deprecated. Use # `_known_hosts_real' instead. @@ -1153,14 +1157,15 @@ # NOTE: Using `_known_hosts' as a helper function and passing options # to `_known_hosts' is deprecated: Use `_known_hosts_real' instead. - [ "$1" = -a ] || [ "$2" = -a ] && options=-a - [ "$1" = -c ] || [ "$2" = -c ] && options="$options -c" - _known_hosts_real $options "$(_get_cword)" -} + [[ "$1" == -a || "$2" == -a ]] && options=-a + [[ "$1" == -c || "$2" == -c ]] && options="$options -c" + _known_hosts_real $options "$(_get_cword :)" +} # _known_hosts() # Helper function for completing _known_hosts. -# This function performs host completion based on ssh's known_hosts files. -# Also hosts from HOSTFILE (compgen -A hostname) are added, unless +# This function performs host completion based on ssh's config and known_hosts +# files, as well as hostnames reported by avahi-browse. Also hosts from +# HOSTFILE (compgen -A hostname) are added, unless # COMP_KNOWN_HOSTS_WITH_HOSTFILE is set to an empty value. # Usage: _known_hosts_real [OPTIONS] CWORD # Options: -a Use aliases @@ -1171,7 +1176,7 @@ _known_hosts_real() { local configfile flag prefix - local cur curd awkcur user suffix aliases global_kh user_kh hosts i host + local cur curd awkcur user suffix aliases i host local -a kh khd config local OPTIND=1 @@ -1186,7 +1191,7 @@ [ $# -lt $OPTIND ] && echo "error: $FUNCNAME: missing mandatory argument CWORD" cur=${!OPTIND}; let "OPTIND += 1" [ $# -ge $OPTIND ] && echo "error: $FUNCNAME("$@"): unprocessed arguments:"\ - $(while [ $# -ge $OPTIND ]; do echo ${!OPTIND}; shift; done) + $(while [ $# -ge $OPTIND ]; do printf '%s\n' ${!OPTIND}; shift; done) [[ $cur == *@* ]] && user=${cur%@*}@ && cur=${cur#*@} kh=() @@ -1204,24 +1209,26 @@ config=( "${config[@]}" "${HOME}/.ssh2/config" ) fi + # Known hosts files from configs if [ ${#config[@]} -gt 0 ]; then local OIFS=$IFS IFS=$'\n' - # expand path (if present) to global known hosts file - global_kh=($( sed -ne 's/^[ \t]*[Gg][Ll][Oo][Bb][Aa][Ll][Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee]['"$'\t '"']*\(.*\)$/"\1"/p' "${config[@]}" )) - for (( i=0; i < ${#global_kh[@]}; i++ )); do - global_kh[i]=$(echo "${global_kh[i]//\"/}") - done - # expand path (if present) to user known hosts file - user_kh=($( sed -ne 's/^[ \t]*[Uu][Ss][Ee][Rr][Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee]['"$'\t '"']*\(.*\)$/"\1"/p' "${config[@]}" )) - for (( i=0; i < ${#user_kh[@]}; i++ )); do - user_kh[i]=$(echo "${user_kh[i]//\"/}") + local -a tmpkh + # expand paths (if present) to global and user known hosts files + # TODO(?): try to make known hosts files with more than one consecutive + # spaces in their name work (watch out for ~ expansion + # breakage! Alioth#311595) + tmpkh=( $( awk 'sub("^[ \t]*([Gg][Ll][Oo][Bb][Aa][Ll]|[Uu][Ss][Ee][Rr])[Kk][Nn][Oo][Ww][Nn][Hh][Oo][Ss][Tt][Ss][Ff][Ii][Ll][Ee][ \t]+", "") { print $0 }' "${config[@]}" | sort -u ) ) + for i in "${tmpkh[@]}"; do + # Remove possible quotes + i=${i//\"} + # Eval/expand possible `~' or `~user' + __expand_tilde_by_ref i + [ -r "$i" ] && kh=( "${kh[@]}" "$i" ) done IFS=$OIFS fi # Global known_hosts files - [ -r "$global_kh" ] && - kh=( "${kh[@]}" "${global_kh[@]}" ) if [ -z "$configfile" ]; then [ -r /etc/ssh/ssh_known_hosts ] && kh=( "${kh[@]}" /etc/ssh/ssh_known_hosts ) @@ -1236,8 +1243,6 @@ fi # User known_hosts files - [ -r "$user_kh" ] && - kh=( "${kh[@]}" "${user_kh[@]}" ) if [ -z "$configfile" ]; then [ -r ~/.ssh/known_hosts ] && kh=( "${kh[@]}" ~/.ssh/known_hosts ) @@ -1248,7 +1253,7 @@ fi # If we have known_hosts files to use - if [ ${#kh[@]} -gt 0 -o ${#khd[@]} -gt 0 -o -n "$configfile" ]; then + if [[ ${#kh[@]} -gt 0 || ${#khd[@]} -gt 0 ]]; then # Escape slashes and dots in paths for awk awkcur=${cur//\//\\\/} awkcur=${awkcur//\./\\\.} @@ -1270,7 +1275,7 @@ if [ ${#kh[@]} -gt 0 ]; then # FS needs to look for a comma separated list - COMPREPLY=( $( awk 'BEGIN {FS=","} + COMPREPLY=( "${COMPREPLY[@]}" $( awk 'BEGIN {FS=","} /^\s*[^|\#]/ {for (i=1; i<=2; ++i) { \ gsub(" .*$", "", $i); \ gsub("[\\[\\]]", "", $i); \ @@ -1284,34 +1289,13 @@ # dont fork any processes, because in a cluster environment, # there can be hundreds of hostkeys for i in "${khd[@]}" ; do - if [[ "$i" == *key_22_$awkcurd*.pub ]] && [ -r "$i" ] ; then + if [[ "$i" == *key_22_$curd*.pub && -r "$i" ]]; then host=${i/#*key_22_/} host=${host/%.pub/} COMPREPLY=( "${COMPREPLY[@]}" $host ) fi done fi - # append any available aliases from config files - if [ ${#config[@]} -gt 0 ] && [ -n "$aliases" ]; then - local host_aliases=$( sed -ne 's/^[ \t]*[Hh][Oo][Ss][Tt]\([Nn][Aa][Mm][Ee]\)\?['"$'\t '"']\+\([^#*?]*\)\(#.*\)\?$/\2/p' "${config[@]}" ) - hosts=$( compgen -W "$host_aliases" -- "$cur" ) - COMPREPLY=( "${COMPREPLY[@]}" $hosts ) - fi - - # Add hosts reported by avahi, if it's available - # and if the daemon is started. - # The original call to avahi-browse also had "-k", to avoid - # lookups into avahi's services DB. We don't need the name - # of the service, and if it contains ";", it may mistify - # the result. But on Gentoo (at least), -k isn't available - # (even if mentioned in the manpage), so... - if type avahi-browse >&/dev/null; then - if [ -n "$(pidof avahi-daemon)" ]; then - COMPREPLY=( "${COMPREPLY[@]}" $( - compgen -W "$( avahi-browse -cpr _workstation._tcp | \ - grep ^= | cut -d\; -f7 | sort -u )" -- "$cur" ) ) - fi - fi # apply suffix and prefix for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do @@ -1319,23 +1303,47 @@ done fi - # Add results of normal hostname completion, unless `COMP_KNOWN_HOSTS_WITH_HOSTFILE' - # is set to an empty value. + # append any available aliases from config files + if [[ ${#config[@]} -gt 0 && -n "$aliases" ]]; then + local hosts=$( sed -ne 's/^[ \t]*[Hh][Oo][Ss][Tt]\([Nn][Aa][Mm][Ee]\)\{0,1\}['"$'\t '"']\{1,\}\([^#*?]*\)\(#.*\)\{0,1\}$/\2/p' "${config[@]}" ) + COMPREPLY=( "${COMPREPLY[@]}" $( compgen -P "$prefix$user" \ + -S "$suffix" -W "$hosts" -- "$cur" ) ) + fi + + # Add hosts reported by avahi-browse, if it's available. + # The original call to avahi-browse also had "-k", to avoid lookups into + # avahi's services DB. We don't need the name of the service, and if it + # contains ";", it may mistify the result. But on Gentoo (at least), + # -k isn't available (even if mentioned in the manpage), so... + if type avahi-browse >&/dev/null; then + COMPREPLY=( "${COMPREPLY[@]}" $( \ + compgen -P "$prefix$user" -S "$suffix" -W \ + "$( avahi-browse -cpr _workstation._tcp 2>/dev/null | \ + awk -F';' '/^=/ { print $7 }' | sort -u )" -- "$cur" ) ) + fi + + # Add results of normal hostname completion, unless + # `COMP_KNOWN_HOSTS_WITH_HOSTFILE' is set to an empty value. if [ -n "${COMP_KNOWN_HOSTS_WITH_HOSTFILE-1}" ]; then - COMPREPLY=( "${COMPREPLY[@]}" $( compgen -A hostname -P "$prefix$user" -S "$suffix" -- "$cur" ) ) + COMPREPLY=( "${COMPREPLY[@]}" + $( compgen -A hostname -P "$prefix$user" -S "$suffix" -- "$cur" ) ) fi + __ltrim_colon_completions "$prefix$user$cur" + return 0 -} -complete -F _known_hosts traceroute traceroute6 tracepath tracepath6 \ -ping ping6 fping fping6 telnet host nslookup rsh rlogin ftp dig ssh-installkeys mtr +} # _known_hosts_real() +complete -F _known_hosts traceroute traceroute6 tracepath tracepath6 ping \ + ping6 fping fping6 telnet host nslookup rsh rlogin ftp dig mtr \ + ssh-installkeys showmount # This meta-cd function observes the CDPATH variable, so that cd additionally # completes on directories under those specified in CDPATH. # _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 @@ -1348,7 +1356,7 @@ # Use standard dir completion if no CDPATH or parameter starts with /, # ./ or ../ - if [ -z "${CDPATH:-}" ] || [[ "$cur" == ?(.)?(.)/* ]]; then + if [[ -z "${CDPATH:-}" || "$cur" == ?(.)?(.)/* ]]; then _filedir -d return 0 fi @@ -1372,7 +1380,7 @@ if [[ ${#COMPREPLY[@]} -eq 1 ]]; then i=${COMPREPLY[0]} - if [ "$i" == "$cur" ] && [[ $i != "*/" ]]; then + if [[ "$i" == "$cur" && $i != "*/" ]]; then COMPREPLY[0]="${i}/" fi fi @@ -1380,9 +1388,9 @@ return 0 } if shopt -q cdable_vars; then - complete -v -F _cd $nospace cd + complete -v -F _cd -o nospace cd else - complete -F _cd $nospace cd + complete -F _cd -o nospace cd fi # a wrapper method for the next one, when the offset is unknown @@ -1409,7 +1417,7 @@ _command_offset() { local cur func cline cspec noglob cmd i char_offset word_offset \ - _COMMAND_FUNC _COMMAND_FUNC_ARGS + _COMMAND_FUNC _COMMAND_FUNC_ARGS word_offset=$1 @@ -1438,7 +1446,7 @@ 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" ) ) @@ -1479,21 +1487,21 @@ [ ${#COMPREPLY[@]} -eq 0 ] && _filedir } -complete -F _command $filenames nohup exec nice eval time ltrace then \ - else do vsound command xargs tsocks +complete -F _command -o filenames nohup exec nice eval time ltrace then \ + else do vsound command xargs tsocks aoss padsp _root_command() { - PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin _command $1 $2 $3 + local PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin + _command $1 $2 $3 } -complete -F _root_command $filenames sudo fakeroot really gksudo gksu kdesudo +complete -F _root_command -o filenames sudo fakeroot really gksudo gksu kdesudo _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 @@ -1508,8 +1516,8 @@ fi if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$( $1 --help 2>&1 | sed -e '/--/!d' \ - -e 's/.*\(--[-A-Za-z0-9]\+\).*/\1/' |sort -u )"\ + COMPREPLY=( $( compgen -W "$( $1 --help 2>&1 | \ + sed -ne 's/.*\(--[-A-Za-z0-9]\{1,\}\).*/\1/p' | sort -u )" \ -- "$cur" ) ) elif [[ "$1" == rmdir ]]; then _filedir -d @@ -1519,68 +1527,33 @@ } # makeinfo and texi2dvi are defined elsewhere. for i in a2ps autoconf automake bc gprof ld nm objcopy objdump readelf strip \ - bison diff patch enscript cp df dir du ln ls mkfifo mknod mv rm \ + bison colordiff diff patch enscript cp df dir du ln ls mkfifo mknod mv rm \ touch vdir awk gperf grep grub indent less m4 sed shar date \ tee who texindex cat csplit cut expand fmt fold head \ md5sum nl od paste pr ptx sha1sum sort split tac tail tr unexpand \ - uniq wc ldd bash id irb mkdir rmdir; do - have $i && complete -F _longopt $filenames $i + uniq wc ldd bash id irb mkdir rmdir wget curl; do + have $i && complete -F _longopt -o filenames $i done # These commands do not use filenames, so '-o filenames' is not needed. -for i in env netstat seq uname units wget; do - have $i && complete -F _longopt $default $i +for i in env netstat seq uname units; do + have $i && complete -F _longopt -o default $i done unset i -# look(1) completion -# -have look && -_look() -{ - local cur - - COMPREPLY=() - cur=`_get_cword` - - if [ $COMP_CWORD = 1 ]; then - COMPREPLY=( $( compgen -W '$(look "$cur" 2>/dev/null)' ) ) - fi -} && -complete -F _look $default look - -# id(1) completion -# -have id && -_id() -{ - local cur - - COMPREPLY=() - cur=`_get_cword` - - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-a -g --group -G --groups -n --name\ - -r --real -u --user --help --version' -- "$cur" ) ) - else - COMPREPLY=( $( compgen -u "$cur" ) ) - fi -} && -complete -F _id id - _filedir_xspec() { local IFS cur xspec IFS=$'\t\n' COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur _expand || return 0 # get first exclusion compspec that matches this command - xspec=$( sed -ne $'/^complete .*[ \t]'${1##*/}$'\([ \t]\|$\)/{p;q;}' \ - $BASH_COMPLETION ) + xspec=$( awk "/^complete[ \t]+.*[ \t]${1##*/}([ \t]|\$)/ { print \$0; exit }" \ + "$BASH_COMPLETION" ) # prune to leave nothing but the -X spec xspec=${xspec#*-X } xspec=${xspec%% *} @@ -1592,7 +1565,7 @@ compgen -d -- "$(quote_readline "$cur")" | { while read -r tmp; do # see long TODO comment in _filedir() --David - echo $tmp + printf '%s\n' $tmp done } )) @@ -1600,14 +1573,14 @@ toks=( ${toks[@]-} $( eval compgen -f -X "$xspec" -- "\$(quote_readline "\$cur")" | { while read -r tmp; do - [ -n $tmp ] && echo $tmp + [ -n $tmp ] && printf '%s\n' $tmp done } )) COMPREPLY=( "${toks[@]}" ) } -list=( $( sed -ne '/^# START exclude/,/^# FINISH exclude/p' $BASH_COMPLETION | \ +list=( $( sed -ne '/^# START exclude/,/^# FINISH exclude/p' "$BASH_COMPLETION" | \ # read exclusion compspecs ( while read line @@ -1619,41 +1592,42 @@ line=${line##*\'} list=( "${list[@]}" $line ) done - echo "${list[@]}" + printf '%s ' "${list[@]}" ) ) ) # remove previous compspecs if [ ${#list[@]} -gt 0 ]; then eval complete -r ${list[@]} # install new compspecs - eval complete -F _filedir_xspec $filenames "${list[@]}" + eval complete -F _filedir_xspec -o filenames "${list[@]}" fi unset list # source completion directory definitions -if [ -d $BASH_COMPLETION_COMPAT_DIR -a -r $BASH_COMPLETION_COMPAT_DIR -a \ - -x $BASH_COMPLETION_COMPAT_DIR ]; then - for i in $BASH_COMPLETION_COMPAT_DIR/*; do - [[ ${i##*/} != @(*~|*.bak|*.swp|\#*\#|*.dpkg*|*.rpm@(orig|new|save)) ]] && - [ \( -f $i -o -h $i \) -a -r $i ] && . $i +if [[ -d $BASH_COMPLETION_COMPAT_DIR && -r $BASH_COMPLETION_COMPAT_DIR && \ + -x $BASH_COMPLETION_COMPAT_DIR ]]; then + for i in $(LC_ALL=C command ls "$BASH_COMPLETION_COMPAT_DIR"); do + i=$BASH_COMPLETION_COMPAT_DIR/$i + [[ ${i##*/} != @(*~|*.bak|*.swp|\#*\#|*.dpkg*|*.rpm@(orig|new|save)) \ + && ( -f $i || -h $i ) && -r $i ]] && . "$i" done fi -if [ -d $BASH_COMPLETION_DIR -a -r $BASH_COMPLETION_DIR -a \ - $BASH_COMPLETION_DIR != $BASH_COMPLETION_COMPAT_DIR -a \ - -x $BASH_COMPLETION_DIR ]; then - for i in $BASH_COMPLETION_DIR/*; do - [[ ${i##*/} != @(*~|*.bak|*.swp|\#*\#|*.dpkg*|*.rpm@(orig|new|save)) ]] && - [ \( -f $i -o -h $i \) -a -r $i ] && . $i +if [[ $BASH_COMPLETION_DIR != $BASH_COMPLETION_COMPAT_DIR && \ + -d $BASH_COMPLETION_DIR && -r $BASH_COMPLETION_DIR && \ + -x $BASH_COMPLETION_DIR ]]; then + for i in $(LC_ALL=C command ls "$BASH_COMPLETION_DIR"); do + i=$BASH_COMPLETION_DIR/$i + [[ ${i##*/} != @(*~|*.bak|*.swp|\#*\#|*.dpkg*|*.rpm@(orig|new|save)) \ + && ( -f $i || -h $i ) && -r $i ]] && . "$i" done fi unset i # source user completion file -[ $BASH_COMPLETION != ~/.bash_completion -a -r ~/.bash_completion ] \ +[[ $BASH_COMPLETION != ~/.bash_completion && -r ~/.bash_completion ]] \ && . ~/.bash_completion unset -f have -unset UNAME USERLAND default dirnames filenames have nospace bashdefault \ - plusdirs compopt +unset UNAME USERLAND have set $BASH_COMPLETION_ORIGINAL_V_VALUE unset BASH_COMPLETION_ORIGINAL_V_VALUE diff -Nru bash-completion-1.1/bash_completion.sh.in bash-completion-1.2/bash_completion.sh.in --- bash-completion-1.1/bash_completion.sh.in 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/bash_completion.sh.in 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,12 @@ +# Check for interactive bash and that we haven't already been sourced. +[ -z "$BASH_VERSION" -o -z "$PS1" -o -n "$BASH_COMPLETION" ] && return + +# Check for recent enough version of bash. +bash=${BASH_VERSION%.*}; bmajor=${bash%.*}; bminor=${bash#*.} +if [ $bmajor -gt 3 ] || [ $bmajor -eq 3 -a $bminor -ge 2 ]; then + if [ -r @sysconfdir@/bash_completion ]; then + # Source completion code. + . @sysconfdir@/bash_completion + fi +fi +unset bash bmajor bminor diff -Nru bash-completion-1.1/CHANGES bash-completion-1.2/CHANGES --- bash-completion-1.1/CHANGES 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/CHANGES 2010-06-16 16:44:59.000000000 +0100 @@ -0,0 +1,710 @@ +bash-completion (1.2) + + [ David Paleino ] + * Don't use pidof in _known_hosts_real() to detect whether Avahi is + available, since it's not available on MacOS X. Thanks to Rainer + Müller (bash-completion MacPorts maintainer) + * Fixed "freq" and "rate" completion for iwconfig + * contrib/munin-node fixed (Debian: #550943) + * contrib/dpkg fixed -W and --show completing on .?(u)deb's (Debian: #552109) + * contrib/aptitude: add @(add|remove)-user-tag + * Added munindoc completion to contrib/munin-node, thanks to Tom + Feiner (Debian: #553371) + * Added colordiff completion, same as diff + * contrib/cpio: added missing completions for -?, --help, --license, --usage, + --version and (-p) --to-stdout (Debian: #557436) + * Style policy: don't use fancy globbing in case labels + * Added .fdf completion to okular and evince + * Added .okular completion to okular (Debian: #545530) + * Added lintian completion + * Refreshed reportbug completion, added --from-buildd (Debian: #579471) + * Special-case "apt-get source" (Debian: #572000) + * Added lintian completion (Debian: #547361) + * contrib/dpkg: update completion to current API + * Styleguide: establish line wrapping and $() instead of `` + + [ Ville Skyttä ] + * Create bz2 dist tarball too. + * Include CHANGES in dist tarball. + * Include profile snippet in tarball, install it. + * Rename contrib/bluez-utils to contrib/bluez to follow bluez 4.x naming. + * Apply cardctl completion to pccardctl too. + * Apply pine completion to alpine too. + * Remove many unnecessary short option completions where long ones exist. + * Improve chsh, chgrp, chown, configure, curl, cvs, find, gkrellm, gzip, + iconv, lftp, look, lzma, make, man, mdadm, modprobe, mount, mplayer, + mysqladmin, perldoc, rsync, screen, service, scp, ssh, sshfs, unzip, + update-alternatives, vncviewer, wget, yp-tools, xine based players' and + general hostname completions. + * Add abook and wtf completion, based on work by Raphaël Droz. + * Add cvsps, dragon, fusermount, jarsigner, k3b, lftpget, modplug123, + pm-utils, rtcwake, pack200, unpack200, pbzip2, pbunzip2, pbzcat, pigz, + unpigz, and wol completions. + * Don't overwrite other host completions when completing from multiple + SSH known hosts files. + * Speed up installed rpm package completion on SUSE, based on work by + Marco Poletti (Alioth: #312021). + * Improve sourcing snippets from completion dirs. + * Drop support for bash < 3. The compatiblity global variables $bashN, + $default, $dirnames, $filenames, $compopt, $nospace, $bashdefault, and + $plusdirs have been dropped too. 3rd party completions should switch + to using the complete/compgen features directly, and BASH_VERSINFO + for bash version checks. + * Protect various completions from unusual user input by not embedding the + input in external command arguments (Debian: #552631). + * Add /sbin to $PATH when invoking ifconfig and iwconfig. + * Combine dcop and qdbus completions into the latter. + * awk and sed usage portability fixes (Alioth: #311393, Debian: #501479). + * Fix leaking local variables from various completions. + * Turn on -o filenames in _filedir on bash >= 4. + * Deprecate modules completion, upstream modules >= 3.2.7 ships one. + * Protect grep invocations from user aliases (Alioth: #312143). + * Split sshfs completion from contrib/ssh into contrib/sshfs. + * Split mount and umount completion into contrib/mount. + * Split service completion into contrib/service. + * Split chown, chgrp, and id completions into contrib/coreutils. + * Split kill, look, and renice completions into contrib/util-linux. + * Split killall, pkill, pgrep and related completions into contrib/procps. + * Split ipsec completion into contrib/ipsec. + * Split ifup and ifdown completions into contrib/ifupdown. + * Do basic HTML file completion with Firefox and Chrome and friends, + and Epiphany. + * Do basic diff/patch completion with cdiff and kompare. + * Don't install mock completion by default, it's in upstream mock > 1.1.0. + * Do basic text editor completion with xemacs, sxemacs, kate, and kwrite. + * Do meta-command completion for aoss and padsp. + + [ Freddy Vulto ] + * Prevent root PATH expansion prolifering in _root_command (bash >= 4.1.4) + * Only complete xhost if (_)xhost is available. + * Added _get_comp_words_by_ref to replace both _get_cword & _get_pword. + Also additional variables `words' and `cword' can be returned. + * Added _upvar & _upvars helper functions to aid in passing variables + by reference. + * Make _filedir emulate `-o filenames' + * Fixed completion perl modules containing colons. + * Merged __get_cword3 & __get_cword4 to _get_cword. + * Added __expand_tilde_by_ref helper function. + * Added __ltrim_colon_completions to fix completions containing colons + * Improved mutt completion + * Added _get_pword helper function, thanks to Sung Pae (Alioth: #312030) + + [ Ted Stern ] + * Fix modules completion for "(default)" entries. + + [ Jeremie Lasalle Ratelle ] + * Fix rsync remote path completion (Alioth: #312173, Gentoo: #297818). + + [ Leonard Crestez ] + * Improve ssh -o suboption completion (Alioth: #312122). + * Fix NFS mounts completion (Alioth: #312285). + * Fix completion of usernames (Alioth: #311396, Debian: #511788). + * Fix chown test crashing on systems with no root group (Alioth: #312306). + * Fixed tests when BASH_COMPLETION or TESTDIR contain spaces. + * Fix mount handling of escapes (Alioth: #311410, Launchpad: #219971, + Debian: #511149). + * Cleanup scripts to run tests. Make runUnit and runCompletion use test/run. + Make it possible to run tests from any directory. + * Add a --debug-xtrace option to test/run using BASH_XTRACEFD from bash-4.1. + * Add a --timeout option to test/run to override the default expect timeout. + + [ Raphaël Droz ] + * Add xsltproc completion (Alioth: #311843). + + [ Adrian Friedli ] + * Add ipv6calc completion. + + [ Ildar Mulyukov ] + * Add showmount completion (Alioth: #312285). + + [ Neville Gao ] + * Fix mount completion error "bash: [: too many arguments" (Alioth #312381). + + [ Austin English ] + * Make lookup of wine file completions case insensitive. + + [ Igor Murzov ] + * Improve xz completion (Alioth: #312466). + + [ Mario Schwalbe ] + * Update find completion (Alioth: #312491, Launchpad: #570113). + + [ Mark van Rossum ] + * Add basic lyx completion. + + -- David Paleino Wed, 16 Jun 2010 17:44:59 +0200 + +bash-completion (1.1) + + [ David Paleino ] + * Permit .gz files concatenation (Debian: #514377) + * Fix svk completion using $filenames instead of $default (Debian: #524961) + * Really add build-dep to aptitude's completion (Debian: #495883) + * Fix checks for GNUish userland, thanks to Robert Millan (Debian: #529510) + * Fix typo in .ass subtitles completion for mplayer (Debian: #531337) + * Fix regression on man(1) completion: also complete on local .3pm files + (Debian: #531343) + * Split mutt completion to contrib/mutt + * Split iconv completion to contrib/iconv + * Split dict completion to contrib/dict + * Split {update,invoke}-rc.d completions to contrib/sysv-rc + * Don't install _subversion anymore, upstream completion is better than + ours. Added to EXTRA_DIST in Makefile.am + * Split autorpm completion to contrib/autorpm + * Split jar completion to contrib/jar + * Split chkconfig completion to contrib/chkconfig + * Split chsh completion to contrib/chsh + * Split apt_build completion to contrib/apt-build + * Split aptitude-related completions to contrib/aptitude + * Split apt-cache and apt-get completions to contrib/apt + * Split rpm-related completions to contrib/rpm + * Split cvs-related completions to contrib/cvs + * Split man completion to contrib/man + * Split bash builtins completions to contrib/bash-builtins + * Split dpkg-related completions to contrib/dpkg (and re-enable usage + of grep-status if available) + * Split gcc completion to contrib/gcc + * Split dselect completion to contrib/dselect + * Split cardctl completion to contrib/cardctl + * Split pineaddr completion to contrib/pine + * Added avahi-discovered hosts to _known_hosts_real() (Debian: #518561) + * Added m4v completion to mplayer (Debian: #504213) + * Improve qemu completion (Debian: #534901) + * Added sshfs completion (shares the same as scp) (Debian: #545978) + * Fixed obvious brokenness (typos) in contrib/mdadm + * Clean [1.2.3.4]:port format in known_hosts, thanks to + Xuefer (Gentoo: #284563) + * Added --no-generate to "apt-cache pkgnames" calls, make it faster + on certain configurations (Debian: #547550) + * Split okular from evince filename extension completion, needed to add + okular-specific completions: xps, epub, odt, fb, mobi, g3 and chm. + Also, okular can read any of its formats also in .gz/.bz2 compressed + format, so change the regular expression to match this. + * Remove --with-suggests and --without-suggests from aptitude completion + * Patches from PLD Linux (thanks to Elan Ruusamäe): + - avoid sed pipe as ps itself can omit the headers + - improve service(8) completion, also look for "msg_usage" + + [ Ville Skyttä ] + * Split yum completion to contrib/_yum (no longer installed by default, the + intent is to move it to yum upstream soon). + * Split yum-arch completion into contrib/yum-arch, load completion only if + yum-arch is installed. + * Update list of yum commands and options. + * Add yum repolist, --enable/disablerepo, --disableexcludes, -d, -e, --color, + and --enable/disableplugin completions. + * Add chkconfig --override and resetpriorities completions. + * Split mplayer and friends completions to contrib/mplayer. + * Parse top level mplayer and friends option completions from -list-options. + * Fix dir-only completion for make to include only dirs, not files. + * Remove unused variable RELEASE. + * Improve aspell dictionary completion: don't hardcode data-dir, get + canonical dicts from "aspell dicts". + * Always use /etc/shells for chsh -s completion, don't complete on comment + lines in it. + * Fix rpm --whatrequires/--whatprovides completions with spaces and other + unusual characters, add filename based --whatrequires completions. + * Add modplugplay filename completion. + * Add more mod-like audio file extensions for xine-based players and timidity. + * Complete on plain alternatives like update-alternatives. + * Rename installed_alternatives() to _installed_alternatives(). + * Add /etc/pki/tls/openssl.cnf to list of default openssl config files, + search for default ones only if -config is not given. + * Use POSIX compliant arguments to tail in mkisofs completion. + * Protect various completions from unusual user input by not embedding the + input in external command arguments. + * Add _split_longopt() helper for improved handling of long options that + take arguments in both "--foo bar" and "--foo=bar" formats. + * Use _split_longopt to improve and clean up aspell, bluez-utils, chgrp, + chown, chkconfig, cpio, dpkg, heimdal, iptables, mailman, make, mc, + mii-diag, mii-tool, mkinitrd, pkg-config, postgresql, quota, reportbug, + samba, smartctl, yum, and generic long option completion (Alioth: #311398). + * Add chown --from and --reference value completions. + * Add chgrp --reference value completion. + * Do not assume all --foo= options take filenames in generic long option + completion, assume only that --*file*= does, and that --*dir*= takes dirs. + * Add make --old/new-file, --assume-old/new, --what-if value completions. + * Add smartctl -n/--nocheck completion, add more other value completions. + * Fix leaking $prev from cpio, dsniff, freeciv, gkrellm, mkinitrd, service, + and tcpdump completions. + * Split ant completion to contrib/ant, improve the built in one. + * Improve postfix completion. + * Improve samba completion. + * Split lilo completion to contrib/lilo. + * Split reportbug and querybts completions to contrib/reportbug. + * Remove debug output noise from quotaon completion. + * Split Linux wireless tools completion to contrib/wireless-tools. + * Add mock completion. + * Split FreeBSD kld(un)load completion to contrib/kldload. + * Split FreeBSD pkg_* completion to contrib/pkg_install. + * Split FreeBSD portupgrade and friends completion to contrib/portupgrade. + * Split Slackware pkgtools completion to contrib/pkgtools. + * Improve rpm group completion (displayed completions are still wrong). + * Change many completions to load in memory only if the completed commands + are available. + * Invoke the actual mplayer/mencoder command being completed (with full path) + to get various completions instead of simply "mplayer" or "mencoder". + * Associate OOXML/MS Office 2007 extensions with OpenOffice applications. + * Associate .tsv with oocalc. + * Add xmlwf completion. + * Associate *.po with poedit, gtranslator, kbabel, and lokalize. + * Add xz, xzcat, xzdec, and unxz completion. + * Add lzcat, lz*grep, lzless, lzmore, and unlzma completion. + * Load "modules" completion if /etc/profile.d/modules.sh exists even if + the "module" alias has not been defined (yet). + * Add *.ogv to xine-based players (Debian: #540033). + * Add $compopt (":" i.e. no-op with bash < 4, "compopt" with >= 4). + * Complete bzcat and zcat only on compressed files. + * Do not require a dot in bzcmp, bzdiff, bz*grep, zcmp, zdiff, z*grep, zless, + and zmore filename completions. + * Add xz and compress support and more tarball filename extensions to + rpmbuild -t*/--tarbuild completion. + * Don't hardcode path to lsmod. + * Fix sbcl file/dirname completion (Debian: #545743). + * Add /sbin to $PATH when invoking lspci and lsusb. + * Support .xz suffix in info page completions. + * Prevent rpm --define/-D completions from falling through. + * Add more common options to rpm option completions. + + [ Todd Zullinger ] + * Make yum complete on filenames after install, deplist, update and upgrade + when the following argument contains a slash. + + [ Mike Kelly ] + * Fix _filedir on bash 4. + * Add support for xz to tar completion. + * Fix _quote_readline on bash 4 (Debian: #544024). + + [ Guillaume Rousse ] + * Split mkinitrd completion to contrib/mkinitrd, improve it. + * Split smartctl completion to contrib/smartctl. + * Better ssh and sftp completion + * Better xhost completion + * Split _known_hosts completion in two parts, to avoid parsing command line + twice + * Added strace completion + * Added xm completion + * Added rpcdebug completion + * Added msynctool completion + * Added openldap completion + * Added ldapvi completion + * Added heimdal completion + * Added vpnc completion + * Added rpmcheck completion + * Added munin-node completion + * Added bluez-utils completion + * Added samba completion + * Added cfengine completion + * Added xmllint completion, contributed by Ville + * Added shadow completion, contributed by Ville + * Added repomanage completion, contributed by Ville + * Splitted and enhanced openssl completion + * Added rfkill, mdadm and resolvconf completions + + [ Raphaël Droz ] + * Add mount -L and -U completion. + + [ Philipp Weis ] + * Add .dvi.{gz,bz2} completion for evince/okular (Debian: #522656) + + [ Freddy Vulto ] + * Patched _known_hosts() to support multiple {Global,User}KnownHosts in SSH + config files, thanks to Thomas Nilsson (Alioth: #311595) (Debian: #524190) + * Fix leaking $i from info, man and python completions. + * Added setting COMP_KNOWN_HOSTS_WITH_HOSTFILE. _known_hosts_real() will add + hosts from HOSTFILE, unless COMP_KNOWN_HOSTS_WITH_HOSTFILE is set to an + empty value (Alioth: #311821) + * Quoted $cur to prevent globbing - thanks to Eric Blake (Alioth #311614) + * Fix leaking $muttcmd from mutt completion + * Fix completing multiple hosts (Debian: #535585) + + [ Michele Ballabio ] + + * Add more extensions to pkgtools completion. + + -- David Paleino Sat, 03 Oct 2009 15:41:49 +0200 + +bash-completion (1.0) + + [ Guillaume Rousse ] + * Make bibtex complete on .aux files + * Add .xvid and .XVID to player completion + * Added cowsay/cowthink completion + * Added brctl completion + * Added cpan2dist completion + * Added qemu completion + * Added net-tools (mii-tool and mii-diag) completions + * Added minicom completion + * Added quota-tools completion + * Added rdesktop completion + * Added tightvncviewer completion + * Cleanup screen completion, and make it completes on options + + [ David Paleino ] + * Added .kar to Timidity completion. + * Fix killall completion, remove trailing ":" on certain process + names + * Fix man -l completing filenames (Debian: #497074) + * (Partly) fixed java classes completion (Debian: #496828). Look for + FIXME in source. + * Dump to /dev/null error message from look(1) with no arguments + (Debian: #495142) + * Set ssh as default for rsync (was rsh) (Debian: #492328) + * Added .oga, .ogv, .ogx to mplayer completion (Debian: #496162) + * Added .epub to unzip|zipinfo completion (Debian: #492476) + * Added ssh-copy-id completion (Debian: #491856) + * Moved ssh completion to separate file (Debian: #360628) + * Bogus completion when mounting subdirs fixed (Debian: #322238) + * Fix `apt-cache showsrc` completing only on source package names + (Debian: #361535) + * Fixed bugs with gdb completion: + - when an empty directory is in $PATH (thanks to Morita Sho) + (Debian: #497597) + - when a non-existing directory is in $PATH (Debian: #499780) + * Fix missing completion for "-n" and "-e" (we were using echo, now + using printf) (thanks to Morita Sho) (Debian: #498105) + * Fixed gpg completion: + - --@(export|@(?(l|nr|nrl)sign|edit)-key)) (Debian: #500316) + - -@(r|-recipient)) + * Fixed .cb[rz] completion for evince (Debian: #502885) + * Added gksudo, gksu, kdesudo completion + * Added apache2ctl completion + * Added gpg2 completion (Debian: #489927) + * Fixed mplayer -skin completion (Debian: #501473) + * Fixed errors with POSIX enabled (Debian: #502804) + * Fixed dpkg-source wrong exit() with return() (Debian: #) + * Added --schedule-only to aptitude's completion (Debian: #502664) + * Added build-dep to aptitude's completion (Debian: #495883) + * Added support for `-F configfile' to _known_hosts(), ssh, scp and + sftp, thanks to Freddy Vulto (Debian: #504141) + * Fixed sed quoting bug in _known_hosts(), thanks to Freddy Vulto + (Debian: #504650) + * Allow `Host(Name)' in ssh config file to be indented + * Allow `Host(Name)' in ssh config file to have trailing comment. + * Allow for comments in known_hosts files (Debian: #511789) + * Fixed perl -I/-x completion, thanks to Freddy Vulto + (Debian: #504547) + * README updated: explain how to use bash-completion correctly. + (Debian: #506560) + * TODO updated: the Alioth team is now upstream. + * Added qdbus completion, thanks to Terence Simpson (Ubuntu: #257903) + * Added monodevelop and mdtool completions. + * Split subversion-related completions to contrib/_subversion + (prefixed with _ to avoid file conflicts with upstream's one) + * Fixed completion of environment variables, thanks to Morita Sho + (Debian: #272660) + * Fix dpkg completion bug: it listed only non-Essential packages + (Debian: #511790) + * Fixed _dpkg_source completion (Debian: #503317) + * Added _parse_help() to try to parse options listed in $command + --help + * Fixed gzip completion to use _parse_help(), since the available + options vary with distributions + * Added to_review/ directory, where completions needing a review would + go. After it gets accepted, the completion would go into contrib/. + * Remove unused UNAME local variable in _info() (Debian: #501843) + * AUTHORS added + * Make _alias() use _get_cword + * Added .zip to jar completions (Debian: #521041) + * Merge from Gentoo: + - fix 'find' completion so that it properly completes on -?(i)whilename. + Patch by Ciaran McCreesh. + - use make -qp to parse the Makefile for us, so we get proper completion + on things like pattern rules. Patch by Mike Kelly . + - complete on gkrellm2 as well. Patch by Aaron Walker. + - fix CVS completion + * Merge from Ubuntu: + - consume error messages in configure completion (Ubuntu: #223882) + (Mika Fischer) + - quote $xspec in _filedir_xspec in case it is empty, which would + cause errors if there was no match under failglob. (Ubuntu: #194419) + (Mika Fischer) + * debian/links fixed (Debian: #494292) + * debian/control: + - fixed typo in the long description + - added Vcs-* fields + * debian/install: + - correctly install contrib/* under /etc/bash_completion.d/ + * debian/copyright updated + * extra/dh_bash-completion: + - updated to support a list of files in debian/.bash-completion + (Debian: #512917) + + [ Ville Skyttä ] + * Added JPEG 2000 files to display completion, thanks to Bastien Nocera + (RedHat: #304771) + * Improved rpm macro completion. + * Added -E to rpm completion. + * Improved rpm backup file avoidance. + * Improved /var/log/rpmpkgs based rpm installed package completion. + * Improved performance of rpm -qa based rpm installed package completion. + * Improved features and performance of yum completion. + * Added support for p (POSIX) and x (x.org) man sections. + * Improved filename based man page completion. + * Added minimal sqlite3 completion. + * Improved getent completion (Ville Skyttä, Guillaume Rousse). + * (Re)fix gzip and bzip2 options completion. + * Improved svn filename completion (RedHat: #430059). + * Add lzma completion (Per Øyvind Karlsen, Ville Skyttä). + * Add .mp2 and .vdr to mplayer completion (RedHat: #444467). + * Add .mkv, .mp2 and .vdr to *xine completion (RedHat: #444467). + * Added lzop completion. + * Fix scp metacharacter escaping. + * Remove duplicate cpio completion, thanks to Freddy Vulto (Debian: #512823) + * Fix awk error in "modprobe -r /" completion (Debian: #512556). + * Expand ~foo to dir name more eagerly to avoid quoting issues. + * Fix -sourcepath handling in javadoc packages completion. + * Extract process name completion from _killall to _pnames, make it work + for others than Linux and FreeBSD. + * Fix process name completion with relative paths (RedHat: #484578). + * Use improved process name completion in pgrep in addition to killall. + * Enable pgrep and pkill completion if the commands are available, not just + on Linux and FreeBSD. + * Drop hg completion, an improved version is shipped with Mercurial + (contrib/bash_completion in the tarball). + * Make okular complete on same files as evince, thanks to Mary Ellen Foster + (RedHat: #486998). + * Apply ps2pdf completion to ps2pdf{12,13,14,wr} too. + * Simplify bash_completion.sh, return earlier in non-applicable environments. + * Remove obsolete --buildarch and --buildos rpm(build) completions. + * Add rpmbuild --target completion. + * Use "-profile help" to get mplayer and friends -profile completions. + * Fix local array initialization under bash 3.0, prevents "()" occurring in + file and dir name completions. + + [ Freddy Vulto ] + * Restored `_display()' completion for `display' by removing + completion-by-extension for `display' (Alioth#311429) + * Removed duplicate completion option `-borderwidth' for `display' + * Prevent completion dir from being sourced twice if + BASH_COMPLETION_DIR and BASH_COMPLETION_COMPAT_DIR are equal (Alioth#311433) + * Make `_mii-tool()' and `_mii-diag()' POSIX-compliant + * Fix _isql completion waiting for grep input if $ODBCINI not set; handle + whitespace in $ODBCINI. + * Split vncviewer completion in _tightvncviewer() and _xvnc4viewer() + Added _realcommand() global function. + + [ Jakob Unterwurzacher ] + * ps2pdf can run on .pdf files as well. (Debian: #516614, Ubuntu: #316943) + + [ Santiago M. Mola ] + * Add .ape to mplayer supported extensions (Alioth#311510). + + -- David Paleino Wed, 25 Mar 2009 23:18:24 +0100 + +bash-completion (20080705) unstable; urgency=low + + [ David Paleino ] + * Added more completions to imagemagick (thanks to Nelson A. de + Oliveira) (Debian: #487786) + * Added xrandr completion (thanks to Anton Khirnov) (Debian: #487825) + * Improving _gdb completion: + - $filenames to $default (Debian: #463969) + - also show directory names (i.e. compgen -d) in COMPREPLY. + - added . to $PATH, to allow debugging "local" executables. + - do not complete Bash's builtins (thanks to Morita Sho) + + [ Luk Claes ] + * Remove use of ucf for /etc/bash-completion (Debian: #488171). + + -- Luk Claes Sat, 05 Jul 2008 16:14:15 +0200 + +bash-completion (20080617.5) unstable; urgency=medium + + * Revert way of setting environment variables (Debian: #487774). + * Add equals sign to _get_cword for mutt_aliases (Debian: #482635). + * Enhance mlayer completion (Debian: #487826, #487838). + + -- Luk Claes Tue, 24 Jun 2008 19:50:57 +0200 + +bash-completion (20080617.4) experimental; urgency=low + + [ David Paleino ] + * Merged Ubuntu changes: + - added quote(), quote_readline(), dequote() helper functions. + - added _remove_word() + - fixed _get_cword() + - refactored _filedir using quote_readline() + - refactored _filedir_xspec using quote_readline() + - fixed COMPREPLY's in _iwconfig + - fixed _cvs() + - _known_hosts(): use files from UserKnownHostsFile options in + addition to standard ones. + - fixed _command() to correctly prune the command line + - disabled completion of PostgreSQL users and databases (Ubuntu: #164772) + - fixed _java_packages() + - fixed _muttquery() + - added flv/FLV completion to mplayer + - added --installed to apt-cache + - only complete on filenames for aspell + - fixed code for exclusions compspecs + - added code to gracefully handle debug options (set +/-v) + + -- Luk Claes Mon, 23 Jun 2008 19:25:25 +0200 + +bash-completion (20080617.3) unstable; urgency=low + + [ David Paleino ] + * Fixed IFS for filedir_xspec - Thanks to Stefan Lippers-Hollmann + (Debian: #487571) + + [ Luk Claes ] + * Install dh-bash-completion to ease installation of completions. + + -- Luk Claes Mon, 23 Jun 2008 07:24:21 +0200 + +bash-completion (20080617.2) unstable; urgency=low + + [ David Paleino ] + * New upstream release + - provide a manpage for extra/dh_bash-completion + - fix semi-serious problem with _filedir() (Debian: #487449) + * debian/rules: + - added rule to generate dh_bash-completion's manpage + * debian/install, debian/dirs: + - installing dh_bash-completion into /usr/bin + * debian/control: + - new package dh-bash-completion + + [ Luk Claes ] + * Comment new package to make sure current fix gets in the archive first. + * Add compression completion for vi(m). + + -- Luk Claes Sun, 22 Jun 2008 19:47:23 +0200 + +bash-completion (20080617.1) unstable; urgency=medium + + [ David Paleino ] + * Urgency set to medium because the package is currently unusable. + * New upstream sub-release + - fixed some typos here and there which prevented bash completions + at all (Debian: #487441). + - really closing Debian bug #455510. + + -- Luk Claes Sun, 22 Jun 2008 00:22:53 +0200 + +bash-completion (20080617) unstable; urgency=low + + [ David Paleino ] + * New upstream release + - add more completions to aptitude (Debian: #432289) + - fixed UTF-8 problem with _get_cword(), thanks to + Andrei Paskevich (Debian: #472132) + - fixed autoremove completion, thanks to Flavio Visentin + (Debian: #474974) + - cmf and CMF added to playmidi completion (Debian: #365658) + - added rrdtool completion, thanks to Justin Pryzby (Debian: #428641) + - added OpenDocument completion for unzip/zipinfo (.od{f,g,p,s,t}) + (Debian: #472940) + - fixed escaping problems with job control (i.e. disown, jobs, bg, + fg): the argument is now surrounded by "" (Debian: #347316) + - make mkdir complete also on filenames (Debian: #376433) + - {bz,z}{cat,cmp,diff,egrep,fgrep,grep,less,more} now should complete + on all filenames, not just compressed archives (just commented out) + (Debian: #455510) + - fixes Perl completion (Debian: #470742) + - fixes get_cword -> _get_cword typo (Debian: #478596) + - fixes _get_cword() function to properly handle filenames with + whitespaces (Debian: #394636, #468254, #474094) + - added .pdf.bz2 completion to evince (Debian: #424736) + - added .svg completion to display (Debian: #441017) + - added .m2ts completion to mplayer (Debian: #480879) + - added extra/dh_bash-completion to ease future rewrite of bc. + * debian/copyright - now in a fancier machine-parsable format. + * debian/control: + - added myself to Uploaders + - debhelper Build-Depends updated to >= 6. + * debian/watch: + - improved current watch line regex + - added (commented out) probable future watch line + * debian/compat bumped to 6 + * debian/dirs, debian/install and debian/links added + * debian/rules: + - refactored to make use of debian/{dirs,install,links} + + [ Steve Kemp ] + * Applied patch to fix completion of umount command. + (Debian: #470539) + * Fixed the completion of Perl manpages. + (Debian: #404976) + * Added 'aif' to the filenames offed for completion for mplayer. + (Debian: #474517) + * Allow tsocks completion. + (Debian: #409423) + * Update mutt completion to handle local usernames. + (Debian: #416655) + * Update apt-get completion to include the flag "--no-install-recommends" + (Debian: #475242) + + -- Luk Claes Sat, 21 Jun 2008 21:59:43 +0200 + +bash-completion (20060301-4) unstable; urgency=low + + * Add some fixes from Ubuntu: + * Fix completion of filenames with spaces (Debian: #468254). + * Fix parsing of SSH config files (Debian: #435117). + * Change priority to standard (Debian: #471666). + * Add some more completions for xine (Debian: #452083, #471249). + * Fix completion of gzip (Debian: #351913). + * Also use $HOSTFILE in hostname completion (Debian: #400380). + + -- Luk Claes Sat, 22 Mar 2008 23:10:30 +0000 + +bash-completion (20060301-3) unstable; urgency=low + + * Fix kpdf completion (Debian: #468163, #413374). + * Fix completion of - or -- with _command (Debian: #415276). + * Add sux to the complete -u list (Debian: #466089). + * Add dvipdfm to the list of dvi programs (Debian: #396644). + * Add --purge-unused option completion for aptitude (Debian: #438471). + * Add divx extension completion for mplayer (Debian: #444294). + * Add pdf.gz completion for evince (Debian: #456887). + * Add --remove-all completion for update-alternatives (Debian: #269173). + + -- Luk Claes Wed, 05 Mar 2008 22:57:27 +0100 + +bash-completion (20060301-2) unstable; urgency=low + + * Take over the package. + + -- Luk Claes Wed, 27 Feb 2008 19:22:03 +0100 + +bash-completion (20060301-1) unstable; urgency=low + + * Upload to unstable. + + -- Matthias Klose Sat, 09 Feb 2008 23:18:20 +0100 + +bash-completion (20060301-0ubuntu2) hardy; urgency=low + + * Replace bash (<< 3.1dfsg-9), handle upgrade in preinst. + * Exclude hashed hostnames from ssh host completion results. Debian: #428085. + * Fix: ifup/down don't really complete. Debian: #463756. + * Allow perl completion to complete filenames, complete -I and -x arguments. + Debian: #443394. + * Add find -wholename completion. Debian: #431220. + * Handle whitespaces in $HOME for _known_hosts() completion. Debian: #414821. + * dpkg -L: complete for removed-but-not-purged packages. Debian: #372156. + * Complete for apt-get autoremove. Debian: #433542, #443816, #445332. + * Update completion for mplayer (mka/flac). Debian: #340452. + * Add ping6/fping6 completion. Debian: #413170. + * Handle whitespace in paths for mount/umount completion. Debian: #367957. + * apt-get: Support --auto-remove. Ubuntu: #60666. + + -- Matthias Klose Sat, 09 Feb 2008 23:11:32 +0100 + +bash-completion (20060301-0ubuntu1) hardy; urgency=low + + * Initial release, split out from the bash package. + The software currently is unsupported upstream. + * Don't try to set a readonly variable. Ubuntu: #149527. + * Support purge in apt-get auto completion (Mathias Gug). Ubuntu: #151677. + * evince: Autocomplete on cbr/cbz/djvu files. Ubuntu: #156200, #175220. + Debian: #400678. + * kdvi: complete .*\.dvi\.(gz|bz2). Ubuntu: #128234. + * kpdf: Complete postscript files. Ubuntu: #162319. + * Make completion working in the middle of a word (Adam Simpkins). + Ubuntu: #139666. + + -- Matthias Klose Fri, 08 Feb 2008 16:46:34 +0100 + diff -Nru bash-completion-1.1/configure bash-completion-1.2/configure --- bash-completion-1.1/configure 2009-10-10 15:24:37.000000000 +0100 +++ bash-completion-1.2/configure 2010-06-16 16:45:22.000000000 +0100 @@ -1,10 +1,12 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.64 for bash-completion 1.1. +# Generated by GNU Autoconf 2.65 for bash-completion 1.2. +# # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software -# Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. @@ -523,7 +525,8 @@ as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -exec 7<&0 &1 +test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, @@ -545,8 +548,8 @@ # Identity of this package. PACKAGE_NAME='bash-completion' PACKAGE_TARNAME='bash-completion' -PACKAGE_VERSION='1.1' -PACKAGE_STRING='bash-completion 1.1' +PACKAGE_VERSION='1.2' +PACKAGE_STRING='bash-completion 1.2' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1161,7 +1164,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures bash-completion 1.1 to adapt to many kinds of systems. +\`configure' configures bash-completion 1.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1227,7 +1230,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of bash-completion 1.1:";; + short | recursive ) echo "Configuration of bash-completion 1.2:";; esac cat <<\_ACEOF @@ -1294,8 +1297,8 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -bash-completion configure 1.1 -generated by GNU Autoconf 2.64 +bash-completion configure 1.2 +generated by GNU Autoconf 2.65 Copyright (C) 2009 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation @@ -1311,8 +1314,8 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by bash-completion $as_me 1.1, which was -generated by GNU Autoconf 2.64. Invocation command line was +It was created by bash-completion $as_me 1.2, which was +generated by GNU Autoconf 2.65. Invocation command line was $ $0 $@ @@ -1565,7 +1568,7 @@ for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue - if test -r "$ac_site_file"; then + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 @@ -1574,9 +1577,9 @@ done if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in @@ -1995,6 +1998,7 @@ fi + test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else @@ -2002,7 +2006,6 @@ # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. - test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi @@ -2119,7 +2122,7 @@ # Define the identity of the package. PACKAGE='bash-completion' - VERSION='1.1' + VERSION='1.2' cat >>confdefs.h <<_ACEOF @@ -2159,7 +2162,7 @@ -ac_config_files="$ac_config_files Makefile" +ac_config_files="$ac_config_files Makefile test/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -2703,8 +2706,8 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by bash-completion $as_me 1.1, which was -generated by GNU Autoconf 2.64. Invocation command line was +This file was extended by bash-completion $as_me 1.2, which was +generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -2739,6 +2742,7 @@ -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit + --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files @@ -2753,10 +2757,11 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -bash-completion config.status 1.1 -configured by $0, generated by GNU Autoconf 2.64, - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +bash-completion config.status 1.2 +configured by $0, generated by GNU Autoconf 2.65, + with options \\"\$ac_cs_config\\" Copyright (C) 2009 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation @@ -2794,6 +2799,8 @@ ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) @@ -2860,6 +2867,7 @@ do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac @@ -2961,7 +2969,7 @@ t delim :nl h -s/\(.\{148\}\).*/\1/ +s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p @@ -2975,7 +2983,7 @@ t nl :delim h -s/\(.\{148\}\).*/\1/ +s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p diff -Nru bash-completion-1.1/configure.ac bash-completion-1.2/configure.ac --- bash-completion-1.1/configure.ac 2009-10-10 15:24:17.000000000 +0100 +++ bash-completion-1.2/configure.ac 2010-06-16 16:44:20.000000000 +0100 @@ -1,5 +1,5 @@ AC_PREREQ([2.59]) -AC_INIT([bash-completion], [1.1]) -AM_INIT_AUTOMAKE([foreign -Wall -Werror]) -AC_CONFIG_FILES([Makefile]) +AC_INIT([bash-completion], [1.2]) +AM_INIT_AUTOMAKE([foreign dejagnu dist-bzip2 -Wall -Werror]) +AC_CONFIG_FILES([Makefile test/Makefile]) AC_OUTPUT diff -Nru bash-completion-1.1/contrib/abook bash-completion-1.2/contrib/abook --- bash-completion-1.1/contrib/abook 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/abook 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,64 @@ +# abook(1) completion + +have abook && +_abook() +{ + local cur prev + + COMPREPLY=() + _get_comp_words_by_ref cur prev + + # abook only takes options, tabbing after command name adds a single + # dash (bash4) + [[ ${BASH_VERSINFO[0]} -ge 4 && $COMP_CWORD -eq 1 && -z "$cur" ]] && + { + compopt -o nospace + COMPREPLY=( "-" ) + return 0 + } + + case $cur in + -*) + _longopt abook + return 0 + ;; + esac + + case $prev in + --informat) + [ ${BASH_VERSINFO[0]} -ge 4 ] && compopt +o filenames + COMPREPLY=( $( compgen -W "$(abook --formats | \ + sed -n -e 's/^\t\([a-z]*\).*/\1/p' -e '/^$/q')" -- "$cur" ) ) + return 0 + ;; + --outformat) + [ ${BASH_VERSINFO[0]} -ge 4 ] && compopt +o filenames + COMPREPLY=( $( compgen -W "$(abook --formats | \ + sed -n -e '/^$/,$s/^\t\([a-z]*\).*/\1/p')" -- "$cur" ) ) + return 0 + ;; + --infile) + COMPREPLY=( $( compgen -W stdin -- "$cur" ) ) + _filedir + return 0 + ;; + --outfile) + COMPREPLY=( $( compgen -W stdout -- "$cur" ) ) + _filedir + return 0 + ;; + --config|--datafile) + _filedir + return 0 + ;; + esac +} && +complete -F _abook -o filenames abook + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/ant bash-completion-1.2/contrib/ant --- bash-completion-1.1/contrib/ant 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/ant 2010-06-13 11:21:19.000000000 +0100 @@ -1,68 +1,65 @@ # bash completion for ant -have ant && { +have ant && +{ _ant() { - local cur prev buildfile i + local cur prev buildfile i + + COMPREPLY=() + _get_comp_words_by_ref cur prev - COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} - - case "$prev" in - -buildfile|-file|-f) - _filedir 'xml' - return 0 - ;; - -logfile|-l) - _filedir - return 0 - ;; - -propertyfile) - _filedir properties - return 0 - ;; - -nice) - COMPREPLY=( $( compgen -W '1 2 3 4 5 6 7 8 9 10' \ - -- "$cur" ) ) - return 0 - ;; - -lib|-logger|-listener|-D|-inputhandler|-main) - return 0 - ;; - esac - - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-help -h -projecthelp -p -version \ - -diagnostics -quiet -q -verbose -v -debug -d -emacs -e \ - -lib -logfile -l -logger -listener -noinput -buildfile \ - -file -f -D -keep-going -k -propertyfile -inputhandler \ - -find -s -nice -nouserlib -noclasspath -autoproxy \ - -main' -- "$cur" ) ) - else - # available targets completion - # find which buildfile to use - buildfile=build.xml - for (( i=1; i < COMP_CWORD; i++ )); do - if [[ "${COMP_WORDS[i]}" == -@(?(build)file|f) ]]; then - buildfile=${COMP_WORDS[i+1]} - break - fi - done - [ ! -f $buildfile ] && return 0 - - # parse buildfile for targets - # some versions of sed complain if there's no trailing linefeed, - # hence the 2>/dev/null - COMPREPLY=( $( compgen -W "$( cat $buildfile | \ - tr "'\t\n>" "\" \n" | \ - sed -ne 's/.*/dev/null )" -- "$cur" ) ) - fi + case $prev in + -buildfile|-file|-f) + _filedir 'xml' + return 0 + ;; + -logfile|-l) + _filedir + return 0 + ;; + -propertyfile) + _filedir properties + return 0 + ;; + -nice) + COMPREPLY=( $( compgen -W '1 2 3 4 5 6 7 8 9 10' -- "$cur" ) ) + return 0 + ;; + -lib|-logger|-listener|-D|-inputhandler|-main) + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-help -projecthelp -version -diagnostics \ + -quiet -verbose -debug -emacs -lib -logfile -logger -listener \ + -noinput -buildfile -D -keep-going -propertyfile -inputhandler \ + -find -s -nice -nouserlib -noclasspath -autoproxy -main' \ + -- "$cur" ) ) + else + # available targets completion + # find which buildfile to use + buildfile=build.xml + for (( i=1; i < COMP_CWORD; i++ )); do + if [[ "${COMP_WORDS[i]}" == -@(?(build)file|f) ]]; then + buildfile=${COMP_WORDS[i+1]} + break + fi + done + [ ! -f $buildfile ] && return 0 + + # parse buildfile for targets + # some versions of sed complain if there's no trailing linefeed, + # hence the 2>/dev/null + COMPREPLY=( $( compgen -W "$( cat $buildfile | tr "'\t\n>" "\" \n" | \ + sed -ne 's/.*/dev/null )" \ + -- "$cur" ) ) + fi } have complete-ant-cmd.pl && \ - complete -C complete-ant-cmd.pl -F _ant $filenames ant || \ - complete -F _ant $filenames ant + complete -C complete-ant-cmd.pl -F _ant -o filenames ant || \ + complete -F _ant -o filenames ant } # Local variables: diff -Nru bash-completion-1.1/contrib/apache2ctl bash-completion-1.2/contrib/apache2ctl --- bash-completion-1.1/contrib/apache2ctl 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/apache2ctl 2010-06-13 11:21:19.000000000 +0100 @@ -2,12 +2,12 @@ have apache2ctl && { _apache2ctl() { - local APWORDS + local APWORDS cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur - APWORDS=$(apache2ctl 2>&1 >/dev/null | head -n1 | cut -f3 -d" " | \ + APWORDS=$(apache2ctl 2>&1 >/dev/null | awk 'NR<2 { print $3; exit }' | \ tr "|" " ") COMPREPLY=( $( compgen -W "$APWORDS" -- "$cur" ) ) diff -Nru bash-completion-1.1/contrib/apt bash-completion-1.2/contrib/apt --- bash-completion-1.1/contrib/apt 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/apt 2010-06-13 11:21:19.000000000 +0100 @@ -6,8 +6,7 @@ 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 @@ -27,6 +26,12 @@ fi return 0 ;; + source) + COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" \ + 2> /dev/null ) $( apt-cache dumpavail | \ + command grep "^Source: $cur" | sort -u | cut -f2 -d" " ) ) + return 0 + ;; *) COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" \ 2> /dev/null ) ) @@ -35,14 +40,14 @@ esac fi - case "$prev" in - -@(c|-config-file)) + case $prev in + -c|--config-file) _filedir return 0 ;; - -@(t|-target-release|-default-release)) + -t|--target-release|--default-release) COMPREPLY=( $( apt-cache policy | \ - grep "release.o=Debian,a=$cur" | \ + command grep "release.o=Debian,a=$cur" | \ sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2> /dev/null) ) return 0 ;; @@ -66,7 +71,7 @@ return 0 } && -complete -F _apt_get $filenames apt-get +complete -F _apt_get -o filenames apt-get # Debian apt-cache(8) completion. # @@ -76,9 +81,7 @@ 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 @@ -98,8 +101,7 @@ showsrc) COMPREPLY=( $( apt-cache dumpavail | \ - grep "^Source: $cur" | sort | \ - uniq | cut -f2 -d" " ) ) + command grep "^Source: $cur" | sort -u | cut -f2 -d" " ) ) return 0 ;; @@ -112,8 +114,8 @@ fi - case "$prev" in - -@(c|p|s|-config-file|-@(pkg|src)-cache)) + case $prev in + -c|-p|-s|--config-file|--pkg-cache|--src-cache) _filedir return 0 ;; @@ -144,7 +146,7 @@ return 0 } && -complete -F _apt_cache $filenames apt-cache +complete -F _apt_cache -o filenames apt-cache # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/apt-build bash-completion-1.2/contrib/apt-build --- bash-completion-1.1/contrib/apt-build 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/apt-build 2010-06-13 11:21:19.000000000 +0100 @@ -6,8 +6,7 @@ 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 @@ -17,7 +16,7 @@ if [ -n "$special" ]; then case $special in - @(install|source|info)) + install|source|info) COMPREPLY=( $( apt-cache pkgnames "$cur" 2> /dev/null ) ) return 0 ;; @@ -31,12 +30,12 @@ esac fi - case "$prev" in - --@(patch|build-dir|repository-dir)) + case $prev in + --patch|--build-dir|--repository-dir) _filedir return 0 ;; - -@(h|-help)) + -h|--help) return 0 ;; esac @@ -56,7 +55,7 @@ return 0 } && -complete -F _apt_build $filenames apt-build +complete -F _apt_build -o filenames apt-build # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/aptitude bash-completion-1.2/contrib/aptitude --- bash-completion-1.1/contrib/aptitude 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/aptitude 2010-06-13 11:21:19.000000000 +0100 @@ -9,7 +9,8 @@ } || { _comp_dpkg_hold_packages() { - grep -B 2 'hold' /var/lib/dpkg/status | grep "Package: $1" | cut -d\ -f2 + command grep -B 2 'hold' /var/lib/dpkg/status | \ + command grep "Package: $1" | cut -d\ -f2 } } @@ -18,9 +19,7 @@ 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 \ @@ -30,7 +29,7 @@ -Z -v --verbose --purge-unused --schedule-only' for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do - if [[ ${COMP_WORDS[i]} == @(install|reinstall|hold|unhold|markauto|unmarkauto|dist-upgrade|full-upgrade|download|show|forbid-version|purge|remove|changelog|why|why-not|keep|keep-all|build-dep) ]]; then + if [[ ${COMP_WORDS[i]} == @(@(|re)install|@(|un)hold|@(|un)markauto|@(dist|full)-upgrade|download|show|forbid-version|purge|remove|changelog|why@(|-not)|keep@(|-all)|build-dep|@(add|remove)-user-tag) ]]; then special=${COMP_WORDS[i]} fi #exclude some mutually exclusive options @@ -40,11 +39,13 @@ if [[ -n "$special" ]]; then case $special in - @(install|hold|markauto|unmarkauto|dist-upgrade|full-upgrade|download|show|changelog|why|why-not|build-dep)) + install|hold|markauto|unmarkauto|dist-upgrade|full-upgrade| \ + download|show|changelog|why|why-not|build-dep|add-user-tag| \ + remove-user-tag) COMPREPLY=( $( apt-cache pkgnames $cur 2> /dev/null ) ) return 0 ;; - @(purge|remove|reinstall|forbid-version)) + purge|remove|reinstall|forbid-version) COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) ) return 0 ;; @@ -57,16 +58,16 @@ case $prev in # don't complete anything if these options are found - @(autoclean|clean|forget-new|search|upgrade|safe-upgrade|update|keep-all)) + autoclean|clean|forget-new|search|safe-upgrade|upgrade|update|keep-all) return 0 ;; -S) _filedir return 0 ;; - -@(t|-target-release|-default-release)) + -t|--target-release|--default-release) COMPREPLY=( $( apt-cache policy | \ - grep "release.o=Debian,a=$cur" | \ + command grep "release.o=Debian,a=$cur" | \ sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2> /dev/null ) ) return 0 ;; @@ -79,12 +80,13 @@ clean autoclean install reinstall remove \ hold unhold purge markauto unmarkauto why why-not \ dist-upgrade full-upgrade download search show \ - forbid-version changelog keep-all build-dep' -- "$cur" ) ) + forbid-version changelog keep-all build-dep \ + add-user-tag remove-user-tag' -- "$cur" ) ) fi return 0 } -complete -F _aptitude $default aptitude +complete -F _aptitude -o default aptitude } # Local variables: diff -Nru bash-completion-1.1/contrib/aspell bash-completion-1.2/contrib/aspell --- bash-completion-1.1/contrib/aspell 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/aspell 2010-06-13 11:21:19.000000000 +0100 @@ -19,17 +19,16 @@ 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 - case "$prev" in - -c|-p|check|--@(conf|personal|repl|per-conf)) + case $prev in + -c|-p|check|--conf|--personal|--repl|--per-conf) _filedir return 0 ;; - --@(conf-dir|data-dir|dict-dir|home-dir|local-data-dir|prefix)) + --conf-dir|--data-dir|--dict-dir|--home-dir|--local-data-dir|--prefix) _filedir -d return 0 ;; @@ -59,20 +58,20 @@ if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '--conf --conf-dir --data-dir --dict-dir \ - --encoding --add-filter --rem-filter --mode -e \ - -H -t --add-extra-dicts --rem-extra-dicts \ - --home-dir -W --ignore --ignore-accents \ + --encoding --add-filter --rem-filter --mode \ + --add-extra-dicts --rem-extra-dicts \ + --home-dir --ignore --ignore-accents \ --dont-ignore-accents --ignore-case --dont-ignore-case \ --ignore-repl --dont-ignore-repl --jargon --keyboard \ - --lang --language-tag --local-data-dir -d --master \ + --lang --language-tag --local-data-dir --master \ --module --add-module-search-order \ - --rem-module-search-order --per-conf -p --personal \ - --prefix --repl -C -B --run-together --dont-run-together \ + --rem-module-search-order --per-conf --personal \ + --prefix --repl --run-together --dont-run-together \ --run-together-limit --run-together-min --save-repl \ --dont-save-repl --set-prefix --dont-set-prefix --size \ --spelling --strip-accents --dont-strip-accents \ --sug-mode --add-word-list-path --rem-word-list-path \ - -b -x --backup -b|-x --dont-backup --reverse --dont-reverse \ + --backup --dont-backup --reverse --dont-reverse \ --time --dont-time --keymapping --add-email-quote \ --rem-email-quote --email-margin --add-tex-command \ --rem-tex-command --tex-check-comments \ @@ -80,13 +79,12 @@ --rem-tex-extension --add-sgml-check --rem-sgml-check \ --add-sgml-extension --rem-sgml-extension' -- "$cur" ) ) else - COMPREPLY=( $( compgen -W '-? help -c check -a pipe -l list \ - config config soundslike filter -v version dump \ - create merge' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'usage help check pipe list \ + config soundslike filter version dump create merge' -- "$cur" ) ) fi } -complete -F _aspell $filenames aspell +complete -F _aspell -o filenames aspell } # Local variables: diff -Nru bash-completion-1.1/contrib/autorpm bash-completion-1.2/contrib/autorpm --- bash-completion-1.1/contrib/autorpm 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/autorpm 2010-06-13 11:21:19.000000000 +0100 @@ -6,7 +6,7 @@ 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" ) ) diff -Nru bash-completion-1.1/contrib/bash-builtins bash-completion-1.2/contrib/bash-builtins --- bash-completion-1.1/contrib/bash-builtins 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/bash-builtins 2010-06-13 11:21:19.000000000 +0100 @@ -5,9 +5,9 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur - case "$COMP_LINE" in + case $COMP_LINE in *[^=]) COMPREPLY=( $( compgen -A alias -- "$cur" ) ) ;; @@ -17,7 +17,7 @@ ;; esac } -complete -F _alias $nospace alias +complete -F _alias -o nospace alias # bash export completion # @@ -26,9 +26,9 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur - case "$COMP_LINE" in + case $COMP_LINE in *=\$*) COMPREPLY=( $( compgen -v -P '$' -- "${cur#*=\$}" ) ) ;; @@ -43,7 +43,7 @@ ;; esac } -complete -F _export $default $nospace export +complete -F _export -o default -o nospace export # bash shell function completion # @@ -52,8 +52,7 @@ 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 @@ -73,18 +72,15 @@ # _complete() { - local cur prev options + local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in -o) - options="default dirnames filenames" - [ -n "$bash205b" ] && options="$options nospace" - [ -n "$bash3" ] && options="$options bashdefault plusdirs" - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'bashdefault default dirnames filenames \ + nospace plusdirs' -- "$cur" ) ) return 0 ;; @@ -105,7 +101,7 @@ COMPREPLY=( $( compgen -A function -- "$cur" ) ) return 0 ;; - -@(p|r)) + -p|-r) COMPREPLY=( $( complete -p | sed -e 's|.* ||' ) ) COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) ) return 0 @@ -115,9 +111,8 @@ if [[ "$cur" == -* ]]; then # relevant options completion - options="-a -b -c -d -e -f -g -j -k -s -v -u -A -G -W -P -S -X -F -C" - [ -n "$bash205" ] && options="$options -o" - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + COMPREPLY=( $( compgen -W '-a -b -c -d -e -f -g -j -k -o -s -v -u -A \ + -G -W -P -S -X -F -C' -- "$cur" ) ) else COMPREPLY=( $( compgen -A command -- "$cur" ) ) fi diff -Nru bash-completion-1.1/contrib/bind-utils bash-completion-1.2/contrib/bind-utils --- bash-completion-1.1/contrib/bind-utils 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/bind-utils 2010-06-13 11:21:19.000000000 +0100 @@ -6,7 +6,7 @@ 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 \ diff -Nru bash-completion-1.1/contrib/bitkeeper bash-completion-1.2/contrib/bitkeeper --- bash-completion-1.1/contrib/bitkeeper 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/bitkeeper 2010-06-13 11:21:19.000000000 +0100 @@ -2,17 +2,18 @@ have bk && _bk() { - local BKCMDS + local BKCMDS - COMPREPLY=() - cur=`_get_cword` + COMPREPLY=() + _get_comp_words_by_ref cur - BKCMDS="$( bk help topics | grep '^ bk' | cut -d ' ' -f 4 | xargs echo )" + BKCMDS="$( bk help topics | awk '/^ bk/ { print $4 }' | \ + xargs printf '%s ' )" - COMPREPLY=( $( compgen -W "$BKCMDS" -- "$cur" ) ) - _filedir + COMPREPLY=( $( compgen -W "$BKCMDS" -- "$cur" ) ) + _filedir - return 0 + return 0 } && complete -F _bk bk diff -Nru bash-completion-1.1/contrib/bittorrent bash-completion-1.2/contrib/bittorrent --- bash-completion-1.1/contrib/bittorrent 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/bittorrent 2010-06-13 11:21:19.000000000 +0100 @@ -1,4 +1,4 @@ -# btdownloadheadless(1) completion by Guillaume Rousse +# btdownloadheadless(1) completion have btdownloadheadless.py || have btdownloadcurses.py || \ have btdownloadgui.py && @@ -7,11 +7,10 @@ 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)) + case $prev in + --responsefile|--saveas) _filedir return 0 ;; diff -Nru bash-completion-1.1/contrib/bluez bash-completion-1.2/contrib/bluez --- bash-completion-1.1/contrib/bluez 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/bluez 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,432 @@ +# bash completion for bluez utils + +have hcitool && { +_bluetooth_adresses() +{ + if [ -n "${COMP_BLUETOOTH_SCAN:-}" ]; then + COMPREPLY=( ${COMPREPLY[@]:-} $( compgen -W "$( hcitool scan | \ + awk '/^\t/{print $1}' )" -- "$cur" ) ) + fi +} + +_bluetooth_devices() +{ + COMPREPLY=( ${COMPREPLY[@]:-} $( compgen -W "$( hcitool dev | \ + awk '/^\t/{print $1}' )" -- "$cur" ) ) +} + +_bluetooth_services() +{ + COMPREPLY=( $( compgen -W 'DID SP DUN LAN FAX OPUSH FTP HS HF HFAG \ + SAP NAP GN PANU HCRP HID CIP A2SRC A2SNK AVRCT AVRTG UDIUE \ + UDITE SYNCML' -- "$cur" ) ) +} + +_bluetooth_packet_types() +{ + COMPREPLY=( $( compgen -W 'DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3' \ + -- "$cur" ) ) +} + +_hcitool() +{ + local cur prev split=false arg + + COMPREPLY=() + _get_comp_words_by_ref cur prev + + _split_longopt && split=true + + case $prev in + -i) + _bluetooth_devices + return 0; + ;; + --role) + COMPREPLY=( $( compgen -W 'm s' -- "$cur" ) ) + return 0; + ;; + --pkt-type) + _bluetooth_packet_types + return 0; + ;; + esac + + $split && return 0 + + _get_first_arg + if [ -z $arg ]; then + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--help -i' -- "$cur" ) ) + else + COMPREPLY=( $( compgen -W 'dev inq scan name info \ + spinq epinq cmd con cc dc sr cpt rssi lq tpl \ + afh lst auth enc key clkoff clock' -- "$cur" ) ) + fi + else + case $arg in + name|info|dc|rssi|lq|afh|auth|key|clkoff|lst) + _count_args + if [ $args -eq 2 ]; then + _bluetooth_adresses + fi + ;; + cc) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--role --pkt-type' -- "$cur" ) ) + else + _count_args + if [ $args -eq 2 ]; then + _bluetooth_adresses + fi + fi + ;; + sr) + _count_args + if [ $args -eq 2 ]; then + _bluetooth_adresses + else + COMPREPLY=( $( compgen -W 'master slave' -- "$cur" ) ) + fi + ;; + cpt) + _count_args + if [ $args -eq 2 ]; then + _bluetooth_adresses + else + _bluetooth_packet_types + fi + ;; + tpl|enc|clock) + _count_args + if [ $args -eq 2 ]; then + _bluetooth_adresses + else + COMPREPLY=( $( compgen -W '0 1' -- "$cur" ) ) + fi + ;; + esac + fi +} +complete -F _hcitool hcitool + +_sdptool() +{ + local cur prev split=false + + COMPREPLY=() + _get_comp_words_by_ref cur prev + + _split_longopt && split=true + + case $prev in + --bdaddr) + _bluetooth_adresses + return 0; + ;; + esac + + $split && return 0 + + _get_first_arg + if [ -z $arg ]; then + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--help' -- "$cur" ) ) + else + COMPREPLY=( $( compgen -W 'search browse records add \ + del get setattr setseq' -- "$cur" ) ) + fi + else + case $arg in + search) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--bdaddr \ + --tree --raw --xml' -- "$cur" ) ) + else + _bluetooth_services + fi + ;; + browse|records) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--tree --raw --xml' -- "$cur" ) ) + else + _bluetooth_adresses + fi + ;; + add) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--handle --channel' -- "$cur" ) ) + else + _bluetooth_services + fi + ;; + get) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--bdaddr \ + --tree --raw --xml' -- "$cur" ) ) + fi + ;; + esac + fi +} +complete -F _sdptool sdptool + +_l2ping() +{ + local cur prev + + COMPREPLY=() + _get_comp_words_by_ref cur prev + + case $prev in + -i) + _bluetooth_devices + return 0; + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-i -s -c -t -f -r' -- "$cur" ) ) + else + _bluetooth_adresses + fi + +} +complete -F _l2ping l2ping + +_rfcomm() +{ + local cur prev + + COMPREPLY=() + _get_comp_words_by_ref cur prev + + case $prev in + -f|--config) + _filedir + return 0; + ;; + -i) + _bluetooth_devices + _bluetooth_adresses + return 0; + ;; + esac + + _get_first_arg + if [ -z $arg ]; then + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--help -a --raw \ + --config -i --auth --encrypt --secure --master' -- "$cur" ) ) + else + COMPREPLY=( $( compgen -W 'show connect listen watch \ + bind release' -- "$cur" ) ) + fi + else + _count_args + if [ $args -eq 2 ]; then + _bluetooth_devices + else + case $arg in + connect|bind) + if [ $args -eq 3 ]; then + _bluetooth_adresses + fi + ;; + esac + fi + fi +} +complete -F _rfcomm rfcomm + +_ciptool() +{ + local cur prev + + COMPREPLY=() + _get_comp_words_by_ref cur prev + + case $prev in + -i) + _bluetooth_devices + _bluetooth_adresses + return 0; + ;; + esac + + _get_first_arg + if [ -z $arg ]; then + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--help -i' -- "$cur" ) ) + else + COMPREPLY=( $( compgen -W 'show search connect release \ + loopback' -- "$cur" ) ) + fi + else + case $arg in + connect|release|loopback) + _count_args + if [ $args -eq 2 ]; then + _bluetooth_adresses + fi + ;; + esac + fi +} +complete -F _ciptool ciptool + +_dfutool() +{ + local cur prev + + COMPREPLY=() + _get_comp_words_by_ref cur prev + + case $prev in + -d|--device) + _bluetooth_devices + return 0; + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--help --device' -- "$cur" ) ) + else + _count_args + case $args in + 1) + COMPREPLY=( $( compgen -W 'verify modify \ + upgrade archive' -- "$cur" ) ) + ;; + 2) + _filedir + ;; + esac + fi +} +complete -F _dfutool dfutool + +_hciconfig() +{ + local cur + + COMPREPLY=() + _get_comp_words_by_ref cur + + _get_first_arg + if [ -z $arg ]; then + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--help --all' -- "$cur" ) ) + else + COMPREPLY=( $( compgen -W 'up down reset rstat auth \ + noauth encrypt noencrypt secmgr nosecmgr \ + piscan noscan iscan pscan ptype name class \ + voice iac inqmode inqdata inqtype inqparams \ + pageparms pageto afhmode aclmtu scomtu putkey \ + delkey commands features version revision lm' \ + -- "$cur" ) ) + fi + else + case $arg in + putkey|delkey) + _count_args + if [ $args -eq 2 ]; then + _bluetooth_adresses + fi + ;; + lm) + _count_args + if [ $args -eq 2 ]; then + COMPREPLY=( $( compgen -W 'MASTER \ + SLAVE NONE ACCEPT' -- "$cur" ) ) + fi + ;; + ptype) + _count_args + if [ $args -eq 2 ]; then + _bluetooth_packet_types + fi + ;; + esac + fi +} +complete -F _hciconfig hciconfig + +_hciattach() +{ + local cur + + COMPREPLY=() + _get_comp_words_by_ref cur + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-n -p -t -b -s -l' -- "$cur" ) ) + else + _count_args + case $args in + 1) + COMPREPLY=( $( printf '%s\n' /dev/tty* ) ) + COMPREPLY=( $( compgen -W '${COMPREPLY[@]} \ + ${COMPREPLY[@]#/dev/}' -- "$cur" ) ) + ;; + 2) + COMPREPLY=( $( compgen -W 'any ericsson digi \ + xircom csr bboxes swave bcsp 0x0105 \ + 0x080a 0x0160 0x0002' -- "$cur" ) ) + ;; + 3) + COMPREPLY=( $( compgen -W '9600 19200 38400 \ + 57600 115200 230400 460800 921600' -- "$cur" ) ) + ;; + 4) + COMPREPLY=( $( compgen -W 'flow noflow' -- "$cur" ) ) + ;; + 5) + _bluetooth_adresses + ;; + esac + fi + +} +complete -F _hciattach hciattach + +_hid2hci() +{ + local cur + + COMPREPLY=() + _get_comp_words_by_ref cur + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--help --quiet -0 --tohci -1 \ + --tohid' -- "$cur" ) ) + fi +} +complete -F _hid2hci hid2hci + +_avctrl() +{ + local cur + + COMPREPLY=() + _get_comp_words_by_ref cur + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--help --quiet' -- "$cur" ) ) + else + _count_args + if [ $args -eq 1 ]; then + COMPREPLY=( $( compgen -W 'discover switch' -- "$cur" ) ) + fi + fi +} +complete -F _avctrl avctrl +} + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/bluez-utils bash-completion-1.2/contrib/bluez-utils --- bash-completion-1.1/contrib/bluez-utils 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/bluez-utils 1970-01-01 00:00:00.000000000 +0000 @@ -1,452 +0,0 @@ -# bash completion for bluez-utils - -have hcitool && { -_bluetooth_adresses() -{ - if [ -n "${COMP_BLUETOOTH_SCAN:-}" ]; then - COMPREPLY=( ${COMPREPLY[@]:-} $( compgen -W "$( hcitool scan | \ - awk '/^\t/{print $1}' )" -- "$cur" ) ) - fi -} - -_bluetooth_devices() -{ - COMPREPLY=( ${COMPREPLY[@]:-} $( compgen -W "$( hcitool dev | \ - awk '/^\t/{print $1}' )" -- "$cur" ) ) -} - -_bluetooth_services() -{ - COMPREPLY=( $( compgen -W 'DID SP DUN LAN FAX OPUSH FTP HS HF HFAG \ - SAP NAP GN PANU HCRP HID CIP A2SRC A2SNK AVRCT AVRTG UDIUE \ - UDITE SYNCML' -- "$cur" ) ) -} - -_bluetooth_packet_types() -{ - COMPREPLY=( $( compgen -W 'DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3' \ - -- "$cur" ) ) -} - -_get_command() -{ - local i - - command= - for (( i=1; i < COMP_CWORD; i++ )); do - if [[ "${COMP_WORDS[i]}" != -* ]]; then - command=${COMP_WORDS[i]} - break - fi - done -} - -_hcitool() -{ - local cur prev split=false - - COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} - - _split_longopt && split=true - - case $prev in - -i) - _bluetooth_devices - return 0; - ;; - --role) - COMPREPLY=( $( compgen -W 'm s' -- "$cur" ) ) - return 0; - ;; - --pkt-type) - _bluetooth_packet_types - return 0; - ;; - esac - - $split && return 0 - - _get_command - if [ -z $command ]; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-h -i' -- "$cur" ) ) - else - COMPREPLY=( $( compgen -W 'dev inq scan name info \ - spinq epinq cmd con cc dc sr cpt rssi lq tpl \ - afh lst auth enc key clkoff clock' -- "$cur" ) ) - fi - else - case $command in - @(name|info|dc|rssi|lq|afh|auth|key|clkoff|lst)) - _count_args - if [ $args -eq 2 ]; then - _bluetooth_adresses - fi - ;; - cc) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--role --pkt-type' -- "$cur" ) ) - else - _count_args - if [ $args -eq 2 ]; then - _bluetooth_adresses - fi - fi - ;; - sr) - _count_args - if [ $args -eq 2 ]; then - _bluetooth_adresses - else - COMPREPLY=( $( compgen -W 'master slave' -- "$cur" ) ) - fi - ;; - cpt) - _count_args - if [ $args -eq 2 ]; then - _bluetooth_adresses - else - _bluetooth_packet_types - fi - ;; - @(tpl|enc|clock)) - _count_args - if [ $args -eq 2 ]; then - _bluetooth_adresses - else - COMPREPLY=( $( compgen -W '0 1' -- "$cur" ) ) - fi - ;; - esac - fi -} -complete -F _hcitool hcitool - -_sdptool() -{ - local cur prev split=false - - COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} - - _split_longopt && split=true - - case $prev in - --bdaddr) - _bluetooth_adresses - return 0; - ;; - esac - - $split && return 0 - - _get_command - if [ -z $command ]; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help' -- "$cur" ) ) - else - COMPREPLY=( $( compgen -W 'search browse records add \ - del get setattr setseq' -- "$cur" ) ) - fi - else - case $command in - search) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--bdaddr \ - --tree --raw --xml' -- "$cur" ) ) - else - _bluetooth_services - fi - ;; - @(browse|records)) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--tree --raw --xml' -- "$cur" ) ) - else - _bluetooth_adresses - fi - ;; - add) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--handle --channel' -- "$cur" ) ) - else - _bluetooth_services - fi - ;; - get) - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--bdaddr \ - --tree --raw --xml' -- "$cur" ) ) - fi - ;; - esac - fi -} -complete -F _sdptool sdptool - -_l2ping() -{ - local cur prev - - COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} - - case $prev in - -i) - _bluetooth_devices - return 0; - ;; - esac - - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-i -s -c -t -f -r' -- "$cur" ) ) - else - _bluetooth_adresses - fi - -} -complete -F _l2ping l2ping - -_rfcomm() -{ - local cur prev - - COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} - - case $prev in - -@(f|-config)) - _filedir - return 0; - ;; - -i) - _bluetooth_devices - _bluetooth_adresses - return 0; - ;; - esac - - _get_command - if [ -z $command ]; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-h --help -a -r --raw -f \ - --config -i -A --auth -E --encrypt -S --secure \ - -M --master' -- "$cur" ) ) - else - COMPREPLY=( $( compgen -W 'show connect listen watch \ - bind release' -- "$cur" ) ) - fi - else - _count_args - if [ $args -eq 2 ]; then - _bluetooth_devices - else - case $command in - @(connect|bind)) - if [ $args -eq 3 ]; then - _bluetooth_adresses - fi - ;; - esac - fi - fi -} -complete -F _rfcomm rfcomm - -_ciptool() -{ - local cur prev - - COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} - - case $prev in - -i) - _bluetooth_devices - _bluetooth_adresses - return 0; - ;; - esac - - _get_command - if [ -z $command ]; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-h --help -i' -- "$cur" ) ) - else - COMPREPLY=( $( compgen -W 'show search connect release \ - loopback' -- "$cur" ) ) - fi - else - case $command in - @(connect|release|loopback)) - _count_args - if [ $args -eq 2 ]; then - _bluetooth_adresses - fi - ;; - esac - fi -} -complete -F _ciptool ciptool - -_dfutool() -{ - local cur prev - - COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} - - case $prev in - -@(d|-device)) - _bluetooth_devices - return 0; - ;; - esac - - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-h --help -d --device' -- "$cur" ) ) - else - _count_args - case $args in - 1) - COMPREPLY=( $( compgen -W 'verify modify \ - upgrade archive' -- "$cur" ) ) - ;; - 2) - _filedir - ;; - esac - fi -} -complete -F _dfutool dfutool - -_hciconfig() -{ - local cur - - COMPREPLY=() - cur=`_get_cword` - - _get_command - if [ -z $command ]; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-h --help -a --all' -- "$cur" ) ) - else - COMPREPLY=( $( compgen -W 'up down reset rstat auth \ - noauth encrypt noencrypt secmgr nosecmgr \ - piscan noscan iscan pscan ptype name class \ - voice iac inqmode inqdata inqtype inqparams \ - pageparms pageto afhmode aclmtu scomtu putkey \ - delkey commands features version revision lm' \ - -- "$cur" ) ) - fi - else - case $command in - @(putkey|delkey)) - _count_args - if [ $args -eq 2 ]; then - _bluetooth_adresses - fi - ;; - lm) - _count_args - if [ $args -eq 2 ]; then - COMPREPLY=( $( compgen -W 'MASTER \ - SLAVE NONE ACCEPT' -- "$cur" ) ) - fi - ;; - ptype) - _count_args - if [ $args -eq 2 ]; then - _bluetooth_packet_types - fi - ;; - esac - fi -} -complete -F _hciconfig hciconfig - -_hciattach() -{ - local cur - - COMPREPLY=() - cur=`_get_cword` - - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-n -p -t -b -s -l' -- "$cur" ) ) - else - _count_args - case $args in - 1) - COMPREPLY=( $( command ls /dev/tty* ) ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]} \ - ${COMPREPLY[@]#/dev/}' -- "$cur" ) ) - ;; - 2) - COMPREPLY=( $( compgen -W 'any ericsson digi \ - xircom csr bboxes swave bcsp 0x0105 \ - 0x080a 0x0160 0x0002' -- "$cur" ) ) - ;; - 3) - COMPREPLY=( $( compgen -W '9600 19200 38400 \ - 57600 115200 230400 460800 921600' -- "$cur" ) ) - ;; - 4) - COMPREPLY=( $( compgen -W 'flow noflow' -- "$cur" ) ) - ;; - 5) - _bluetooth_adresses - ;; - esac - fi - -} -complete -F _hciattach hciattach - -_hid2hci() -{ - local cur - - COMPREPLY=() - cur=`_get_cword` - - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-h --help -q --quiet -0 --tohci -1 \ - --tohid' -- "$cur" ) ) - fi -} -complete -F _hid2hci hid2hci - -_avctrl() -{ - local cur - - COMPREPLY=() - cur=`_get_cword` - - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-h --help -q --quiet' -- "$cur" ) ) - else - _count_args - if [ $args -eq 1 ]; then - COMPREPLY=( $( compgen -W 'discover switch' -- "$cur" ) ) - fi - fi -} -complete -F _avctrl avctrl -} - -# Local variables: -# mode: shell-script -# sh-basic-offset: 4 -# sh-indent-comment: t -# indent-tabs-mode: nil -# End: -# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/brctl bash-completion-1.2/contrib/brctl --- bash-completion-1.1/contrib/brctl 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/brctl 2010-06-13 11:21:19.000000000 +0100 @@ -6,7 +6,7 @@ local cur command COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur command=${COMP_WORDS[1]} case $COMP_CWORD in @@ -21,13 +21,13 @@ show) ;; *) - COMPREPLY=( $( compgen -W "$(brctl show | sed '1d' | \ - awk '{print $1}' )" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "$(brctl show | \ + awk 'NR>1 {print $1}' )" -- "$cur" ) ) esac ;; 3) case $command in - @(add|del)if) + addif|delif) _configured_interfaces ;; stp) @@ -37,7 +37,7 @@ ;; esac } && -complete -F _brctl $default brctl +complete -F _brctl -o default brctl # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/bzip2 bash-completion-1.2/contrib/bzip2 --- bash-completion-1.1/contrib/bzip2 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/bzip2 2010-06-13 11:21:19.000000000 +0100 @@ -1,20 +1,23 @@ # bash completion for bzip2 -have bzip2 && +have bzip2 || have pbzip2 && _bzip2() { - local cur prev xspec + 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 + -b|-h|--help|-p) + return 0 + ;; + esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-c -d -f -h -k -L -q -s \ - -t -v -V -z -1 -2 -3 -4 -5 -6 -7 -8 -9 \ - --help --decompress --compress --keep --force \ - --test --stdout --quiet --verbose --license \ - --version --small --fast --best' -- "$cur" ) ) + COMPREPLY=( $( compgen -W "${helpopts//#/} -2 -3 -4 -5 -6 -7 -8 -9" \ + -- "$cur" ) ) return 0 fi @@ -36,7 +39,7 @@ COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ $( compgen -d -- "$cur" ) ) } && -complete -F _bzip2 $filenames bzip2 +complete -F _bzip2 -o filenames bzip2 pbzip2 # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/cardctl bash-completion-1.2/contrib/cardctl --- bash-completion-1.1/contrib/cardctl 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/cardctl 2010-06-13 11:21:19.000000000 +0100 @@ -1,19 +1,19 @@ # Linux cardctl(8) completion -have cardctl && +have cardctl || have pccardctl && _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 \ resume reset eject insert scheme' -- "$cur" ) ) fi } && -complete -F _cardctl cardctl +complete -F _cardctl cardctl pccardctl # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/cfengine bash-completion-1.2/contrib/cfengine --- bash-completion-1.1/contrib/cfengine 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/cfengine 2010-06-13 11:21:19.000000000 +0100 @@ -3,16 +3,13 @@ have cfagent && { _cfagent_options() { - COMPREPLY=( $( compgen -W '-a --sysadm -b --force-net-copy -c \ - --no-check-files -C --no-check-mounts -d --debug -D --define \ - -e --no-edits -E --enforce-links -f --file -h --help -H \ - --no-hard-classes -i --no-ifconfig -I --inform -k --no-copy \ - -K --no-lock -l --traverse-links -L --delete-stale-links -m \ - --no-mount -M --no-modules -n --recon --dry-run --just-print \ - -N --negate --undefine -p --parse-only -P --no-processes -q \ - --no-splay -s --no-commands -S --silent -t --no-tidy -u \ - --use-env -U --underscore-classes -v --verbose -V --version \ - -x --no-preconf -X --no-links -w --no-warn --quiet' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--sysadm --force-net-copy --no-check-files \ + --no-check-mounts --debug --define --no-edits --enforce-links --file \ + --help --no-hard-classes --no-ifconfig --inform --no-copy --no-lock \ + --traverse-links --delete-stale-links --no-mount --no-modules \ + --dry-run --negate --parse-only --no-processes --no-splay \ + --no-commands --silent --no-tidy --use-env --underscore-classes \ + --verbose --version --no-preconf --no-links --quiet' -- "$cur" ) ) } _cfagent() @@ -20,11 +17,10 @@ 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)) + -f|--file) _filedir return 0 ;; @@ -38,10 +34,10 @@ _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 @@ -52,7 +48,6 @@ case $section in 1) - prev=${COMP_WORDS[COMP_CWORD-1]} case $prev in -f) _filedir @@ -72,7 +67,7 @@ done [ ! -f $hostfile ] && return 0 - COMPREPLY=( $(compgen -W "$( grep -v \ + COMPREPLY=( $(compgen -W "$( command grep -v \ -E '(=|^$|^#)' $hostfile )" -- "$cur" ) ) fi ;; diff -Nru bash-completion-1.1/contrib/chkconfig bash-completion-1.2/contrib/chkconfig --- bash-completion-1.1/contrib/chkconfig 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/chkconfig 2010-06-13 11:21:19.000000000 +0100 @@ -6,20 +6,19 @@ 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 - case "$prev" in - @(?(--level=)[1-6]|--@(list|add|del|override))) - _services - return 0 - ;; - --level) - COMPREPLY=( $( compgen -W '1 2 3 4 5 6' -- "$cur" ) ) - return 0 - ;; + case $prev in + --level=[1-6]|[1-6]|--list|--add|--del|--override) + _services + return 0 + ;; + --level) + COMPREPLY=( $( compgen -W '1 2 3 4 5 6' -- "$cur" ) ) + return 0 + ;; esac $split && return 0 @@ -27,7 +26,7 @@ if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '--list --add --del --override --level' -- "$cur" ) ) else - if [ $COMP_CWORD -eq 2 -o $COMP_CWORD -eq 4 ]; then + if [[ $COMP_CWORD -eq 2 || $COMP_CWORD -eq 4 ]]; then COMPREPLY=( $( compgen -W 'on off reset resetpriorities' -- "$cur" ) ) else _services diff -Nru bash-completion-1.1/contrib/chsh bash-completion-1.2/contrib/chsh --- bash-completion-1.1/contrib/chsh 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/chsh 2010-06-13 11:21:19.000000000 +0100 @@ -5,11 +5,21 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - if [ "$prev" = "-s" ]; then - _shells + case $prev in + --list-shells|--help|-v|--version) + return 0 + ;; + -s|--shell) + _shells + return 0 + ;; + esac + + if [[ "$cur" == -* && "$( uname -s )" == @(Linux|GNU|GNU/*) ]]; then + COMPREPLY=( $( compgen -W '--shell --list-shells --help --version' \ + -- "$cur" ) ) else COMPREPLY=( $( compgen -u -- "$cur" ) ) fi diff -Nru bash-completion-1.1/contrib/cksfv bash-completion-1.2/contrib/cksfv --- bash-completion-1.1/contrib/cksfv 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/cksfv 2010-06-13 11:21:19.000000000 +0100 @@ -3,23 +3,25 @@ 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 - -C) - _filedir -d - return 0 - ;; - -f) - _filedir 'sfv' - return 0 - ;; + case "$prev" in + -C) + _filedir -d + return 0 + ;; + -f) + _filedir 'sfv' + return 0 + ;; esac _filedir diff -Nru bash-completion-1.1/contrib/clisp bash-completion-1.2/contrib/clisp --- bash-completion-1.1/contrib/clisp 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/clisp 2010-06-13 11:21:19.000000000 +0100 @@ -7,7 +7,7 @@ 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 @@ -20,7 +20,7 @@ return 0 } && -complete -F _clisp $default clisp +complete -F _clisp -o default clisp # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/configure bash-completion-1.2/contrib/configure --- bash-completion-1.1/contrib/configure 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/configure 2010-06-13 11:21:19.000000000 +0100 @@ -2,26 +2,38 @@ _configure() { - local cur + local cur prev split=false COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur prev + + _split_longopt && split=true + + case $prev in + --prefix|--exec-prefix|--*dir) + _filedir -d + ;; + esac + + $split && return 0 # if $COMP_CONFIGURE_HINTS is not null, then completions of the form # --option=SETTING will include 'SETTING' as a contextual hint [[ "$cur" != -* ]] && return 0 if [ -n "$COMP_CONFIGURE_HINTS" ]; then - COMPREPLY=( $( $1 --help 2>&1 | awk '/^ --[A-Za-z]/ { print $1; \ - if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,].*//g' | \ - grep ^$cur ) ) + COMPREPLY=( $( compgen -W "$( $1 --help 2>&1 | \ + awk '/^ --[A-Za-z]/ { print $1; \ + if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,].*//g' )" \ + -- "$cur" ) ) else - COMPREPLY=( $( $1 --help 2>&1 | awk '/^ --[A-Za-z]/ { print $1; \ - if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,=].*//g' | \ - grep ^$cur ) ) + COMPREPLY=( $( compgen -W "$( $1 --help 2>&1 | \ + awk '/^ --[A-Za-z]/ { print $1; \ + if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,=].*//g' )" \ + -- "$cur" ) ) fi } -complete -F _configure $default configure +complete -F _configure -o filenames configure # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/coreutils bash-completion-1.2/contrib/coreutils --- bash-completion-1.1/contrib/coreutils 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/coreutils 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,122 @@ +# Completions for various core utilities + +# chown(1) completion +# +have chown && +_chown() +{ + local cur prev split=false + + # Get cur and prev words; but don't treat user:group as separate words. + _get_comp_words_by_ref -n : cur prev + + _split_longopt && split=true + + case "$prev" in + --from) + _usergroup + return 0 + ;; + --reference) + _filedir + return 0 + ;; + esac + + $split && return 0 + + if [[ "$cur" == -* ]]; then + # Complete -options + local w opts + for w in "${COMP_WORDS[@]}" ; do + [[ "$w" == -@(R|-recursive) ]] && opts="-H -L -P" && break + done + COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes --dereference \ + --no-dereference --from --silent --quiet --reference --recursive \ + --verbose --help --version $opts' -- "$cur" ) ) + else + local args + + # The first argument is an usergroup; the rest are filedir. + _count_args : + + if [[ $args == 1 ]]; then + _usergroup + else + _filedir + fi + fi +} && +complete -F _chown -o filenames chown + + +# chgrp(1) completion +# +have chgrp && +_chgrp() +{ + local cur prev split=false + + COMPREPLY=() + _get_comp_words_by_ref cur prev + cur=${cur//\\\\/} + + _split_longopt && split=true + + if [[ "$prev" == --reference ]]; then + _filedir + return 0 + fi + + $split && return 0 + + # options completion + if [[ "$cur" == -* ]]; then + local w opts + for w in "${COMP_WORDS[@]}" ; do + [[ "$w" == -@(R|-recursive) ]] && opts="-H -L -P" && break + done + COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes --dereference \ + --no-dereference --silent --quiet --reference --recursive \ + --verbose --help --version $opts' -- "$cur" ) ) + return 0 + fi + + # first parameter on line or first since an option? + if [[ $COMP_CWORD -eq 1 && "$cur" != -* || "$prev" == -* ]]; then + local IFS=$'\n' + COMPREPLY=( $( compgen -g "$cur" 2>/dev/null ) ) + else + _filedir || return 0 + fi + + return 0 +} && +complete -F _chgrp -o filenames chgrp + +# id(1) completion +# +have id && +_id() +{ + local cur + + COMPREPLY=() + _get_comp_words_by_ref cur + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-a -g --group -G --groups -n --name\ + -r --real -u --user --help --version' -- "$cur" ) ) + else + COMPREPLY=( $( compgen -u "$cur" ) ) + fi +} && +complete -F _id id + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/cowsay bash-completion-1.2/contrib/cowsay --- bash-completion-1.1/contrib/cowsay 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/cowsay 2010-06-13 11:21:19.000000000 +0100 @@ -6,8 +6,7 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in -f) @@ -21,7 +20,7 @@ -- "$cur" ) ) } && -complete -F _cowsay $default cowsay cowthink +complete -F _cowsay -o default cowsay cowthink # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/cpan2dist bash-completion-1.2/contrib/cpan2dist --- bash-completion-1.1/contrib/cpan2dist 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/cpan2dist 2010-06-13 11:21:19.000000000 +0100 @@ -6,8 +6,7 @@ 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) @@ -17,7 +16,7 @@ -- "$cur" ) ) return 0 ;; - --@(banlist|ignorelist|modulelist|logfile)) + --banlist|--ignorelist|--modulelist|--logfile) _filedir return 0 ;; @@ -34,7 +33,7 @@ else cpandirs=( "$HOME/.cpanplus/" "$HOME/.cpan/source/modules/" ) for dir in ${cpandirs[@]}; do - [ -d "$dir" -a -r "$dir/02packages.details.txt.gz" ] && \ + [[ -d "$dir" && -r "$dir/02packages.details.txt.gz" ]] && \ packagelist="$dir/02packages.details.txt.gz" done COMPREPLY=( $( zgrep "^${cur//-/::}" \ @@ -42,7 +41,7 @@ | awk '{print $1}' | sed -e 's/::/-/g' ) ) fi } && -complete -F _cpan2dist $default cpan2dist +complete -F _cpan2dist -o default cpan2dist # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/cpio bash-completion-1.2/contrib/cpio --- bash-completion-1.1/contrib/cpio 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/cpio 2010-06-13 11:21:19.000000000 +0100 @@ -11,8 +11,7 @@ local cur prev split=false COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref -n : cur prev _split_longopt && split=true @@ -22,7 +21,7 @@ _cpio_format return 0 ;; - -@(E|F|I|-?(pattern-)file)) + -E|-F|-I|--file|--pattern-file) _filedir return 0 ;; @@ -39,10 +38,11 @@ $split && return 0 if [ $COMP_CWORD -eq 1 ]; then - COMPREPLY=( $( compgen -W '-o --create -i --extract -p --pass-through' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '-o --create -i --extract -p --pass-through \ + -? --help --license --usage --version' -- "$cur" ) ) else case ${COMP_WORDS[1]} in - -@(o|-create)) + -o|--create) if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '-0 -a -c -v -A -B\ -L -V -C -H -M -O -F --file --format\ @@ -53,7 +53,7 @@ --version' -- "$cur" ) ) fi ;; - -@(i|-extract)) + -i|--extract) if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '-b -c -d -f -m -n -r\ -t -s -u -v -B -S -V -C -E -H -M -R -I\ @@ -69,10 +69,11 @@ --force-local --no-absolute-filenames\ --sparse --only-verify-crc --quiet\ --rsh-command --help\ + --to-stdout \ --version' -- "$cur" ) ) fi ;; - -@(p|-pass-through)) + -p|--pass-through) if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '-0 -a -d -l -m -u -v\ -L -V -R --null --reset-access-time\ @@ -89,7 +90,7 @@ esac fi } -complete -F _cpio cpio +complete -F _cpio -o filenames cpio } # Local variables: diff -Nru bash-completion-1.1/contrib/cryptsetup bash-completion-1.2/contrib/cryptsetup --- bash-completion-1.1/contrib/cryptsetup 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/cryptsetup 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,113 @@ +# bash completion for cryptsetup + +_cryptsetup_name() +{ + COMPREPLY=( $( compgen -X control -W '$( command ls /dev/mapper )' \ + -- "$cur" ) ) +} + +_cryptsetup_device() +{ + cur=${cur:=/dev/} + _filedir +} + +have cryptsetup && +_cryptsetup() +{ + local cur prev arg + COMPREPLY=() + cur=`_get_cword` + prev=`_get_pword` + + case $prev in + --key-file|--master-key-file|--header-backup-file|-d) + _filedir + return 0; + ;; + esac + + _get_first_arg + if [ -z $arg ]; then + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--hash --cipher --verify-passphrase \ + --key-file --master-key-file --key-slot --key-size --size \ + --offset --skip --readonly --iter-time --batch-mode --timeout \ + --tries --align-payload --version' -- "$cur" ) ) + else + COMPREPLY=( $( compgen -W 'create remove status resize luksFormat \ + luksOpen luksClose luksSuspend luksResume luksAddKey \ + luksRemoveKey luksKillSlot luksDelKey luksUUID isLuks \ + luksDump luksHeaderBackup luksHeaderRestore' -- "$cur" ) ) + fi + else + _count_args + case $arg in + create) + case $args in + 2) + _cryptsetup_name + ;; + 3) + _cryptsetup_device + ;; + esac + ;; + remove|status|resize|luksClose|luksSuspend|luksResume) + case $args in + 2) + _cryptsetup_name + ;; + esac + ;; + luksFormat|luksAddKey|luksRemoveKey) + case $args in + 2) + _cryptsetup_device + ;; + 3) + _filedir + ;; + esac + ;; + luksOpen) + case $args in + 2) + _cryptsetup_device + ;; + 3) + _cryptsetup_name + ;; + esac + ;; + luksKillSlot|luksDelKey|luksUUID|isLuks|luksDump) + case $args in + 2) + _cryptsetup_device + ;; + esac + ;; + luksHeaderBackup|luksHeaderRestore) + case $args in + 2) + _cryptsetup_device + ;; + 3) + COMPREPLY=( '--header-backup-file' ) + ;; + esac + ;; + esac + fi + + return 0 +} && +complete -F _cryptsetup cryptsetup + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/cups bash-completion-1.2/contrib/cups --- bash-completion-1.1/contrib/cups 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/cups 2010-06-13 11:21:19.000000000 +0100 @@ -6,11 +6,11 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur COMPREPLY=( $( compgen -W "$( lpstat | cut -d' ' -f1 )" -- "$cur" ) ) } && -complete -F _cancel $filenames cancel +complete -F _cancel -o filenames cancel # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/cvs bash-completion-1.2/contrib/cvs --- bash-completion-1.1/contrib/cvs 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/cvs 2010-06-13 11:21:19.000000000 +0100 @@ -23,83 +23,116 @@ fi } +_cvs_commands() +{ + cvs --help-commands 2>&1 | awk '/^( *|\t)/ { print $1 }' +} + +_cvs_options() +{ + cvs --help-options 2>&1 | awk '/^( *|\t)-/ { print $1 }' +} + +_cvs_command_options() +{ + cvs --help $1 2>&1 | sed -ne 's/^[[:space:]]*\(-[^[:space:]=[]*\).*/\1/p' +} + +_cvs_kflags() +{ + COMPREPLY=( $( compgen -W 'kv kvl k o b v' -- "$cur" ) ) +} + +_cvs_roots() +{ + local -a cvsroots + cvsroots=( $CVSROOT ) + [ -r ~/.cvspass ] && \ + cvsroots=( "${cvsroots[@]}" $( awk '{ print $2 }' ~/.cvspass ) ) + [ -r CVS/Root ] && cvsroots=( "${cvsroots[@]}" $(cat CVS/Root) ) + COMPREPLY=( $( compgen -W '${cvsroots[@]}' -- "$cur" ) ) + __ltrim_colon_completions "$cur" +} + _cvs() { - local cur count mode i cvsroot cvsroots pwd + local cur prev count mode i cvsroot cvsroots pwd local -a flags miss files entries changed newremoved COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref -n : cur prev count=0 for i in "${COMP_WORDS[@]}"; do [ $count -eq $COMP_CWORD ] && break # Last parameter was the CVSROOT, now go back to mode selection - if [ "${COMP_WORDS[((count))]}" == "$cvsroot" -a "$mode" == "cvsroot" ]; then + if [[ "${COMP_WORDS[((count))]}" == "$cvsroot" && "$mode" == cvsroot ]]; then mode="" fi if [ -z "$mode" ]; then case $i in - -d) - mode=cvsroot - cvsroot=${COMP_WORDS[((count+1))]} - ;; - @(ad?(d)|new)) - mode=add - ;; - @(adm?(in)|rcs)) - mode=admin - ;; - ann?(notate)) - mode=annotate - ;; - @(checkout|co|get)) - mode=checkout - ;; - @(com?(mit)|ci)) - mode=commit - ;; - di?(f?(f))) - mode=diff - ;; - ex?(p?(ort))) - mode=export - ;; - ?(un)edit) - mode=$i - ;; - hi?(s?(tory))) - mode=history - ;; - im?(p?(ort))) - mode=import - ;; - re?(l?(ease))) - mode=release - ;; - ?(r)log) - mode=log - ;; - @(rdiff|patch)) - mode=rdiff - ;; - @(remove|rm|delete)) - mode=remove - ;; - @(rtag|rfreeze)) - mode=rtag - ;; - st?(at?(us))) - mode=status - ;; - @(tag|freeze)) - mode=tag - ;; - up?(d?(ate))) - mode=update - ;; - *) - ;; + -H|--help) + COMPREPLY=( $( compgen -W "$( _cvs_commands )" -- "$cur" ) ) + return 0 + ;; + -d) + mode=cvsroot + cvsroot=${COMP_WORDS[((count+1))]} + ;; + ad|add|new) + mode=add + ;; + adm|admin|rcs) + mode=admin + ;; + ann|annotate) + mode=annotate + ;; + checkout|co|get) + mode=checkout + ;; + com|commit|ci) + mode=commit + ;; + di|dif|diff) + mode=diff + ;; + ex|exp|export) + mode=export + ;; + edit|unedit) + mode=$i + ;; + hi|his|history) + mode=history + ;; + im|imp|import) + mode=import + ;; + re|rel|release) + mode=release + ;; + log|rlog) + mode=log + ;; + rdiff|patch) + mode=rdiff + ;; + remove|rm|delete) + mode=remove + ;; + rtag|rfreeze) + mode=rtag + ;; + st|stat|status) + mode=status + ;; + tag|freeze) + mode=tag + ;; + up|upd|update) + mode=update + ;; esac elif [[ "$i" = -* ]]; then flags=( "${flags[@]}" $i ) @@ -107,11 +140,21 @@ count=$((++count)) done - case "$mode" in + case $mode in add) + case $prev in + -m) + return 0 + ;; + -k) + _cvs_kflags + return 0 + ;; + esac + if [[ "$cur" != -* ]]; then set_prefix - if [ $COMP_CWORD -gt 1 -a -r ${prefix:-}CVS/Entries ]; then + if [[ $COMP_CWORD -gt 1 && -r ${prefix:-}CVS/Entries ]]; then get_entries [ -z "$cur" ] && \ files=$( command ls -Ad !(CVS) ) || \ @@ -122,35 +165,77 @@ COMPREPLY=( $( compgen -X '*~' -W '${files[@]}' -- $cur ) ) fi else - COMPREPLY=( $( compgen -W '-k -m' -- "$cur" ) ) + COMPREPLY=( $( compgen -W "$( _cvs_command_options $mode )" \ + -- "$cur" ) ) fi ;; admin) + case $prev in + -a|-A|-b|-c|-e|-l|-m|-n|-N|-o|-s|-t-|-u) + return 0 + ;; + -t) + _filedir + return 0 + ;; + -k) + _cvs_kflags + return 0 + ;; + esac + if [[ "$cur" = -* ]]; then - COMPREPLY=( $( compgen -W '-i -a -A -e -b -c -k -l -u -L -U -m -M \ - -n -N -o -q -I -s -t -t- -T -V -x -z' -- $cur ) ) + COMPREPLY=( $( compgen -W "$( _cvs_command_options $mode )" \ + -- "$cur" ) ) fi ;; annotate) + [[ "$prev" == -@(r|D) ]] && return 0 + if [[ "$cur" = -* ]]; then - COMPREPLY=( $( compgen -W '-D -F -f -l -R -r' -- "$cur" ) ) + COMPREPLY=( $( compgen -W "$( _cvs_command_options $mode )" \ + -- "$cur" ) ) else get_entries COMPREPLY=( $( compgen -W '${entries[@]}' -- "$cur" ) ) fi ;; checkout) + case $prev in + -r|-D|j) + return 0 + ;; + -d) + _filedir -d + return 0 + ;; + -k) + _cvs_kflags + return 0 + ;; + esac + if [[ "$cur" != -* ]]; then [ -z "$cvsroot" ] && cvsroot=$CVSROOT COMPREPLY=( $( cvs -d "$cvsroot" co -c 2> /dev/null | \ awk '{print $1}' ) ) COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) ) else - COMPREPLY=( $( compgen -W '-A -N -P -R -c -f -l -n -p \ - -s -r -D -d -k -j' -- "$cur" ) ) + COMPREPLY=( $( compgen -W "$( _cvs_command_options $mode )" \ + -- "$cur" ) ) fi ;; commit) + case $prev in + -m|-r) + return 0 + ;; + -F) + _filedir + return 0 + ;; + esac + set_prefix if [[ "$cur" != -* ]] && [ -r ${prefix:-}CVS/Entries ]; then @@ -169,26 +254,39 @@ COMPREPLY=( $( compgen -W '${changed[@]:-} \ ${newremoved[@]:-}' -- "$cur" ) ) else - COMPREPLY=( $(compgen $default -- "$cur") ) + COMPREPLY=( $(compgen -o default -- "$cur") ) fi else - COMPREPLY=( $( compgen -W '-n -R -l -f -F -m -r' -- $cur ) ) + COMPREPLY=( $( compgen -W "$( _cvs_command_options $mode )" \ + -- "$cur" ) ) fi ;; cvsroot) - if [ -r ~/.cvspass ]; then - # Ugly escaping because of bash treating ':' specially - cvsroots=$( sed 's/^[^ ]* //; s/:/\\:/g' ~/.cvspass ) - COMPREPLY=( $( compgen -W '$cvsroots' -- "$cur" ) ) - fi + # TODO: works poorly because of the colons and -o default, + # could we drop -o default? works ok without it in cvsps + _cvs_roots ;; export) + case $prev in + -r|-D) + return 0 + ;; + -d) + _filedir -d + return 0 + ;; + -k) + _cvs_kflags + return 0 + ;; + esac + if [[ "$cur" != -* ]]; then [ -z "$cvsroot" ] && cvsroot=$CVSROOT COMPREPLY=( $( cvs -d "$cvsroot" co -c | awk '{print $1}' ) ) COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) ) else - COMPREPLY=( $( compgen -W '-N -f -l -R -n -r -D -d -k' \ + COMPREPLY=( $( compgen -W "$( _cvs_command_options $mode )" \ -- "$cur" ) ) fi ;; @@ -203,7 +301,7 @@ remove) if [[ "$cur" != -* ]]; then set_prefix - if [ $COMP_CWORD -gt 1 -a -r ${prefix:-}CVS/Entries ]; then + if [[ $COMP_CWORD -gt 1 && -r ${prefix:-}CVS/Entries ]]; then get_entries # find out what files are missing for i in "${entries[@]}"; do @@ -212,10 +310,21 @@ COMPREPLY=( $(compgen -W '${miss[@]:-}' -- "$cur") ) fi else - COMPREPLY=( $( compgen -W '-f -l -R' -- "$cur" ) ) + COMPREPLY=( $( compgen -W "$( _cvs_command_options $mode )" \ + -- "$cur" ) ) fi ;; import) + case $prev in + -I|-b|-m|-W) + return 0 + ;; + -k) + _cvs_kflags + return 0 + ;; + esac + if [[ "$cur" != -* ]]; then # starts with same algorithm as checkout [ -z "$cvsroot" ] && cvsroot=$CVSROOT @@ -229,32 +338,49 @@ pwd=${pwd##*/} COMPREPLY=( $( compgen -W '${COMPREPLY[@]} $pwd' -- $cur ) ) else - COMPREPLY=( $( compgen -W '-d -k -I -b -m -W' -- "$cur" )) + COMPREPLY=( $( compgen -W "$( _cvs_command_options $mode )" \ + -- "$cur" ) ) fi ;; update) + case $prev in + -r|-D|-j|-I|-W) + return 0 + ;; + -k) + _cvs_kflags + return 0 + ;; + esac + if [[ "$cur" = -* ]]; then - COMPREPLY=( $( compgen -W '-A -P -C -d -f -l -R -p \ - -k -r -D -j -I -W' -- "$cur" ) ) + COMPREPLY=( $( compgen -W "$( _cvs_command_options $mode )" \ + -- "$cur" ) ) fi ;; "") - COMPREPLY=( $( compgen -W 'add admin annotate checkout ci co \ - commit diff delete edit export \ - freeze get history import log new \ - patch rcs rdiff release remove \ - rfreeze rlog rm rtag stat status \ - tag unedit up update -H -Q -q -b \ - -d -e -f -l -n -t -r -v -w -x -z \ - --help --version' -- "$cur" ) ) - ;; - *) + case $prev in + -T) + _filedir -d + return 0 + ;; + -e|-s) + return 0 + ;; + -z) + COMPREPLY=( $( compgen -W '1 2 3 4 5 6 7 8 9' -- "$cur" ) ) + return 0 + ;; + esac + + COMPREPLY=( $( compgen -W '$( _cvs_commands ) $( _cvs_options ) \ + --help --help-commands --help-options --version' -- "$cur" ) ) ;; esac return 0 } -complete -F _cvs $default cvs +complete -F _cvs -o default cvs } # Local variables: diff -Nru bash-completion-1.1/contrib/cvsps bash-completion-1.2/contrib/cvsps --- bash-completion-1.1/contrib/cvsps 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/cvsps 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,69 @@ +# bash completion for cvsps + +have cvsps && +_cvsps() +{ + COMPREPLY=() + local cur prev + _get_comp_words_by_ref -n : cur prev + + case $prev in + -h|-z|-f|-d|-l|--diff-opts|--debuglvl) + return 0 + ;; + -s) + COMPREPLY=( $( compgen -W "$( cvsps 2>/dev/null | + awk '/^PatchSet:?[ \t]/ { print $2 }' )" -- "$cur" ) ) + return 0 + ;; + -a) + COMPREPLY=( $( compgen -W "$( cvsps 2>/dev/null | + awk '/^Author:[ \t]/ { print $2 }' )" -- "$cur" ) ) + return 0 + ;; + -b) + COMPREPLY=( $( compgen -W "$( cvsps 2>/dev/null | + awk '/^Branch:[ \t]/ { print $2 }' )" -- "$cur" ) ) + return 0 + ;; + -r) + COMPREPLY=( $( compgen -W "$( cvsps 2>/dev/null | + awk '/^Tag:[ \t]+[^(]/ { print $2 }' )" -- "$cur" ) ) + return 0 + ;; + -p) + _filedir -d + return 0 + ;; + --test-log) + _filedir + return 0 + ;; + -Z) + COMPREPLY=( $( compgen -W '1 2 3 4 5 6 7 8 9' -- "$cur" ) ) + return 0 + ;; + --root) + type _cvs_roots &>/dev/null && _cvs_roots + return 0 + ;; + esac + + if [[ "$cur" == -* ]] ; then + COMPREPLY=( $( compgen -W '-h -x -u -z -g -s -a -f -d -b -l -r -p -v \ + -t --norc --summary-first --test-log --diff-opts --bkcvs --no-rlog \ + --cvs-direct --no-cvs-direct --debuglvl -Z --root -q -A' \ + -- "$cur" ) ) + else + type _cvs_roots &>/dev/null && _cvs_roots + fi +} && +complete -F _cvsps cvsps + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/dcop bash-completion-1.2/contrib/dcop --- bash-completion-1.1/contrib/dcop 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/dcop 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -# bash completion for dcop - -have dcop && -_dcop() -{ - local cur compstr - - COMPREPLY=() - cur=`_get_cword` - if [ -z $cur ]; then - compstr=${COMP_WORDS[*]} - else - compstr=$( command echo ${COMP_WORDS[*]} | sed "s/ $cur$//" ) - fi - COMPREPLY=( $( compgen -W '$( command $compstr | sed s/\(.*\)// )' \ - -- "$cur" ) ) -} && -complete -F _dcop dcop - -# Local variables: -# mode: shell-script -# sh-basic-offset: 4 -# sh-indent-comment: t -# indent-tabs-mode: nil -# End: -# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/dd bash-completion-1.2/contrib/dd --- bash-completion-1.1/contrib/dd 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/dd 2010-06-13 11:21:19.000000000 +0100 @@ -6,9 +6,9 @@ local cur COMPREPLY=() - cur=`_get_cword =` + _get_comp_words_by_ref -n = cur - case "$cur" in + case $cur in if=*|of=*) cur=${cur#*=} _filedir @@ -28,7 +28,7 @@ $( compgen -W 'bs cbs conv count ibs if obs of seek skip'\ -S '=' -- "$cur" ) ) } && -complete -F _dd $nospace $filenames dd +complete -F _dd -o nospace -o filenames dd # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/dhclient bash-completion-1.2/contrib/dhclient --- bash-completion-1.1/contrib/dhclient 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/dhclient 2010-06-13 11:21:19.000000000 +0100 @@ -5,11 +5,10 @@ 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)) + case $prev in + -cf|-lf|-pf|-sf) _filedir return 0 ;; diff -Nru bash-completion-1.1/contrib/dict bash-completion-1.2/contrib/dict --- bash-completion-1.1/contrib/dict 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/dict 2010-06-13 11:21:19.000000000 +0100 @@ -12,61 +12,60 @@ 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 - case "${COMP_WORDS[i]}" in - -@(h|--host)) - host=${COMP_WORDS[i+1]} - [ -n "$host" ] && host="-h $host" - i=$((++i)) - ;; - -@(p|-port)) - port=${COMP_WORDS[i+1]} - [ -n "$port" ] && port="-p $port" - i=$((++i)) - ;; - -@(d|-database)) - db=${COMP_WORDS[i+1]} - [ -n "$db" ] && host="-d $db" - i=$((++i)) - ;; - *) - ;; + case ${COMP_WORDS[i]} in + -h|--host) + host=${COMP_WORDS[i+1]} + [ -n "$host" ] && host="-h $host" + i=$((++i)) + ;; + -p|--port) + port=${COMP_WORDS[i+1]} + [ -n "$port" ] && port="-p $port" + i=$((++i)) + ;; + -d|--database) + db=${COMP_WORDS[i+1]} + [ -n "$db" ] && host="-d $db" + i=$((++i)) + ;; + *) + ;; esac done if [[ "$cur" = -* ]]; then - COMPREPLY=( $( compgen -W '-h --host -p --port -d --database \ - -m --match -s --strategy -c --config -C \ - --nocorrect -D --dbs -S --strats -H \ - --serverhelp -i --info -I --serverinfo \ - -a --noauth -u --user -k --key -V --version \ - -L --license --help -v --verbose -r --raw \ - -P --pager --debug --html --pipesize --client' \ + COMPREPLY=( $( compgen -W '--host --port --database \ + --match --strategy --config \ + --nocorrect --dbs --strats \ + --serverhelp --info --serverinfo \ + --noauth --user --key --version \ + --license --help --verbose --raw \ + --pager --debug --html --pipesize --client' \ -- "$cur" ) ) return 0 fi - case "$prev" in - -@(d|-database|i|info)) - COMPREPLY=( $( compgen -W '$( _dictdata -D )' -- "$cur" ) ) - return 0 - ;; - -@(s|-strategy)) - COMPREPLY=( $( compgen -W '$( _dictdata -S )' -- "$cur" ) ) - return 0 - ;; - *) - ;; + case $prev in + -d|--database|-i|-info) + COMPREPLY=( $( compgen -W '$( _dictdata -D )' -- "$cur" ) ) + return 0 + ;; + -s|--strategy) + COMPREPLY=( $( compgen -W '$( _dictdata -S )' -- "$cur" ) ) + return 0 + ;; + *) + ;; esac [ -r $dictfile ] && \ COMPREPLY=( $( compgen -W '$( cat $dictfile )' -- "$cur" ) ) } -complete -F _dict $default dict rdict +complete -F _dict -o default dict rdict } # Local variables: diff -Nru bash-completion-1.1/contrib/dpkg bash-completion-1.2/contrib/dpkg --- bash-completion-1.1/contrib/dpkg 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/dpkg 2010-06-13 11:21:19.000000000 +0100 @@ -8,11 +8,11 @@ } || { _comp_dpkg_installed_packages() { - grep -A 1 "Package: $1" /var/lib/dpkg/status | \ - grep -B 1 -Ee "ok installed|half-installed|unpacked| \ + command grep -A 1 "Package: $1" /var/lib/dpkg/status | \ + command grep -B 1 -Ee "ok installed|half-installed|unpacked| \ half-configured|config-files" \ -Ee "^Essential: yes" | \ - grep "Package: $1" | cut -d\ -f2 + command grep "Package: $1" | cut -d\ -f2 } } @@ -23,8 +23,7 @@ local cur prev i COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev i=$COMP_CWORD _expand || return 0 @@ -39,24 +38,26 @@ done fi - case "$prev" in - -@(c|i|A|I|f|e|x|X|-@(install|unpack|record-avail|contents|info|fsys-tarfile|field|control|extract))) + case $prev in + -c|-i|-A|-I|-f|-e|-x|-X|-W|--install|--unpack|--record-avail| \ + --contents|--info|--fsys-tarfile|--field|--control|--extract| \ + --show) _filedir '?(u)deb' return 0 ;; - -@(b|-build)) + -b|--build) _filedir -d return 0 ;; - -@(s|p|l|-@(status|print-avail|list))) + -s|-p|-l|--status|--print-avail|--list) COMPREPLY=( $( apt-cache pkgnames "$cur" 2>/dev/null ) ) return 0 ;; - -@(S|-search)) + -S|--search) _filedir return 0 ;; - -@(r|L|P|-@(remove|purge|listfiles))) + -r|-L|-P|--remove|--purge|--listfiles) COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) ) return 0 ;; @@ -91,7 +92,7 @@ } -complete -F _dpkg $filenames dpkg dpkg-deb +complete -F _dpkg -o filenames dpkg dpkg-deb } # Debian GNU dpkg-reconfigure(8) completion @@ -102,50 +103,48 @@ local cur prev opt COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - - case "$prev" in - -@(f|-frontend)) - opt=( $( echo /usr/share/perl5/Debconf/FrontEnd/* ) ) + case $prev in + -f|--frontend) + opt=( $( printf '%s\n' /usr/share/perl5/Debconf/FrontEnd/* ) ) opt=( ${opt[@]##*/} ) opt=( ${opt[@]%.pm} ) COMPREPLY=( $( compgen -W '${opt[@]}' -- "$cur" ) ) return 0 ;; - -@(p|-priority)) + -p|--priority) COMPREPLY=( $( compgen -W 'low medium high critical' -- "$cur" ) ) return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-f --frontend -p --priority -a --all -u \ - --unseen-only -h --help -s --showold --force --terse' -- "$cur" ) ) + COMPREPLY=( $(compgen -W '--frontend --priority --all --unseen-only \ + --help --showold --force --terse' -- "$cur" ) ) else COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) ) fi } && -complete -F _dpkg_reconfigure $default dpkg-reconfigure +complete -F _dpkg_reconfigure -o default dpkg-reconfigure # Debian dpkg-source completion # have dpkg-source && _dpkg_source() { - local cur prev options work i action packopts unpackopts + local cur prev options work i action packopts unpackopts fields - packopts="-c -l -F -V -T -D -U -W -E -sa -i -I -sk -sp -su -sr -ss -sn -sA -sK -sP -sU -sR" + packopts="-c -l -F -V -T -D -U -W -E -sa -i -I -sk -sr -ss -sA -sK -sP \ + -sU -sR" unpackopts="-sp -sn -su" - options=`echo "-x -b $packopts $unpackopts" | xargs echo | sort -u | xargs echo` + options="-x -b $packopts $unpackopts" + fields="Format Source Version Binary Maintainer Uploader Architecture \ + Standards-Version Build-Depends Files" COMPREPLY=() - if [ "$1" != "dpkg-source" ]; then - return 1 - fi - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev + action="options" for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do if [[ ${COMP_WORDS[$i]} == "-x" ]]; then @@ -156,103 +155,80 @@ action=help fi done - # if currently seeing a complete option, return just itself. - for i in $options; do - if [ "$cur" = "$i" ]; then - COMPREPLY=( "$cur" ) - return 0 - fi - done - case "$action" in - "unpack") - if [ "$cur" = "-" -o "$cur" = "-s" ]; then - COMPREPLY=( $unpackopts ) - return 0 - fi - case "$prev" in - "-x") - COMPREPLY=( $( compgen -d -- "$cur" ) \ - $( compgen -f -X '!*.dsc' -- "$cur" ) ) + + case $action in + unpack) + case $prev in + -x) + _filedir -d + _filedir 'dsc' return 0 ;; *) - COMPREPLY=( $unpackopts $(compgen -d -f -- "$cur" ) ) + COMPREPLY=( $( compgen -W "$unpackopts" -- "$cur" ) ) + _filedir -d + _filedir return 0 ;; esac return 0 ;; - "pack") - if [ "$cur" = "-" ]; then - COMPREPLY=( $packopts ) - return 0 - fi - if [ "$cur" = "-s" ]; then - COMPREPLY=( "-sa" "-sk" "-sp" "-su" "-sr" "-ss" "-sn" \ - "-sA" "-sK" "-sP" "-sU" "-sR" ) - return 0 - fi - case "$prev" in - "-b") - COMPREPLY=( $( compgen -d -- "$cur" ) ) + pack) + case $prev in + -b) + _filedir -d return 0 ;; - "-c"|"-l"|"-T"|"-i"|"-I") + -c|-l|-T|-i|-I) # -c: get controlfile # -l: get per-version info from this file # -T: read variables here, not debian/substvars # -i: filter out files to ignore diffs of. # -I: filter out files when building tarballs. # return directory names and file names - COMPREPLY=( $( compgen -d -f ) ) + _filedir -d + _filedir return 0 ;; - "-F") + -F) # -F: force change log format - COMPREPLY=( $( ( cd /usr/lib/dpkg/parsechangelog; compgen -f "$cur" ) ) ) + COMPREPLY=( $( command ls /usr/lib/dpkg/parsechangelog ) ) return 0 ;; - "-V"|"-D") + -V|-D) # -V: set a substitution variable # we don't know anything about possible variables or values # so we don't try to suggest any completion. COMPREPLY=() return 0 ;; - "-D") + -D) # -D: override or add a .dsc field and value # if $cur doesn't contain a = yet, suggest variable names - if echo -- "$cur" | grep -q "="; then + if [[ "$cur" == *=* ]]; then # $cur contains a "=" COMPREPLY=() return 0 else - COMPREPLY=( Format Source Version Binary Maintainer Uploader Architecture Standards-Version Build-Depends Files ) + COMPREPLY=( $( compgen -W "$fields" -- "$cur" ) ) return 0 fi ;; - "-U") + -U) # -U: remove a field # Suggest possible fieldnames - COMPREPLY=( Format Source Version Binary Maintainer Uploader Architecture Standards-Version Build-Depends Files ) + COMPREPLY=( $( compgen -W "$fields" -- "$cur" ) ) return 0 ;; *) - COMPREPLY=( $packopts ) + COMPREPLY=( $( compgen -W "$packopts $unpackopts" -- "$cur" ) ) return 0 ;; esac return 0 ;; *) - # if seeing a partial option, return possible completions. - if [ "$cur" = "-s" ]; then - COMPREPLY=( "-sa" "-sk" "-sp" "-su" "-sr" "-ss" "-sn" \ - "-sA" "-sK" "-sP" "-sU" "-sR" ) - return 0 - fi - # else return all possible options. - COMPREPLY=( $options ) + COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) return 0 ;; esac diff -Nru bash-completion-1.1/contrib/dselect bash-completion-1.2/contrib/dselect --- bash-completion-1.1/contrib/dselect 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/dselect 2010-06-13 11:21:19.000000000 +0100 @@ -6,15 +6,14 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in --admindir) _filedir -d return 0 ;; - -@(D|debug)) + -D|-debug) _filedir return 0 ;; @@ -31,7 +30,7 @@ return 0 } && -complete -F _dselect $filenames dselect +complete -F _dselect -o filenames dselect # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/dsniff bash-completion-1.2/contrib/dsniff --- bash-completion-1.1/contrib/dsniff 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/dsniff 2010-06-13 11:21:19.000000000 +0100 @@ -1,19 +1,16 @@ -# dsniff util completion by Guillaume Rousse +# dsniff util completion -# arpspoof(8) completion -# have arpspoof && _arpspoof() { local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -i) - _interfaces + _available_interfaces return 0 ;; -t) @@ -31,18 +28,15 @@ } && complete -F _arpspoof arpspoof -# dnsspoof(8) completion -# have dnsspoof && _dnsspoof() { local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -i) _interfaces return 0 @@ -60,19 +54,16 @@ } && complete -F _dnsspoof dnsspoof -# dsniff(8) completion -# have dsniff && _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)) + case $prev in + -r|-w|-f) _filedir return 0 ;; @@ -89,18 +80,15 @@ } && complete -F _dsniff dsniff -# filesnarf(8), mailsnarf(8) and msgsnarf (8) completion -# have filesnarf || have mailsnarf || have msgsnarf && _snarf() { local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -i) _interfaces return 0 @@ -114,18 +102,15 @@ } && complete -F _snarf filesnarf mailsnarf msgsnarf -# macof(8) completion -# have macof && _macof() { local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -i) _interfaces return 0 @@ -140,15 +125,13 @@ } && complete -F _macof macof -# sshmitm(8) completion -# have sshmitm && _sshmitm() { local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '-d -I -p' -- "$cur" ) ) @@ -159,18 +142,15 @@ } && complete -F _sshmitm sshmitm -# sshow(8) completion -# have sshow && _sshow() { local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -i) _interfaces return 0 @@ -184,18 +164,15 @@ } && complete -F _sshow sshow -# tcpkill(8) completion -# have tcpkill && _tcpkill() { local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -i) _interfaces return 0 @@ -209,18 +186,15 @@ } && complete -F _tcpkill tcpkill -# tcpnice(8) completion -# have tcpnice && _tcpnice() { local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -i) _interfaces return 0 @@ -234,18 +208,15 @@ } && complete -F _tcpnice tcpnice -# urlsnarf(8) completion -# have urlsnarf && _urlsnarf() { local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -i) _interfaces return 0 @@ -259,15 +230,13 @@ } && complete -F _urlsnarf urlsnarf -# webmitm(8) completion -# have webmitm && _webmitm() { local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '-d' -- "$cur" ) ) diff -Nru bash-completion-1.1/contrib/findutils bash-completion-1.2/contrib/findutils --- bash-completion-1.1/contrib/findutils 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/findutils 2010-06-13 11:21:19.000000000 +0100 @@ -8,94 +8,100 @@ 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 - -@(max|min)depth) - COMPREPLY=( $( compgen -W '0 1 2 3 4 5 6 7 8 9' -- "$cur" ) ) - return 0 - ;; - -?(a|c)newer|-fls|-fprint?(0|f)|-?(i)?(l)name|-?(i)wholename) - _filedir - return 0 - ;; - -fstype) - # this is highly non-portable - [ -e /proc/filesystems ] && - COMPREPLY=( $( compgen -W "$( cut -d$'\t' -f2 /proc/filesystems )" \ - -- "$cur" ) ) - return 0 - ;; - -gid) - _gids - return 0 - ;; - -group) - if [ -n "$bash205" ]; then - COMPREPLY=( $( compgen -g -- $cur 2>/dev/null) ) - fi - return 0 - ;; - -?(x)type) - COMPREPLY=( $( compgen -W 'b c d p f l s' -- "$cur" ) ) - return 0 - ;; - -uid) - _uids - return 0 - ;; - -user) - COMPREPLY=( $( compgen -u -- "$cur" ) ) - return 0 - ;; - -exec|-ok) - COMP_WORDS=(COMP_WORDS[0] "$cur") - COMP_CWORD=1 - _command - return 0 - ;; - -[acm]min|-[acm]time|-?(i)?(l)?(whole)name|-inum|-?(i)path|-?(i)regex| \ - -links|-perm|-size|-used|-printf) - # do nothing, just wait for a parameter to be given - return 0 - ;; + case $prev in + -maxdepth|-mindepth) + COMPREPLY=( $( compgen -W '0 1 2 3 4 5 6 7 8 9' -- "$cur" ) ) + return 0 + ;; + -newer|-anewer|-cnewer|-fls|-fprint|-fprint0|-fprintf|-name|-iname|\ + -lname|-ilname|-wholename|-iwholename|-samefile) + _filedir + return 0 + ;; + -fstype) + _fstypes + if [[ "$( uname -s )" == *BSD ]] ; then + COMPREPLY=( "${COMPREPLY[@]}" \ + $( compgen -W 'local rdonly' -- "$cur" ) ) + fi + return 0 + ;; + -gid) + _gids + return 0 + ;; + -group) + COMPREPLY=( $( compgen -g -- "$cur" 2>/dev/null) ) + return 0 + ;; + -xtype|-type) + COMPREPLY=( $( compgen -W 'b c d p f l s' -- "$cur" ) ) + return 0 + ;; + -uid) + _uids + return 0 + ;; + -user) + COMPREPLY=( $( compgen -u -- "$cur" ) ) + return 0 + ;; + -exec|-execdir|-ok|-okdir) + COMP_WORDS=(COMP_WORDS[0] "$cur") + COMP_CWORD=1 + _command + return 0 + ;; + -[acm]min|-[acm]time|-iname|-lname|-wholename|-iwholename|-lwholename|\ + -ilwholename|-inum|-path|-ipath|-regex|-iregex|-links|-perm|-size|\ + -used|-printf|-context) + # do nothing, just wait for a parameter to be given + return 0 + ;; + -regextype) + COMPREPLY=( $( compgen -W 'emacs posix-awk posix-basic \ + posix-egrep posix-extended' -- "$cur" ) ) + return 0 + ;; esac _expand || return 0 - # set exprfound to 1 if there is already an expression present for i in ${COMP_WORDS[@]}; do [[ "$i" = [-\(\),\!]* ]] && exprfound=1 && break done # handle case where first parameter is not a dash option - if [ "$exprfound" != 1 ] && [[ "$cur" != [-\(\),\!]* ]]; then + if [[ "$exprfound" != 1 && "$cur" != [-\(\),\!]* ]]; then _filedir -d return 0 fi # complete using basic options - COMPREPLY=( $( compgen -W '-daystart -depth -follow -help -maxdepth \ - -mindepth -mount -noleaf -version -xdev -amin -anewer \ - -atime -cmin -cnewer -ctime -empty -false -fstype \ - -gid -group -ilname -iname -inum -ipath -iregex \ - -wholename \ - -links -lname -mmin -mtime -name -newer -nouser \ - -nogroup -perm -regex -size -true -type -uid -used \ - -user -xtype -exec -fls -fprint -fprint0 -fprintf -ok \ - -print -print0 -printf -prune -ls -wholename -iwholename' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '-daystart -depth -follow -help \ + -ignore_readdir_race -maxdepth -mindepth -mindepth -mount \ + -noignore_readdir_race -noleaf -regextype -version -warn -nowarn \ + -xdev \ + -amin -anewer -atime -cmin -cnewer -ctime -empty -executable -false \ + -fstype -gid -group -ilname -iname -inum -ipath -iregex -iwholename \ + -links -lname -mmin -mtime -name -newer -nogroup -nouser -path -perm \ + -readable -regex -samefile -size -true -type -uid -used -user \ + -wholename -writable -xtype -context \ + -delete -exec -execdir -fls -fprint -fprint0 -fprintf -ls -ok -okdir \ + -print -print0 -printf -prune -quit' -- "$cur" ) ) # this removes any options from the list of completions that have # already been specified somewhere on the command line, as long as # these options can only be used once (in a word, "options", in # opposition to "tests" and "actions", as in the find(1) manpage). - onlyonce=' -daystart -depth -follow -help -maxdepth -mindepth -mount \ - -noleaf -version -xdev ' - COMPREPLY=( $( echo "${COMP_WORDS[@]}" | \ + onlyonce=' -daystart -depth -follow -help -ignore_readdir_race -maxdepth \ + -mindepth -mount -noignore_readdir_race -noleaf -nowarn -regextype \ + -version -warn -xdev ' + COMPREPLY=( $( \ (while read -d ' ' i; do - [ "$i" == "" ] || - [ "${onlyonce/ ${i%% *} / }" == "$onlyonce" ] && + [[ -z "$i" || "${onlyonce/ ${i%% *} / }" == "$onlyonce" ]] && continue # flatten array with spaces on either side, # otherwise we cannot grep on word boundaries of @@ -104,14 +110,14 @@ # remove word from list of completions COMPREPLY=( ${COMPREPLY/ ${i%% *} / } ) done - echo "${COMPREPLY[@]}") + printf '%s ' "${COMPREPLY[@]}") <<<"${COMP_WORDS[@]}" ) ) _filedir return 0 } && -complete -F _find $filenames find +complete -F _find -o filenames find # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/freeciv bash-completion-1.2/contrib/freeciv --- bash-completion-1.1/contrib/freeciv 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/freeciv 2010-06-13 11:21:19.000000000 +0100 @@ -1,4 +1,4 @@ -# civserver completion by Guillaume Rousse +# freeciv completions have civserver && _civserver() @@ -6,11 +6,10 @@ 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)) + case $prev in + -f|-g|-l|-r|--file|--log|--gamelog|--read) _filedir return 0 ;; @@ -25,27 +24,24 @@ } && complete -F _civserver civserver -# civclient completion by Guillaume Rousse -# have civclient && _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)) + case $prev in + -l|-S|-t|--log|--Sound|--tiles) _filedir return 0 ;; - -@(P|-Plugin)) + -P|--Plugin) COMPREPLY=( $( compgen -W 'none esd sdl' -- "$cur" ) ) return 0 ;; - -@(s|-server)) + -s|--server) _known_hosts_real "$cur" return 0 ;; diff -Nru bash-completion-1.1/contrib/fuse bash-completion-1.2/contrib/fuse --- bash-completion-1.1/contrib/fuse 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/fuse 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,36 @@ +# bash completion for fuse + +have fusermount && +_fusermount() +{ + COMPREPLY=() + local cur prev + _get_comp_words_by_ref cur prev + + case $prev in + -h|-V|-o) + return 0 + ;; + -u) + COMPREPLY=( $( compgen -W "$( awk \ + '{ if ($3 ~ /^fuse\./) print $2 }' /etc/mtab 2>/dev/null )" \ + -- "$cur" ) ) + return 0 + ;; + esac + + if [[ "$cur" == -* ]] ; then + COMPREPLY=( $( compgen -W '-h -V -o -u -q -z' -- "$cur" ) ) + else + _filedir -d + fi +} && +complete -F _fusermount -o filenames fusermount + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/gcc bash-completion-1.2/contrib/gcc --- bash-completion-1.1/contrib/gcc 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/gcc 2010-06-13 11:21:19.000000000 +0100 @@ -14,11 +14,11 @@ local cur cc backend COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur _expand || return 0 - case "$1" in + case $1 in gcj) backend=jc1 ;; @@ -46,9 +46,9 @@ _filedir fi } && -complete $filenames -F _gcc gcc g++ c++ g77 gcj gpc +complete -o filenames -F _gcc gcc g++ c++ g77 gcj gpc [ $USERLAND = GNU -o $UNAME = Cygwin ] && \ -[ -n "${have:-}" ] && complete $filenames -F _gcc cc +[ -n "${have:-}" ] && complete -o filenames -F _gcc cc # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/gcl bash-completion-1.2/contrib/gcl --- bash-completion-1.1/contrib/gcl 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/gcl 2010-06-13 11:21:19.000000000 +0100 @@ -7,7 +7,7 @@ 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 @@ -19,7 +19,7 @@ return 0 } && -complete -F _gcl $default gcl +complete -F _gcl -o default gcl # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/gdb bash-completion-1.2/contrib/gdb --- bash-completion-1.1/contrib/gdb 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/gdb 2010-06-13 11:21:19.000000000 +0100 @@ -6,8 +6,7 @@ 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 @@ -20,7 +19,8 @@ # functions and aliases. Thus we need to retrieve the program # names manually. IFS=":" - local path_array=( $(echo "$PATH" | sed 's/::\+/:/g;s/^:\|:$//g') ) + local path_array=( $( \ + sed -e 's/:\{2,\}/:/g' -e 's/^://' -e 's/:$//' <<<"$PATH" ) ) IFS=$'\n' COMPREPLY=( $( compgen -d -W '$(find "${path_array[@]}" . \ -mindepth 1 -maxdepth 1 -not -type d -executable \ @@ -32,7 +32,7 @@ awk '{if ($1 ~ /^'"$prev"'/) print $2}' )" -- "$cur" ) ) fi } && -complete -F _gdb $default gdb +complete -F _gdb -o default gdb # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/genisoimage bash-completion-1.2/contrib/genisoimage --- bash-completion-1.1/contrib/genisoimage 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/genisoimage 2010-06-13 11:21:19.000000000 +0100 @@ -6,11 +6,11 @@ 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|root-info|prep-boot|*-list)) + case $prev in + -o|-abstract|-biblio|-check-session|-copyright|-log-file| \ + -root-info|-prep-boot|-*-list) _filedir return 0 ;; @@ -30,30 +30,28 @@ esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-abstract -A -allow-lowercase \ - -allow-multidot -biblio -cache-inodes \ - -no-cache-inodes -b -eltorito-alt-boot -B -G \ - -hard-disk-boot -no-emul-boot -no-boot \ - -boot-load-seg -boot-load-size \ - -boot-info-table -C -c -check-oldname \ - -check-session -copyright -d -D -dir-mode \ - -dvd-video -f -file-mode -gid -gui \ - -graft-points -hide -hide-list -hidden \ - -hidden-list -hide-joliet -hide-joliet-list \ - -hide-joliet-trans-tbl -hide-rr-moved \ - -input-charset -output-charset -iso-level -J \ - -joliet-long -jcharset -l -L -log-file -m \ - -exclude-list -max-iso9660-filenames -M -N \ - -new-dir-mode -nobak -no-bak -force-rr -no-rr \ - -no-split-symlink-components \ - -no-split-symlink-fields -o -pad -no-pad \ - -path-list -P -p -print-size -quiet -R -r \ - -relaxed-filenames -sort -split-output \ - -stream-media-size -stream-file-name -sysid -T\ - -table-name -ucs-level -udf -uid \ - -use-fileversion -U -no-iso-translate -V \ - -volset -volset-size -volset-seqno -v -x -z \ - -hfs -apple -map -magic -hfs-creator \ + COMPREPLY=( $( compgen -W '-abstract -appid -allow-lowercase \ + -allow-multidot -biblio -cache-inodes -no-cache-inodes \ + -eltorito-boot -eltorito-alt-boot -sparc-boot -generic-boot \ + -hard-disk-boot -no-emul-boot -no-boot -boot-load-seg \ + -boot-load-size -boot-info-table -cdrecord-params \ + -eltorito-catalog -check-oldname -check-session -copyright \ + -omit-period -disable-deep-relocation -dir-mode -dvd-video \ + -follow-links -file-mode -gid -gui -graft-points -hide -hide-list \ + -hidden -hidden-list -hide-joliet -hide-joliet-list \ + -hide-joliet-trans-tbl -hide-rr-moved -input-charset \ + -output-charset -iso-level -joliet -joliet-long -jcharset \ + -full-iso9660-filenames -allow-leading-dots -log-file -exclude \ + -exclude-list -max-iso9660-filenames -prev-session \ + -omit-version-number -new-dir-mode -nobak -no-bak -force-rr -no-rr \ + -no-split-symlink-components -no-split-symlink-fields -output -pad \ + -no-pad -path-list -publisher -preparer -print-size -quiet -rock + -rational-rock -relaxed-filenames -sort -split-output \ + -stream-media-size -stream-file-name -sysid -translation-table \ + -table-name -ucs-level -udf -uid -use-fileversion \ + -untranslated-filenames -no-iso-translate -volid -volset \ + -volset-size -volset-seqno -verbose -old-exclude \ + -transparent-compression -hfs -apple -map -magic -hfs-creator \ -hfs-type -probe -no-desktop -mac-name \ -boot-hfs-file -part -auto -cluster-size \ -hide-hfs -hide-hfs-list -hfs-volid \ @@ -68,7 +66,7 @@ fi } && -complete -F _mkisofs $filenames mkisofs genisoimage +complete -F _mkisofs -o filenames mkisofs genisoimage # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/getent bash-completion-1.2/contrib/getent --- bash-completion-1.1/contrib/getent 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/getent 2010-06-13 11:21:19.000000000 +0100 @@ -6,8 +6,7 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in passwd) @@ -27,13 +26,13 @@ return 0 ;; protocols|networks|ahosts|ahostsv4|ahostsv6|rpc) - COMPREPLY=( $( getent "$prev" | \ - sed -ne 's|^\('"$cur"'[^[:space:]]*\).*|\1|p' ) ) + COMPREPLY=( $( compgen -W "$( getent "$prev" | \ + awk '{ print $1 }' )" -- "$cur" ) ) return 0 ;; aliases|shadow) - COMPREPLY=( $( getent "$prev" | \ - sed -ne 's|^\('"$cur"'[^:]*\).*|\1|p' ) ) + COMPREPLY=( $( compgen -W "$( getent "$prev" | cut -d: -f1 )" \ + -- "$cur" ) ) return 0 ;; esac diff -Nru bash-completion-1.1/contrib/gkrellm bash-completion-1.2/contrib/gkrellm --- bash-completion-1.1/contrib/gkrellm 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/gkrellm 2010-06-13 11:21:19.000000000 +0100 @@ -1,4 +1,4 @@ -# gkrellm(1) completion by Guillaume Rousse +# gkrellm(1) completion have gkrellm || have gkrellm2 && _gkrellm() @@ -6,32 +6,44 @@ 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)) + case $prev in + -t|--theme) _filedir -d return 0 ;; - -@(p|-plugin)) - _filedir 'so' + -p|--plugin) + _filedir so return 0 ;; - -@(s|-server)) + -s|--server) _known_hosts_real "$cur" return 0 ;; + -l|--logfile) + _filedir + return 0 + ;; + -g|--geometry|-c|--config|-P|--port|-d|--debug-level) + # Argument required but no completions available + return 0 + ;; + -h|--help|-v|--version) + # All other options are noop with these + return 0 + ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help -t --theme -s --server \ - -g --geometry -wm -w --withdrawn -c --config -nc \ - -f --force-host-config -demo -p --plugin -P --port' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--theme --geometry --wm --m2 --nt \ + --withdrawn --config --force-host-config --server --port --nc \ + --config-clean --nolock --plugin --demo --logfile --version \ + --debug-level --help' -- "$cur" ) ) fi } && -complete -F _gkrellm gkrellm gkrellm2 +complete -F _gkrellm -o filenames gkrellm gkrellm2 # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/gnatmake bash-completion-1.2/contrib/gnatmake --- bash-completion-1.1/contrib/gnatmake 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/gnatmake 2010-06-13 11:21:19.000000000 +0100 @@ -6,7 +6,7 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then # relevant (and less relevant ;-) )options completion @@ -26,7 +26,7 @@ _filedir '@(adb|ads)' fi } && -complete -F _gnatmake $filenames gnatmake +complete -F _gnatmake -o filenames gnatmake # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/gpg bash-completion-1.2/contrib/gpg --- bash-completion-1.1/contrib/gpg 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/gpg 2010-06-13 11:21:19.000000000 +0100 @@ -6,21 +6,21 @@ 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)) + case $prev in + -s|--sign|--clearsign|--decrypt-files|--load-extension) _filedir return 0 ;; - --@(export|@(?(l|nr|nrl)sign|edit)-key)) + --export|--sign-key|--lsignkey|--nrsignkey|--nrlsignkey|--editkey) # return list of public keys COMPREPLY=( $( compgen -W "$( gpg --list-keys 2>/dev/null | \ - sed -ne 's@^pub.*/\([^ ]*\).*$@\1@p;s@^.*\(<\([^>]*\)>\).*$@\2@p')" -- "$cur" )) + sed -ne 's@^pub.*/\([^ ]*\).*$@\1@p' \ + -ne 's@^.*\(<\([^>]*\)>\).*$@\2@p' )" -- "$cur" ) ) return 0 ;; - -@(r|-recipient)) + -r|--recipient) COMPREPLY=( $( compgen -W "$( gpg --list-keys 2>/dev/null | \ sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" )) if [ -e ~/.gnupg/gpg.conf ]; then @@ -33,12 +33,11 @@ esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-s -b -e -f -c -d -a -r -u -Z -o -v\ - -q -n -N $(gpg --dump-options)' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '$(gpg --dump-options)' -- "$cur" ) ) fi } && -complete -F _gpg $default gpg +complete -F _gpg -o default gpg # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/gpg2 bash-completion-1.2/contrib/gpg2 --- bash-completion-1.1/contrib/gpg2 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/gpg2 2010-06-13 11:21:19.000000000 +0100 @@ -6,25 +6,25 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in --homedir) _filedir -d return 0 ;; - -@(s|-sign|-clearsign|-options|-decrypt)) + -s|--sign|--clearsign|--options|--decrypt) _filedir return 0 ;; - --@(export|@(?(l|nr|nrl)sign|edit)-key)) + --export|--sign-key|--lsign-key|--nrsign-key|--nrlsign-key|--edit-key) # return list of public keys COMPREPLY=( $( compgen -W "$( gpg2 --list-keys 2>/dev/null | \ - sed -ne 's@^pub.*/\([^ ]*\).*$@\1@p;s@^.*\(<\([^>]*\)>\).*$@\2@p')" -- "$cur" )) + sed -ne 's@^pub.*/\([^ ]*\).*$@\1@p' \ + -ne 's@^.*\(<\([^>]*\)>\).*$@\2@p' )" -- "$cur" ) ) return 0 ;; - -@(r|-recipient)) + -r|--recipient) COMPREPLY=( $( compgen -W "$( gpg2 --list-keys 2>/dev/null | \ sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" )) if [ -e ~/.gnupg/gpg.conf ]; then @@ -37,11 +37,10 @@ esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-s -b -e -c -d -k -K -a -r -u -z -o -v \ - -n -N -i -h -R -t $(gpg2 --dump-options)' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '$(gpg2 --dump-options)' -- "$cur" ) ) fi } && -complete -F _gpg2 $default gpg2 +complete -F _gpg2 -o default gpg2 } # Local variables: diff -Nru bash-completion-1.1/contrib/gzip bash-completion-1.2/contrib/gzip --- bash-completion-1.1/contrib/gzip 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/gzip 2010-06-13 11:21:19.000000000 +0100 @@ -1,23 +1,29 @@ # bash completion for gzip -have gzip && +have gzip || have pigz && _gzip() { local cur prev xspec helpopts COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} - helpopts=`_parse_help gzip` + _get_comp_words_by_ref cur prev + helpopts=`_parse_help ${COMP_WORDS[0]}` + + case $prev in + -b|--blocksize|-p|--processes|-S|--suffix|-h|--help|-V|--version) + return 0 + ;; + esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$helpopts -2 -3 -4 -5 -6 -7 -8" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "$helpopts -1 -2 -3 -4 -5 -6 -7 -8 -9" \ + -- "$cur" ) ) return 0 fi local IFS=$'\t\n' - xspec="*.?(t)gz" + xspec="*.@(gz|t[ag]z)" if [[ "$prev" == --* ]]; then [[ "$prev" == --decompress || \ "$prev" == --list || \ @@ -26,7 +32,7 @@ elif [[ "$prev" == -* ]]; then [[ "$prev" == -*[dlt]* ]] && xspec="!"$xspec [[ "$prev" == -*f* ]] && xspec= - elif [ "$prev" = '>' -o "$prev" = '>>' ]; then + elif [[ "$prev" == '>' || "$prev" == '>>' ]]; then xspec= elif [ "$prev" = '<' ]; then xspec= @@ -37,7 +43,7 @@ COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ $( compgen -d -- "$cur" ) ) } && -complete -F _gzip $filenames gzip +complete -F _gzip -o filenames gzip pigz # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/heimdal bash-completion-1.2/contrib/heimdal --- bash-completion-1.1/contrib/heimdal 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/heimdal 2010-06-13 11:21:19.000000000 +0100 @@ -12,7 +12,7 @@ { COMPREPLY=( $( compgen -W "( kadmin -l dump 2>/dev/null | \ - awk '{print $1}' | awk -F @ '{print $2}' )" -- "$cur" ) ) + awk '{print $1}' | awk -F@ '{print $2}' )" -- "$cur" ) ) } _heimdal_encodings() @@ -28,8 +28,7 @@ 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 @@ -50,7 +49,7 @@ _heimdal_realms return 0 ;; - -@(s|k|-@(srv|key)tab)) + -s|-k|--srvtab|--keytab) _filedir return 0 ;; @@ -63,7 +62,7 @@ for (( i=1; i < COMP_CWORD; i++ )); do case ${COMP_WORDS[i]} in - -@(k|-keytab)) + -k|--keytab) i=$(($i+1)) ;; -*) @@ -97,7 +96,7 @@ purge) options='--age' ;; - @(srv2keytab|key2srvtab)) + srv2keytab|key2srvtab) options='-s --srvtab' ;; *) diff -Nru bash-completion-1.1/contrib/hping2 bash-completion-1.2/contrib/hping2 --- bash-completion-1.1/contrib/hping2 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/hping2 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,55 @@ +# bash completion for hping2 + +have hping2 && +_hping2() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=`_get_pword` + + case $prev in + -I|--interface) + _available_interfaces + return 0 + ;; + -a|--spoof) + _known_hosts_real "$cur" + return 0 + ;; + -o|--tos) + COMPREPLY=( $( compgen -W '02 04 08 10' ) ) + return 0 + ;; + -E|--file) + _filedir + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--help --version --count --interval --fast \ + --faster --numeric --quiet --interface --verbose --debug --bind \ + --unbind --rawip --icmp --upd --scan --listen --spoof \ + --rand-source --rand-dest --ttl --id --ipproto --winid -rel --frag \ + --morefrag --dontfrag --fragoff --mtu --tos --rroute --icmptype \ + --icmpcode --icmp-ipver --icmp-iphlen --icmp-iplen --icmp-ipid \ + --icmp-ipproto --icmp-cksum --icmp-ts --icmp-addr --baseport \ + --destport --keep --win --tcpoff --tcpseq --tcpack --seqnum \ + --badcksum --tcp-timestamp --fin --syn --rst --push --ack --urg \ + --xmas --ymas --data --file --sign --dump --print --safe --end \ + --traceroute --tr-keep-ttl --tr-stop --tr-no-rtt' -- "$cur" ) ) + else + _known_hosts_real "$cur" + fi +} && +complete -F _hping2 hping2 hping + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/iconv bash-completion-1.2/contrib/iconv --- bash-completion-1.1/contrib/iconv 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/iconv 2010-06-13 11:21:19.000000000 +0100 @@ -3,28 +3,41 @@ have iconv && _iconv() { - local cur prev + local cur prev split=false COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - -@(f|t|-@(from|to)-code)) - COMPREPLY=( $( compgen -W \ - '$( iconv --list | sed -e "s@//@@;" )' -- "$cur" ) ) + _split_longopt && split=true + + case $prev in + -'?'|--help|--usage|-V|--version|--unicode-subst|--byte-subst|\ + --widechar-subst) + return 0 + ;; + -f|--from-code|-t|--to-code) + COMPREPLY=( $( compgen -W '$( iconv -l | \ + sed -e "s@/*\$@@" -e "s/[,()]//g" )' -- "$cur" ) ) + return 0 + ;; + -o|--output) + _filedir return 0 ;; esac + $split && return 0 if [[ "$cur" = -* ]]; then - COMPREPLY=( $( compgen -W '--from-code -f --to-code -t --list - --output -o --verbose' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--from-code --to-code --list -c + --unicode-subst --byte-subst --widechar-subst --output --silent + --verbose --help --usage --version' -- "$cur" ) ) return 0 fi } && -complete -F _iconv $default iconv +complete -F _iconv -o default iconv +# Intentionally not -o filenames here, -f/-t completions may contain slashes +# and -o filenames would break them. # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/ifupdown bash-completion-1.2/contrib/ifupdown --- bash-completion-1.1/contrib/ifupdown 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/ifupdown 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,27 @@ +# Red Hat & Debian GNU/Linux if{up,down} completion +# +[ $USERLAND = GNU ] && { have ifup || have ifdown; } && +_ifupdown() +{ + local cur + + COMPREPLY=() + _get_comp_words_by_ref cur + + if [ $COMP_CWORD -eq 1 ]; then + _configured_interfaces + COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") ) + fi + + return 0 +} && +complete -F _ifupdown ifup ifdown +[ $USERLAND = GNU ] && have ifstatus && complete -F _ifupdown ifstatus + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/imagemagick bash-completion-1.2/contrib/imagemagick --- bash-completion-1.1/contrib/imagemagick 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/imagemagick 2010-06-13 11:21:19.000000000 +0100 @@ -3,10 +3,10 @@ have convert && { _ImageMagick() { - local prev - prev=${COMP_WORDS[COMP_CWORD-1]} + local cur prev + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -channel) COMPREPLY=( $( compgen -W 'Red Green Blue Opacity \ Matte Cyan Magenta Yellow Black' -- "$cur" ) ) @@ -103,7 +103,7 @@ Wave OilPaint CharcoalDrawing JPEG' -- "$cur" ) ) return 0 ;; - -@(mask|profile|texture|tile|write)) + -mask|-profile|-texture|-tile|-write) _filedir return 0 ;; @@ -135,7 +135,7 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur _ImageMagick @@ -189,14 +189,14 @@ _filedir fi } -complete -F _convert $filenames convert +complete -F _convert -o filenames convert _mogrify() { local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur _ImageMagick @@ -245,14 +245,14 @@ _filedir fi } -complete -F _mogrify $filenames mogrify +complete -F _mogrify -o filenames mogrify _display() { local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur _ImageMagick @@ -285,14 +285,14 @@ _filedir fi } -complete -F _display $filenames display +complete -F _display -o filenames display _animate() { local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur _ImageMagick @@ -319,14 +319,14 @@ _filedir fi } -complete -F _animate $filenames animate +complete -F _animate -o filenames animate _identify() { local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur _ImageMagick @@ -344,14 +344,14 @@ _filedir fi } -complete -F _identify $filenames identify +complete -F _identify -o filenames identify _montage() { local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur _ImageMagick @@ -382,14 +382,14 @@ _filedir fi } -complete -F _montage $filenames montage +complete -F _montage -o filenames montage _composite() { local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur _ImageMagick @@ -417,14 +417,14 @@ _filedir fi } -complete -F _composite $filenames composite +complete -F _composite -o filenames composite _compare() { local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur _ImageMagick @@ -444,14 +444,14 @@ _filedir fi } -complete -F _compare $filenames compare +complete -F _compare -o filenames compare _conjure() { local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur _ImageMagick @@ -464,14 +464,14 @@ _filedir fi } -complete -F _conjure $filenames conjure +complete -F _conjure -o filenames conjure _import() { local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur _ImageMagick @@ -495,14 +495,14 @@ _filedir fi } -complete -F _import $filenames import +complete -F _import -o filenames import _stream() { local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur _ImageMagick @@ -520,7 +520,7 @@ _filedir fi } -complete -F _stream $filenames stream +complete -F _stream -o filenames stream } # Local variables: diff -Nru bash-completion-1.1/contrib/info bash-completion-1.2/contrib/info --- bash-completion-1.1/contrib/info 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/info 2010-06-13 11:21:19.000000000 +0100 @@ -6,7 +6,7 @@ local cur i infopath COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur _expand || return 0 @@ -47,7 +47,7 @@ return 0 } && -complete -F _info $filenames info +complete -F _info -o filenames info # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/ipmitool bash-completion-1.2/contrib/ipmitool --- bash-completion-1.1/contrib/ipmitool 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/ipmitool 2010-06-13 11:21:19.000000000 +0100 @@ -6,10 +6,9 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -I) COMPREPLY=( $( compgen -W 'open imb lan lanplus free' -- "$cur" ) ) return 0 diff -Nru bash-completion-1.1/contrib/ipsec bash-completion-1.2/contrib/ipsec --- bash-completion-1.1/contrib/ipsec 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/ipsec 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,51 @@ +# Linux ipsec(8) completion (for FreeS/WAN) +# +[ $UNAME = Linux ] && have ipsec && +_ipsec() +{ + local cur + + COMPREPLY=() + _get_comp_words_by_ref cur + + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=( $( compgen -W 'auto barf eroute klipsdebug look manual \ + pluto ranbits rsasigkey setup showdefaults showhostkey spi spigrp \ + tncfg whack' -- "$cur" ) ) + return 0 + fi + + case ${COMP_WORDS[1]} in + auto) + COMPREPLY=( $( compgen -W '--asynchronous --up --add --delete \ + --replace --down --route --unroute \ + --ready --status --rereadsecrets' \ + -- "$cur" ) ) + ;; + manual) + COMPREPLY=( $( compgen -W '--up --down --route --unroute \ + --union' -- "$cur" ) ) + ;; + ranbits) + COMPREPLY=( $( compgen -W '--quick --continuous --bytes' \ + -- "$cur" ) ) + ;; + setup) + COMPREPLY=( $( compgen -W '--start --stop --restart' -- "$cur" ) ) + ;; + *) + ;; + esac + + return 0 +} && +complete -F _ipsec ipsec + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/iptables bash-completion-1.2/contrib/iptables --- bash-completion-1.1/contrib/iptables 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/iptables 2010-06-13 11:21:19.000000000 +0100 @@ -6,9 +6,8 @@ local cur prev table chain COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} - chain='s/^Chain \([^ ]\+\).*$/\1/p' + _get_comp_words_by_ref cur prev + chain='s/^Chain \([^ ]\{1,\}\).*$/\1/p' if [[ $COMP_LINE == *-t\ *filter* ]]; then table="-t filter" @@ -20,16 +19,16 @@ _split_longopt - case "$prev" in + case $prev in -*[AIDRPFXLZ]) COMPREPLY=( $( compgen -W '`iptables $table -nL | \ - sed -ne "s/^Chain \([^ ]\+\).*$/\1/p"`' -- "$cur" ) ) + sed -ne "s/^Chain \([^ ]\{1,\}\).*$/\1/p"`' -- "$cur" ) ) ;; -*t) COMPREPLY=( $( compgen -W 'nat filter mangle' -- "$cur" ) ) ;; -j) - if [ "$table" = "-t filter" -o "$table" = "" ]; then + if [[ "$table" == "-t filter" || -z "$table" ]]; then COMPREPLY=( $( compgen -W 'ACCEPT DROP LOG ULOG REJECT \ `iptables $table -nL | sed -ne "$chain" \ -e "s/INPUT|OUTPUT|FORWARD|PREROUTING|POSTROUTING//"`' -- \ @@ -48,7 +47,8 @@ ;; *) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-i -o -s -d -p -f -m --append \ + COMPREPLY=( $( compgen -W '--in-interface --out-interface --source \ + --destination --protocol --fragment --match --append \ --delete --insert --replace --list --flush --zero --new \ --delete-chain --policy --rename-chain --proto --source \ --destination --in-interface --jump --match --numeric \ diff -Nru bash-completion-1.1/contrib/ipv6calc bash-completion-1.2/contrib/ipv6calc --- bash-completion-1.1/contrib/ipv6calc 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/ipv6calc 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,57 @@ +have ipv6calc && +_ipv6calc() +{ + local cur prev split=false + + COMPREPLY=() + _get_comp_words_by_ref -n = cur prev + #cur=`_get_cword =` + #prev=`_get_pword` + + _split_longopt && split=true + + case "$prev" in + -d|--debug) + return 0 + ;; + -I|--in|-O|--out|-A|--action) + # With ipv6calc < 0.73.0, -m does nothing here, so use sed instead. + COMPREPLY=( $( compgen -W "$( ipv6calc "$prev" -h 2>&1 | \ + sed -ne 's/^[[:space:]]\{1,\}\([^[:space:]:]\{1,\}\)[[:space:]]*:.*/\1/p' )" \ + -- "$cur" ) ) + return 0 + ;; + --db-geoip|--db-ip2location-ipv4|--db-ip2location-ipv6) + _filedir + return 0 + ;; + --printstart|--printend) + return 0 + ;; + esac + + $split && return 0 + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--help --debug --quiet --in \ + --out --action --examples --showinfo --show_types \ + --machine_readable --db-geoip --db-geoip-default \ + --db-ip2location-ipv4 --db-ip2location-ipv6 \ + --lowercase --uppercase --printprefix --printsuffix \ + --maskprefix --masksuffix --printstart --printend \ + --printcompressed --printuncompressed \ + --printfulluncompressed --printmirrored' -- "$cur" ) ) + return 0 + fi + + return 0 +} && +complete -F _ipv6calc -o filenames ipv6calc + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/isql bash-completion-1.2/contrib/isql --- bash-completion-1.1/contrib/isql 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/isql 2010-06-13 11:21:19.000000000 +0100 @@ -4,10 +4,10 @@ _isql() { local cur - cur=`_get_cword` + _get_comp_words_by_ref cur [ -f "$ODBCINI" ] \ - && COMPREPLY=( $( grep \\["$cur" "$ODBCINI" | tr -d \\[\\] ) ) + && COMPREPLY=( $( command grep \\["$cur" "$ODBCINI" | tr -d \\[\\] ) ) } && complete -F _isql isql diff -Nru bash-completion-1.1/contrib/jar bash-completion-1.2/contrib/jar --- bash-completion-1.1/contrib/jar 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/jar 2010-06-13 11:21:19.000000000 +0100 @@ -6,14 +6,14 @@ 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" ) ) return 0 fi - case "${COMP_WORDS[1]}" in + case ${COMP_WORDS[1]} in *c*f) _filedir ;; @@ -25,7 +25,7 @@ ;; esac } && -complete -F _jar $filenames jar +complete -F _jar -o filenames jar # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/java bash-completion-1.2/contrib/java --- bash-completion-1.1/contrib/java 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/java 2010-06-13 11:21:19.000000000 +0100 @@ -60,23 +60,22 @@ cur=${cur//.//} # parse each classpath element for classes for i in ${classpath//:/ }; do - if [ -r $i ] && [[ "$i" == *.@(jar|zip) ]]; then + if [[ -r $i && "$i" == *.@(jar|zip) ]]; then if type zipinfo &>/dev/null; then COMPREPLY=( "${COMPREPLY[@]}" $( zipinfo -1 \ "$i" "$cur*" 2>/dev/null | \ - grep '^[^$]*\.class$' ) ) + command grep '^[^$]*\.class$' ) ) else COMPREPLY=( "${COMPREPLY[@]}" $( jar tf "$i" \ - "$cur" | grep '^[^$]*\.class$' ) ) + "$cur" | command grep '^[^$]*\.class$' ) ) fi elif [ -d $i ]; then - i=${i%/} - - # See Debian bug #496828 - COMPREPLY=( "${COMPREPLY[@]}" $( find "$i" -type f \ - -maxdepth 1 -path "$i/$cur*.class" 2>/dev/null | \ - grep -v "\\$" | sed -e "s|^$i/||" ) ) + # Intentionally looking for *.class only in $i (not subdirs), + # see Debian bug #496828. + COMPREPLY=( "${COMPREPLY[@]}" + $( command ls $i/$cur*.class 2>/dev/null | \ + sed -ne '/\$/d' -e "s|^$i//*||p" ) ) # FIXME: if we have foo.class and foo/, the completion # returns "foo/"... how to give precedence to files @@ -108,7 +107,7 @@ fi done # keep only packages - COMPREPLY=( $( echo "${COMPREPLY[@]}" | tr " " "\n" | grep "/$" ) ) + COMPREPLY=( $( tr " " "\n" <<<"${COMPREPLY[@]}" | command grep "/$" ) ) # remove packages extension COMPREPLY=( ${COMPREPLY[@]%/} ) # convert path syntax to package syntax @@ -122,27 +121,26 @@ 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 -cp|-classpath) - ((i++)) # skip the classpath string. - ;; + ((i++)) # skip the classpath string. + ;; -*) - # this is an option, not a class/jarfile name. - ;; + # this is an option, not a class/jarfile name. + ;; *) - # once we've seen a class, just do filename completion - _filedir - return 0 - ;; + # once we've seen a class, just do filename completion + _filedir + return 0 + ;; esac done case $prev in - -@(cp|classpath)) + -cp|-classpath) _java_path return 0 ;; @@ -151,12 +149,11 @@ if [[ "$cur" == -* ]]; then # relevant options completion COMPREPLY=( $( compgen -W '-client -hotspot -server -classic \ - -cp -classpath -D -verbose -verbose:class \ + -classpath -D -verbose -verbose:class \ -verbose:gc -version:jni -version \ - -showversion -? -help -X -jar \ - -ea -enableassertions -da -disableassertions \ - -esa -enablesystemassertions \ - -dsa -disablesystemassertions ' -- "$cur" ) ) + -showversion -help -X -jar \ + -enableassertions -disableassertions \ + -enablesystemassertions -disablesystemassertions ' -- "$cur" ) ) else if [[ "$prev" == -jar ]]; then # jar file completion @@ -167,20 +164,19 @@ fi fi } -complete -F _java $filenames java +complete -F _java -o filenames java } have javadoc && _javadoc() { COMPREPLY=() - local cur prev + 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)) + -overview|-helpfile|-stylesheetfile) _filedir return 0 ;; @@ -188,7 +184,7 @@ _filedir -d return 0 ;; - -@(classpath|bootclasspath|docletpath|sourcepath|extdirs)) + -classpath|-bootclasspath|-docletpath|-sourcepath|-extdirs) _java_path return 0 ;; @@ -216,7 +212,7 @@ _java_packages fi } && -complete -F _javadoc $filenames javadoc +complete -F _javadoc -o filenames javadoc have javac && _javac() @@ -224,15 +220,14 @@ COMPREPLY=() local cur prev - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in -d) _filedir -d return 0 ;; - -@(classpath|bootclasspath|sourcepath|extdirs)) + -classpath|-bootclasspath|-sourcepath|-extdirs) _java_path return 0 ;; @@ -240,16 +235,185 @@ if [[ "$cur" == -* ]]; then # relevant options completion - COMPREPLY=( $( compgen -W '-g -g:none -g:lines -g:vars\ - -g:source -O -nowarn -verbose -deprecation -classpath\ - -sourcepath -bootclasspath -extdirs -d -encoding -source\ + COMPREPLY=( $( compgen -W '-g -g:none -g:lines -g:vars \ + -g:source -O -nowarn -verbose -deprecation -classpath \ + -sourcepath -bootclasspath -extdirs -d -encoding -source \ -target -help' -- "$cur" ) ) else # source files completion _filedir java fi } && -complete -F _javac $filenames javac +complete -F _javac -o filenames javac + +have pack200 && +_pack200() +{ + COMPREPLY=() + local cur prev + _get_comp_words_by_ref cur prev + + case $prev in + -S|--segment-limit|-P|--pass-file|-C|--class-attribute|\ + -F|--field-attribute|-M|--method-attribute|-D|--code-attribute|\ + '-?'|-h|--help|-V|--version|-J) + return 0 + ;; + -E|--effort) + COMPREPLY=( $( compgen -W '0 1 2 3 4 5 6 7 8 9' -- "$cur" ) ) + return 0 + ;; + -H|--deflate-hint) + COMPREPLY=( $( compgen -W 'true false keep' -- "$cur" ) ) + return 0 + ;; + -m|--modification-time) + COMPREPLY=( $( compgen -W 'latest keep' -- "$cur" ) ) + return 0 + ;; + -U|--unknown-attribute) + COMPREPLY=( $( compgen -W 'error strip pass' -- "$cur" ) ) + return 0 + ;; + -f|--config-file) + _filedir properties + return 0 + ;; + -l|--log-file) + COMPREPLY=( $( compgen -W '-' -- "$cur" ) ) + _filedir log + return 0 + ;; + esac + + # Check if a pack or a jar was already given. + local i pack=false jar=false + for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )) ; do + case ${COMP_WORDS[i]} in + *.pack|*.pack.gz) pack=true ;; + *.jar) jar=true ;; + esac + done + + if ! $pack ; then + if [[ "$cur" == -* ]] ; then + COMPREPLY=( $( compgen -W '--no-gzip --gzip --strip-debug \ + --no-keep-file-order --segment-limit= --effort= \ + --deflate-hint= --modification-time= --pass-file= \ + --unknown-attribute= --class-attribute= --field-attribute= \ + --method-attribute= --code-attribute= --config-file= \ + --verbose --quiet --log-file= --help --version -J' -- "$cur" ) ) + [[ ${#COMPREPLY[@]} -eq 1 && ${COMPREPLY[0]} == *= ]] && \ + type compopt &>/dev/null && compopt -o nospace + else + _filedir 'pack?(.gz)' + fi + elif ! $jar ; then + _filedir jar + fi +} && +complete -F _pack200 pack200 + +have unpack200 && +_unpack200() +{ + COMPREPLY=() + local cur prev + _get_comp_words_by_ref cur prev + + case $prev in + '-?'|-h|--help|-V|--version|-J) + return 0 + ;; + -H|--deflate-hint) + COMPREPLY=( $( compgen -W 'true false keep' -- "$cur" ) ) + return 0 + ;; + -l|--log-file) + COMPREPLY=( $( compgen -W '-' -- "$cur" ) ) + _filedir log + return 0 + ;; + esac + + # Check if a pack or a jar was already given. + local i pack=false jar=false + for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )) ; do + case ${COMP_WORDS[i]} in + *.pack|*.pack.gz) pack=true ;; + *.jar) jar=true ;; + esac + done + + if ! $pack ; then + if [[ "$cur" == -* ]] ; then + COMPREPLY=( $( compgen -W '--deflate-hint= --remove-pack-file \ + --verbose --quiet --log-file= --help --version' -- "$cur" ) ) + [[ ${#COMPREPLY[@]} -eq 1 && ${COMPREPLY[0]} == *= ]] && \ + type compopt &>/dev/null && compopt -o nospace + else + _filedir 'pack?(.gz)' + fi + elif ! $jar ; then + _filedir jar + fi +} && +complete -F _unpack200 unpack200 + +have jarsigner && +_jarsigner() +{ + COMPREPLY=() + local cur prev + _get_comp_words_by_ref cur prev + + case $prev in + -keystore) + COMPREPLY=( $( compgen -W 'NONE' -- "$cur" ) ) + _filedir '@(jks|ks|p12|pfx)' + return 0 + ;; + -storepass|-keypass|-sigfile|-digestalg|-sigalg|-tsacert|-altsigner|\ + -altsignerpath|-providerName|-providerClass|-providerArg) + return 0 + ;; + -storetype) + COMPREPLY=( $( compgen -W 'JKS PKCS11 PKCS12' -- "$cur" ) ) + return 0 + ;; + -signedjar) + _filedir jar + return 0 + ;; + -tsa) + _filedir + return 0 + ;; + esac + + # Check if a jar was already given. + local i jar=false + for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )) ; do + if [[ "${COMP_WORDS[i]}" == *.jar && \ + "${COMP_WORDS[i-1]}" != -signedjar ]] ; then + jar=true + break + fi + done + + if ! $jar ; then + if [[ "$cur" == -* ]] ; then + # Documented as "should not be used": -internalsf, -sectionsonly + COMPREPLY=( $( compgen -W '-keystore -storepass -storetype \ + -keypass -sigfile -signedjar -digestalg -sigalg -verify \ + -verbose -certs -tsa -tsacert -altsigner -altsignerpath \ + -protected -providerName -providerClass -providerArg' \ + -- "$cur" ) ) + fi + _filedir jar + fi +} && +complete -F _jarsigner -o filenames jarsigner # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/k3b bash-completion-1.2/contrib/k3b --- bash-completion-1.1/contrib/k3b 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/k3b 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,55 @@ +# bash completion for k3b + +have k3b && +_k3b() +{ + local cur prev + _get_comp_words_by_ref cur prev + COMPREPLY=() + + case $prev in + --help*|--author|-v|--version|--license|--lang) + return 0 + ;; + --datacd|--audiocd|--videocd|--mixedcd|--emovixcd|--videodvd) + _filedir + return 0 + ;; + --copydvd|--formatdvd|--videodvdrip) + _dvd_devices + return 0 + ;; + --copycd|--erasecd|--cddarip|--videocdrip) + _cd_devices + _dvd_devices + return 0 + ;; + --cdimage|--image) + _filedir @(cue|iso|toc) + return 0 + ;; + --dvdimage) + _filedir iso + return 0 + ;; + --ao) + COMPREPLY=( $( compgen -W 'alsa arts' -- "$cur" ) ) + return 0 + ;; + esac + + if [[ "$cur" == -* ]] ; then + COMPREPLY=( $( compgen -W "$( _parse_help "$1" )" -- "$cur" ) ) + else + _filedir + fi +} && +complete -F _k3b -o filenames k3b + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/kldload bash-completion-1.2/contrib/kldload --- bash-completion-1.1/contrib/kldload 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/kldload 2010-06-13 11:21:19.000000000 +0100 @@ -9,7 +9,7 @@ moddir=/modules/ [ -d $moddir ] || moddir=/boot/kernel/ - cur=`_get_cword` + _get_comp_words_by_ref cur COMPREPLY=( $( compgen -f "$moddir$cur" ) ) COMPREPLY=( ${COMPREPLY[@]#$moddir} ) @@ -17,15 +17,16 @@ return 0 } -complete -F _kldload $filenames kldload +complete -F _kldload -o filenames kldload _kldunload() { local cur - cur=`_get_cword` - COMPREPLY=( $(kldstat | sed -ne "s/^.*[ \t]\+\($cur[a-z_]\+\).ko$/\1/p") ) + _get_comp_words_by_ref cur + COMPREPLY=( $( kldstat | \ + sed -ne "s/^.*[ \t]\{1,\}\($cur[a-z_]\{1,\}\).ko$/\1/p" ) ) } -complete -F _kldunload $filenames kldunload +complete -F _kldunload -o filenames kldunload } diff -Nru bash-completion-1.1/contrib/larch bash-completion-1.2/contrib/larch --- bash-completion-1.1/contrib/larch 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/larch 2010-06-13 11:21:19.000000000 +0100 @@ -6,10 +6,9 @@ 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 + if [[ $COMP_CWORD -eq 1 || "$prev" == -* ]]; then COMPREPLY=( $( compgen -W ' \ my-id my-default-archive register-archive whereis-archive archives \ init-tree tree-root tree-version set-tree-version inventory \ @@ -38,7 +37,7 @@ return 0 } && -complete -F _larch $default larch +complete -F _larch -o default larch # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/ldapvi bash-completion-1.2/contrib/ldapvi --- bash-completion-1.1/contrib/ldapvi 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/ldapvi 2010-06-13 11:21:19.000000000 +0100 @@ -6,15 +6,14 @@ 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)) + case $prev in + -h|--host) _known_hosts_real "$cur" return 0 ;; - -@(Y|-sasl-mech)) + -Y|--sasl-mech) COMPREPLY=( $( compgen -W 'EXTERNAL GSSAPI DIGEST-MD5 \ CRAM-MD5 PLAIN ANONYMOUS' -- "$cur" ) ) return 0 diff -Nru bash-completion-1.1/contrib/lftp bash-completion-1.2/contrib/lftp --- bash-completion-1.1/contrib/lftp 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/lftp 2010-06-13 11:21:19.000000000 +0100 @@ -3,19 +3,44 @@ have lftp && _lftp() { - local cur + local cur prev COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur prev + + case $prev in + -f) + _filedir + return 0 + ;; + -c|-h|--help|-v|--version|-e|-u|-p) + return 0 + ;; + esac - if [ $COMP_CWORD -eq 1 ] && [ -f ~/.lftp/bookmarks ]; then - COMPREPLY=( $( compgen -W '$( sed -ne "s/^\(.*\)'$'\t''.*$/\1/p" \ - ~/.lftp/bookmarks )' -- "$cur" ) ) + if [[ "$cur" == -* ]] ; then + COMPREPLY=( $( compgen -W '-f -c --help --version -e -u -p' \ + -- "$cur" ) ) + return 0 fi - return 0 + COMPREPLY=( $( compgen -W \ + '$( cut -f 1 -s ~/.lftp/bookmarks 2>/dev/null )' -- "$cur" ) ) + _known_hosts_real "$cur" +} && +complete -F _lftp -o filenames lftp +have lftpget && +_lftpget() +{ + COMPREPLY=() + local cur + _get_comp_words_by_ref cur + + if [[ "$cur" == -* ]] ; then + COMPREPLY=( $( compgen -W '-c -d -v' -- "$cur" ) ) + fi } && -complete -F _lftp $default lftp +complete -F _lftpget lftpget # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/lilo bash-completion-1.2/contrib/lilo --- bash-completion-1.1/contrib/lilo 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/lilo 2010-06-13 11:21:19.000000000 +0100 @@ -12,11 +12,10 @@ 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)) + -C|-i|-m|-s|-S) _filedir return 0 ;; @@ -24,12 +23,12 @@ _filedir -d return 0 ;; - -@(I|D|R)) + -I|-D|-R) # label completion _lilo_labels return 0 ;; - -@(A|b|M|u|U)) + -A|-b|-M|-u|-U) # device completion cur=${cur:=/dev/} _filedir diff -Nru bash-completion-1.1/contrib/links bash-completion-1.2/contrib/links --- bash-completion-1.1/contrib/links 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/links 2010-06-13 11:21:19.000000000 +0100 @@ -6,9 +6,9 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur - case "$cur" in + case $cur in --*) COMPREPLY=( $( compgen -W '--help' -- "$cur" ) ) ;; @@ -32,7 +32,7 @@ return 0 } && -complete -F _links $filenames links +complete -F _links -o filenames links # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/lintian bash-completion-1.2/contrib/lintian --- bash-completion-1.1/contrib/lintian 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/lintian 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,186 @@ +# -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*- +# ex: ts=8 sw=8 noet filetype=sh +# +# bash completion for lintian(1) and lintian-info(1) + +have lintian && { +_lintian_tags() { + local match search tags + + tags=$( grep -e ^Tag /usr/share/lintian/checks/*.desc | cut -d\ -f2 ) + if [[ "$cur" == *, ]]; then + search=${cur//,/ } + for item in $search; do + match=$(grep -nE "^Tag: $item$" /usr/share/lintian/checks/*.desc \ + | cut -d: -f1 ) + tags=$( echo $tags | sed -e "s/\<$item\>//g" ) + done + COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$tags") ) + elif [[ "$cur" == *,* ]]; then + COMPREPLY=( ${COMPREPLY[@]} $(compgen -P "${cur%,*}," -W "$tags" -- \ + "${cur##*,}") ) + else + COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$tags" -- "$cur") ) + fi + return 0 +} + +_lintian_checks() { + local match search todisable checks + + checks=$(grep -e ^Check-Script -e ^Abbrev \ + /usr/share/lintian/checks/*.desc | cut -d\ -f2 ) + if [[ "$cur" == *, ]]; then + search=${cur//,/ } + for item in $search; do + match=$(grep -nE "^(Check-Script|Abbrev): $item$" \ + /usr/share/lintian/checks/*.desc | cut -d: -f1 ) + todisable=$(grep -e ^Check-Script -e ^Abbrev $match | \ + cut -d\ -f2 ) + for name in $todisable; do + checks=$( echo $checks | sed -e "s/\<$name\>//g" ) + done + done + COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$checks") ) + elif [[ "$cur" == *,* ]]; then + COMPREPLY=( ${COMPREPLY[@]} $(compgen -P "${cur%,*}," -W "$checks" \ + -- "${cur##*,}") ) + else + COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$checks" -- "$cur") ) + fi + return 0 +} + +_lintian_infos() { + local match search infos + + infos=$(grep -e ^Collector /usr/share/lintian/collection/*.desc \ + | cut -d\ -f2 ) + if [[ "$cur" == *, ]]; then + search=${cur//,/ } + for item in $search; do + match=$( grep -nE "^Collector: $item$" \ + /usr/share/lintian/collection/*.desc | cut -d: -f1 ) + infos=$( echo $infos | sed -e "s/\<$item\>//g" ) + done + COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$infos") ) + elif [[ "$cur" == *,* ]]; then + COMPREPLY=( ${COMPREPLY[@]} $(compgen -P "${cur%,*}," -W "$infos" \ + -- "${cur##*,}") ) + else + COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$infos" -- "$cur") ) + fi + return 0 +} + +_lintian_arches() { + return 0 +} + +_lintian() { + local cur prev action lint_actions general_opts behaviour_opts \ + configuration_opts selection_opts + + _get_comp_words_by_ref cur prev + + lint_actions="--setup-lab --remove-lab --check --check-part --tags \ + --tags-from-file --ftp-master-rejects --dont-check-part \ + --unpack --remove" + general_opts="--help --version --print-version --verbose --debug --quiet" + behaviour_opts="--info --display-info --display-experimental --pedantic \ + --display-level --suppress-tags --unpack-level \ + --suppress-tags-from-file --no-override --show-overrides \ + --color --unpack-info --md5sums --checksums --allow-root \ + --fail-on-warnings --keep-lab" + configuration_opts="--cfg --lab --archivedir --dist --area --section \ + --arch --root" + selection_opts="--all --binary --source --udeb --packages-file" + + if [[ "$prev" = -* ]]; then + case $prev in + -C|--check-part|-X|--dont-check-part) + _lintian_checks + ;; + -T|--tags|--suppress-tags) + _lintian_tags + ;; + --tags-from-file|--suppress-tags-from-file|--cfg|-p|\ + --packages-file) + _filedir + ;; + --lab|--archivedir|--dist|--root) + _filedir -d + ;; + -l|--unpack-level) + COMPREPLY=($(compgen -W "0 none 1 basic 2 contents" -- \ + "$cur")) + ;; + --color) + COMPREPLY=($(compgen -W "never always auto html" -- "$cur")) + ;; + -U|--unpack-info) + _lintian_infos + ;; + --area|--section) + COMPREPLY=($(compgen -W "main contrib non-free" -- "$cur")) + ;; + --arch) + ;; + esac + fi + + case "$cur" in + --*) + COMPREPLY=($(compgen -W "$lint_actions $general_opts \ + $behaviour_opts $configuration_opts" -- "$cur")) + ;; + *,) + # If we're here, the user is trying to complete on + # --action tag,tag, + # Only few actions permit that, re-complete them now. + echo $prev + case "$prev" in + -C|--check-part|-X|--dont-check-part) + _lintian_checks + ;; + -T|--tags|--suppress-tags) + _lintian_tags + ;; + -U|--unpack-info) + _lintian_infos + ;; + esac + ;; + *) + _filedir '@(?(u)deb|changes|dsc)' + ;; + esac + return 0 +} + +_lintian_info() { + local cur prev + + _get_comp_words_by_ref cur prev + + case "$prev" in + -t|--tags) + _lintian_tags + return 0 + ;; + esac + + case "$cur" in + --*) + COMPREPLY=($(compgen -W "--annotate --help --tags" -- "$cur")) + ;; + *) + _filedir + ;; + esac + return 0 +} + +complete -F _lintian -o filenames lintian +complete -F _lintian_info -o filenames lintian-info +} diff -Nru bash-completion-1.1/contrib/lisp bash-completion-1.2/contrib/lisp --- bash-completion-1.1/contrib/lisp 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/lisp 2010-06-13 11:21:19.000000000 +0100 @@ -7,7 +7,7 @@ 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 @@ -20,7 +20,7 @@ return 0 } && -complete -F _lisp $default lisp +complete -F _lisp -o default lisp # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/lvm bash-completion-1.2/contrib/lvm --- bash-completion-1.1/contrib/lvm 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/lvm 2010-06-13 11:21:19.000000000 +0100 @@ -49,11 +49,11 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-d --debug -h -? --help -l \ - --lvmpartition -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--debug --help \ + --lvmpartition --verbose --version' -- "$cur" ) ) fi } complete -F _lvmdiskscan lvmdiskscan @@ -63,13 +63,11 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-d --debug -e \ - --exported -n --novolumegroup -h -? \ - --help --ignorelockingfailure -P \ - --partial -s --short -u --uuid -v \ + COMPREPLY=( $( compgen -W '--debug --exported --novolumegroup \ + --help --ignorelockingfailure --partial --short --uuid \ --verbose --version' -- "$cur" ) ) fi } @@ -80,11 +78,10 @@ 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)) + case $prev in + -o|-O|--options|--sort) COMPREPLY=( $( compgen -W 'pv_fmt pv_uuid \ pv_size pv_free pv_used pv_name \ pv_attr pv_pe_count \ @@ -98,11 +95,10 @@ esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--aligned -a --all -d --debug \ - -h -? --help --ignorelockingfailure --noheadings \ - --nosuffix -o --options -O --sort \ - --separator --unbuffered --units \ - -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--aligned --all --debug \ + --help --ignorelockingfailure --noheadings \ + --nosuffix --options --sort --separator --unbuffered --units \ + --verbose --version' -- "$cur" ) ) else _physicalvolumes fi @@ -114,10 +110,9 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in --units) _units return 0 @@ -125,8 +120,8 @@ esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-c --colon -C --columns --units \ - -v --verbose -d --debug -h --help --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--colon --columns --units \ + --verbose --debug --help --version' -- "$cur" ) ) else _physicalvolumes fi @@ -138,20 +133,19 @@ 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)) + case $prev in + -A|-x|--autobackup|--allocatable) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-a --all -A --autobackup \ - -d --debug -h --help -t --test -u --uuid -x \ - --allocatable -v --verbose --addtag --deltag \ + COMPREPLY=( $( compgen -W '--all --autobackup \ + --debug --help --test --uuid \ + --allocatable --verbose --addtag --deltag \ --version' -- "$cur" ) ) else _physicalvolumes @@ -164,15 +158,14 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in --restorefile) _filedir return 0 ;; - -@(M|-metadatatype)) + -M|--metadatatype) COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) return 0 ;; @@ -180,18 +173,18 @@ COMPREPLY=( $( compgen -W '0 1 2' -- "$cur" ) ) return 0 ;; - --@(metadatasize|setphysicalvolumesize)) + --metadatasize|--setphysicalvolumesize) _sizes return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--restorefile -d --debug -f \ - --force -h -? --help --labelsector -M --metadatatype \ + COMPREPLY=( $( compgen -W '--restorefile --debug \ + --force --help --labelsector --metadatatype \ --metadatacopies --metadatasize \ - --setphysicalvolumesize -t --test -u --uuid uuid -v \ - --verbose -y --yes --version' -- "$cur" ) ) + --setphysicalvolumesize --test --uuid \ + --verbose --yes --version' -- "$cur" ) ) else _physicalvolumes fi @@ -203,24 +196,22 @@ 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)) + case $prev in + -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; - -@(n|-name)) + -n|--name) _logicalvolumes return 0 esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--abort -A --autobackup \ - -b --background -d --debug -f --force -h -? \ - --help -i --interval -t --test -v --verbose \ - --version -n --name' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--abort --autobackup \ + --background --debug --force --help --interval --test --verbose \ + --version --name' -- "$cur" ) ) else _physicalvolumes fi @@ -232,12 +223,11 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-d --debug -f --force -h -? \ - --help -y --yes -t --test -v --verbose \ - --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--debug --force \ + --help --yes --test --verbose --version' -- "$cur" ) ) else _physicalvolumes fi @@ -249,12 +239,12 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-d --debug -h --help \ - --ignorelockingfailure --mknodes -P \ - --partial -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--debug --help \ + --ignorelockingfailure --mknodes \ + --partial --verbose --version' -- "$cur" ) ) fi } complete -F _vgscan vgscan @@ -264,11 +254,10 @@ 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)) + case $prev in + -o|-O|--options|--sort) COMPREPLY=( $( compgen -W 'vg_fmt vg_uuid vg_name \ vg_attr vg_size vg_free vg_sysid \ vg_extent_size vg_extent_count vg_free_count \ @@ -283,11 +272,11 @@ esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--aligned -d --debug \ - -h --help --ignorelockingfailure --noheadings \ - --nosuffix -o --options -O --sort -P --partial \ + COMPREPLY=( $( compgen -W '--aligned --debug \ + --help --ignorelockingfailure --noheadings \ + --nosuffix --options --sort --partial \ --separator --unbuffered --units \ - -v --verbose --version' -- "$cur" ) ) + --verbose --version' -- "$cur" ) ) else _volumegroups fi @@ -299,10 +288,9 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in --units) _units return 0 @@ -310,9 +298,9 @@ esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-c --colon -C --columns --units \ - -P --partial -A --activevolumegroups -v --verbose \ - -d --debug -h --help --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--colon --columns --units \ + --partial --activevolumegroups --verbose \ + --debug --help --version' -- "$cur" ) ) else _volumegroups fi @@ -324,21 +312,20 @@ 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)) + case $prev in + -a|-A|-x|--available|--autobackup|--resizeable) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup --alloc -P \ - --partial -d --debug -h --help --ignorelockingfailure \ - -t --test -u --uuid -v --verbose --version -a \ - --available -x --resizeable -l --logicalvolume \ + COMPREPLY=( $( compgen -W '--autobackup --alloc \ + --partial --debug --help --ignorelockingfailure \ + --test --uuid --verbose --version \ + --available --resizeable --logicalvolume \ --addtag --deltag' -- "$cur" ) ) else _volumegroups @@ -351,28 +338,27 @@ 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)) + case $prev in + -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; - -@(M|-metadatatype)) + -M|--metadatatype) COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) return 0 ;; - -@(s|-physicalextentsize)) + -s|--physicalextentsize) _sizes return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup --addtag --alloc -d \ - --debug -h --help -l --maxlogicalvolumes -M --metadatatype -p \ - --maxphysicalvolumes -s --physicalextentsize -t --test -v \ + COMPREPLY=( $( compgen -W '--autobackup --addtag --alloc \ + --debug --help --maxlogicalvolumes --metadatatype \ + --maxphysicalvolumes --physicalextentsize --test \ --verbose --version' -- "$cur" ) ) else _args @@ -390,11 +376,11 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-d --debug -h --help -t --test \ - -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--debug --help --test \ + --verbose --version' -- "$cur" ) ) else _volumegroups fi @@ -406,19 +392,18 @@ 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)) + case $prev in + -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup -d --debug -h \ - -? --help -t --test -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--autobackup --debug \ + --help --test --verbose --version' -- "$cur" ) ) else _volumegroups fi @@ -430,19 +415,18 @@ 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)) + case $prev in + -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-a --all -A --autobackup -d \ - --debug -h --help --removemissing -t --test -v \ + COMPREPLY=( $( compgen -W '--all --autobackup \ + --debug --help --removemissing --test \ --verbose --version' -- "$cur" ) ) else @@ -461,23 +445,22 @@ 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)) + case $prev in + -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; - -@(L|-size)) + -L|--size) _sizes return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup -d --debug -h \ - -? --help -t --test -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--autobackup --debug \ + --help --test --verbose --version' -- "$cur" ) ) else _args if [ $args -eq 0 ]; then @@ -494,11 +477,11 @@ local cur prev COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-a --all -d --debug -h \ - -? --help -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--all --debug \ + --help --verbose --version' -- "$cur" ) ) else _volumegroups fi @@ -507,14 +490,14 @@ _vgck() { - local cur prev + local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-d --debug -h \ - -? --help -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--debug \ + --help --verbose --version' -- "$cur" ) ) else _volumegroups fi @@ -526,11 +509,10 @@ 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)) + case $prev in + -M|--metadatatype) COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) return 0 ;; @@ -545,9 +527,9 @@ esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-d --debug -h --help --labelsector \ - -M --metadatatype --metadatacopies --metadatasize \ - -t --test -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--debug --help --labelsector \ + --metadatatype --metadatacopies --metadatasize \ + --test --verbose --version' -- "$cur" ) ) else _volumegroups fi @@ -559,19 +541,18 @@ 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)) + case $prev in + -f|--file) _filedir return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-d --debug -f --file -h --help \ - --ignorelockingfailure -P --partial -v --verbose \ + COMPREPLY=( $( compgen -W '--debug --file --help \ + --ignorelockingfailure --partial --verbose \ --version' -- "$cur" ) ) else _volumegroups @@ -584,28 +565,27 @@ 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)) + case $prev in + -f|--file) _filedir return 0 ;; - -@(M|-metadatatype)) + -M|--metadatatype) COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) return 0 ;; - -@(n|-name)) + -n|--name) _volumegroups return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-d --debug -f --file -l --list \ - -h --help -M --Metadatatype -n --name -t --test \ - -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--debug --file --list \ + --help --metadatatype --name --test \ + --verbose --version' -- "$cur" ) ) else _volumegroups fi @@ -617,19 +597,18 @@ 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)) + case $prev in + -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup -d --debug -h --help -l \ - --list -t --test -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--autobackup --debug --help \ + --list --test --verbose --version' -- "$cur" ) ) else _volumegroups fi @@ -641,27 +620,26 @@ 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)) + case $prev in + -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; - -@(M|-metadatatype)) + -M|--metadatatype) COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup -d --debug \ - -h --help -l --list -M --metadatatype -t --test \ - -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--autobackup --debug \ + --help --list --metadatatype --test \ + --verbose --version' -- "$cur" ) ) else _args - if [ $args -eq 0 -o $args -eq 1 ]; then + if [[ $args -eq 0 || $args -eq 1 ]]; then _volumegroups else _physicalvolumes @@ -675,10 +653,10 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-d --debug -h --help -v --verbose \ + COMPREPLY=( $( compgen -W '--debug --help --verbose \ --version' -- "$cur" ) ) else _volumegroups @@ -691,12 +669,12 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-b --blockdevice -d --debug \ - -h -? --help --ignorelockingfailure -P \ - --partial -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--blockdevice --debug \ + --help --ignorelockingfailure \ + --partial --verbose --version' -- "$cur" ) ) fi } complete -F _lvscan lvscan @@ -706,11 +684,10 @@ 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)) + case $prev in + -o|-O|--options|--sort) COMPREPLY=( $( compgen -W 'lv_uuid lv_name lv_attr lv_minor \ lv_size seg_count origin snap_percent segtype stripes \ stripesize chunksize seg_start seg_size' -- "$cur" ) ) @@ -723,10 +700,10 @@ esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--aligned -d --debug -h --help \ - --ignorelockingfailure --noheadings --nosuffix -o --options -O \ - --sort -P --partial --segments --separator --unbuffered --units \ - -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--aligned --debug --help \ + --ignorelockingfailure --noheadings --nosuffix --options \ + --sort --partial --segments --separator --unbuffered --units \ + --verbose --version' -- "$cur" ) ) else _logicalvolumes fi @@ -738,10 +715,9 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in --units) _units return 0 @@ -749,9 +725,8 @@ esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-c --colon -C --columns --units \ - -P --partial -m --maps -v --verbose -d --debug -h \ - --help --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--colon --columns --units \ + --partial --maps --verbose --debug --help --version' -- "$cur" ) ) else _logicalvolumes fi @@ -763,27 +738,26 @@ 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)) + case $prev in + -a|-A|-C|-M|--available|--autobackup|--continguous|--persistent) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; - -@(p|-permission)) + -p|--permission) COMPREPLY=( $( compgen -W 'r rw' -- "$cur" ) ) return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup -a --available \ - --addtag --alloc -C --contiguous -d --debug --deltag \ - -f --force -h --help --ignorelockingfailure -M \ - --persistent --major major --minor minor -P --partial \ - -p --permission -r --readahead --refresh -t --test \ - -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--autobackup --available \ + --addtag --alloc --contiguous --debug --deltag \ + --force --help --ignorelockingfailure \ + --persistent --major --minor --partial \ + --permission --readahead --refresh --test \ + --verbose --version' -- "$cur" ) ) else _logicalvolumes fi @@ -795,34 +769,33 @@ 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)) + case $prev in + -A|-C|-M|-Z|--autobackup|--continguous|--persistent|--zero) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; - -@(L|-size)) + -L|--size) _sizes return 0 ;; - -@(p|-permission)) + -p|--permission) COMPREPLY=( $( compgen -W 'r rw' -- "$cur" ) ) return 0 ;; - -@(n|-name)) + -n|--name) _logicalvolumes return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup --addtag --alloc \ - -C --contiguous -d --debug -h -? --help -i --stripes \ - -I --stripesize -l --extents -L --size -M --persistent \ - --major --minor -n --name -p --permission -r \ - --readahead -t --test --type -v --verbose -Z --zero \ + COMPREPLY=( $( compgen -W '--autobackup --addtag --alloc \ + --contiguous --debug --help --stripes \ + --stripesize --extents --size --persistent \ + --major --minor --name --permission \ + --readahead --test --type --verbose --zero \ --version' -- "$cur" ) ) else _args @@ -840,20 +813,18 @@ 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)) + case $prev in + -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup -d --debug -f \ - --force -h -? --help -t --test -v --verbose \ - --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--autobackup --debug \ + --force --help --test --verbose --version' -- "$cur" ) ) else _logicalvolumes fi @@ -865,19 +836,18 @@ 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)) + case $prev in + -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup -d --debug -h \ - -? --help -t --test -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--autobackup --debug \ + --help --test --verbose --version' -- "$cur" ) ) else _logicalvolumes fi @@ -889,25 +859,23 @@ 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)) + case $prev in + -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; - -@(L|-size)) + -L|--size) _sizes return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup -d \ - --debug -f --force -h --help -l --extents \ - -L --size -n --nofsck -r --resizefs -t --test \ - -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--autobackup \ + --debug --force --help --extents \ + --size --nofsck --resizefs --test --verbose --version' -- "$cur" ) ) else _logicalvolumes fi @@ -919,25 +887,24 @@ 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)) + case $prev in + -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; - -@(L|-size)) + -L|--size) _sizes return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup --alloc -d \ - --debug -h --help -i --stripes -I --stripesize \ - -l --extents -L --size -n --nofsck -r --resizefs \ - -t --test --type -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--autobackup --alloc \ + --debug --help --stripes --stripesize \ + --extents --size --nofsck --resizefs \ + --test --type --verbose --version' -- "$cur" ) ) else _args if [ $args -eq 0 ]; then @@ -954,25 +921,24 @@ 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)) + case $prev in + -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; - -@(L|-size)) + -L|--size) _sizes return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --autobackup --alloc -d \ - --debug -h --help -i --stripes -I --stripesize \ - -l --extents -L --size -n --nofsck -r --resizefs \ - -t --test --type -v --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--autobackup --alloc \ + --debug --help --stripes --stripesize \ + --extents --size --nofsck --resizefs \ + --test --type --verbose --version' -- "$cur" ) ) else _args if [ $args -eq 0 ]; then @@ -986,10 +952,10 @@ _lvm() { - local prev + local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [ $COMP_CWORD -eq 1 ]; then COMPREPLY=( $( compgen -W 'dumpconfig help lvchange \ diff -Nru bash-completion-1.1/contrib/lzma bash-completion-1.2/contrib/lzma --- bash-completion-1.1/contrib/lzma 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/lzma 2010-06-13 11:21:19.000000000 +0100 @@ -6,21 +6,19 @@ 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 '-c -d -f -h -k -L -q -s \ - -v -V -z -1 -2 -3 -4 -5 -6 -7 -8 -9 \ - --help --decompress --compress --keep --force \ - --test --stdout --quiet --verbose --license \ + COMPREPLY=( $( compgen -W '-1 -2 -3 -4 -5 -6 -7 -8 -9 \ + --help --decompress --compress --keep --force --suffix \ + --test --stdout --quiet --verbose --license --list \ --version --small --fast --best --text' -- "$cur" ) ) return 0 fi local IFS=$'\t\n' - xspec="*.lzma" + xspec="*.@(lzma|tlz)" if [[ "$prev" == --* ]]; then [[ "$prev" == --decompress || \ "$prev" == --list || \ @@ -36,7 +34,7 @@ COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ $( compgen -d -- "$cur" ) ) } && -complete -F _lzma $filenames lzma +complete -F _lzma -o filenames lzma # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/lzop bash-completion-1.2/contrib/lzop --- bash-completion-1.1/contrib/lzop 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/lzop 2010-06-13 11:21:19.000000000 +0100 @@ -6,26 +6,20 @@ local cur prev xspec COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} - - # TODO: -p: takes a dir argument, without a separating space + _get_comp_words_by_ref cur prev if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-d -x -l -t -h -I -V -L -1 -2 -3 \ - -4 -5 -6 -7 -8 -9 -q -v -c -f -F -n -N -P -k -U -o \ - -S --fast --best --decompress --uncompress --extract \ - --test --list --ls --info --sysinfo --license --help \ - --version --stdout --to-stdout --output --path \ - --force --no-checksum --no-name --name --no-mode \ - --no-time --suffix --keep --unlink --delete --crc32 \ - --no-warn --ignore-warn --quiet --silent --verbose \ - --no-stdin --filter --checksum --no-color --mono \ + COMPREPLY=( $( compgen -W '-1 -2 -3 -4 -5 -6 -7 -8 -9 -P \ + --fast --best --decompress --extract --test --list --ls --info \ + --sysinfo --license --help --version --stdout --output --path \ + --force --no-checksum --no-name --name --no-mode --no-time \ + --suffix --keep --delete --crc32 --no-warn --ignore-warn --quiet \ + --verbose --no-stdin --filter --checksum --no-color --mono \ --color' -- "$cur" ) ) return 0 fi - case "$prev" in + case $prev in -o|--output) _filedir return 0 @@ -40,8 +34,8 @@ esac xspec="*.?(t)lzo" - case "$prev" in - --@(@(de|un)compress|extract|list|ls|info|test)) + case $prev in + --decompress|--uncompress|--extract|--list|--ls|--info|--test) xspec="!"$xspec ;; --force) @@ -63,7 +57,7 @@ COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ $( compgen -d -- "$cur" ) ) } && -complete -F _lzop $filenames lzop +complete -F _lzop -o filenames lzop # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/mailman bash-completion-1.2/contrib/mailman --- bash-completion-1.1/contrib/mailman 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/mailman 2010-06-13 11:21:19.000000000 +0100 @@ -1,4 +1,4 @@ -# Mailman completion by Guillaume Rousse +# mailman completion have list_lists && { _mailman_lists() @@ -11,11 +11,11 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-a --advertised --virtual-host-overview -V \ - -b --bare -h --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--advertised --virtual-host-overview \ + --bare --help' -- "$cur" ) ) fi } && @@ -28,17 +28,16 @@ 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 - case "$prev" in - -@(r|d|-regular-members-file|-digest-members-file)) + case $prev in + -r|-d|--regular-members-file|--digest-members-file) _filedir return 0 ;; - -@(w|a|-welcome-msg|-admin-notify)) + -w|-a|--welcome-msg|--admin-notify) COMPREPLY=( $( compgen -W 'y n' -- "$cur") ) return 0 ;; @@ -47,9 +46,9 @@ $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--regular-members-file -r \ - --digest-members-file -d --welcome-msg -w \ - --admin-notify -a --help -h' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--regular-members-file \ + --digest-members-file --welcome-msg \ + --admin-notify --help' -- "$cur" ) ) else _mailman_lists fi @@ -63,13 +62,12 @@ 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 - case "$prev" in - -@(f|-file)) + case $prev in + -f|--file) _filedir return 0 ;; @@ -78,8 +76,8 @@ $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--file -f --all -a --fromall --nouserack -n \ - --noadminack -N --help -h' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--file --all --fromall --nouserack \ + --noadminack --help' -- "$cur" ) ) else _mailman_lists fi @@ -93,13 +91,12 @@ 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 - case "$prev" in - -@(l|x|-listname|-exclude)) + case $prev in + -l|-x|--listname|--exclude) _mailman_lists return 0 ;; @@ -108,8 +105,8 @@ $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-l --listname -x --exclude --owners -w \ - --help -h' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--listname --exclude --owners \ + --help' -- "$cur" ) ) fi } && @@ -121,13 +118,12 @@ 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 - case "$prev" in - -@(l|-listname)) + case $prev in + -l|--listname) _mailman_lists return 0 ;; @@ -136,8 +132,8 @@ $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-l --listname --remove -r --admin -a \ - --quiet -q --nomodify -n --help -h' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--listname --remove --admin \ + --quiet --nomodify --help' -- "$cur" ) ) fi } && @@ -149,17 +145,16 @@ 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 - case "$prev" in - -@(w|g|d|--welcome-msg|-goodbye-msg|-digest)) + case $prev in + -w|-g|-d|--welcome-msg|--goodbye-msg|--digest) COMPREPLY=( $( compgen -W 'y n' -- "$cur") ) return 0 ;; - -@(d|-file)) + -d|--file) _filedir return 0 ;; @@ -168,9 +163,8 @@ $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--no-change -n --welcome-msg -w \ - --goodbye-msg -g --digest -d --notifyadmin -a -f --file -h --help' \ - -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--no-change --welcome-msg \ + --goodbye-msg --digest --notifyadmin --file --help' -- "$cur" ) ) else _mailman_lists fi @@ -184,10 +178,10 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-h --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--help' -- "$cur" ) ) else _filedir -d fi @@ -201,11 +195,10 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--all-vhost -v --all -a -h --help' \ - -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--all-vhost --all --help' -- "$cur" ) ) else _mailman_lists fi @@ -219,10 +212,10 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-w --with-listnames -m --moderators -h \ + COMPREPLY=( $( compgen -W '--with-listnames --moderators \ --help' -- "$cur" ) ) else _mailman_lists @@ -237,21 +230,20 @@ 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 - case "$prev" in - -@(o|-output)) + case $prev in + -o|--output) _filedir return 0 ;; - -@(d|-digest)) + -d|--digest) COMPREPLY=( $( compgen -W 'mime plain' -- "$cur") ) return 0 ;; - -@(n|-nomail)) + -n|--nomail) COMPREPLY=( $( compgen -W 'byadmin byuser bybounce unknown' \ -- "$cur") ) return 0 @@ -261,8 +253,8 @@ $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--output -o --regular -r --digest -d \ - --nomail -n --fullnames -f --preserve -p -h --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--output --regular --digest \ + --nomail --fullnames --preserve --help' -- "$cur" ) ) else _mailman_lists fi @@ -276,13 +268,12 @@ 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 - case "$prev" in - -@(l|-listname)) + case $prev in + -l|--listname) _mailman_lists return 0 ;; @@ -291,8 +282,8 @@ $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-a --all --domain -d --listname -l \ - --password -p --quiet -q -h --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--all --domain --listname \ + --password --quiet --help' -- "$cur" ) ) fi } && @@ -304,11 +295,11 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-l --lock -i --interactive \ - -r --run -a --all -q --quiet -h --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--lock --interactive \ + --run --all --quiet --help' -- "$cur" ) ) else _mailman_lists fi @@ -322,11 +313,10 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-l --language -q --quiet -h --help' \ - -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--language --quiet --help' -- "$cur" ) ) else _mailman_lists fi @@ -340,10 +330,10 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--archives -a -h --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--archives --help' -- "$cur" ) ) else _mailman_lists fi @@ -357,13 +347,12 @@ 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 - case "$prev" in - -@(i|o|-inputfile|-outputfile)) + case $prev in + -i|-o|--inputfile|--outputfile) _filedir return 0 ;; @@ -372,32 +361,33 @@ $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--inputfile -i --outputfile -o \ - --checkonly -c --verbose -v -h --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--inputfile --outputfile \ + --checkonly --verbose --help' -- "$cur" ) ) else _mailman_lists fi } && -complete -F _config_list $filenames config_list +complete -F _config_list -o filenames config_list -have arch && +# Try to detect whether this is the mailman "arch" to avoid installing +# it for the coreutils/util-linux-ng one. +have arch && have mailmanctl && _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 - case "$prev" in - -@(w|g|d|--welcome-msg|-goodbye-msg|-digest)) + case $prev in + -w|-g|-d|--welcome-msg|--goodbye-msg|--digest) COMPREPLY=( $( compgen -W 'y n' -- "$cur") ) return 0 ;; - -@(d|-file)) + -d|--file) _filedir return 0 ;; @@ -406,7 +396,7 @@ $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--wipe -s --start -e --end -q --quiet -h \ + COMPREPLY=( $( compgen -W '--wipe --start --end --quiet \ --help' -- "$cur" ) ) else args=$COMP_CWORD @@ -426,7 +416,7 @@ fi } && -complete -F _arch $filenames arch +complete -F _arch -o filenames arch have cleanarch && _cleanarch() @@ -434,10 +424,10 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-s --status -n --dry-run -q --quiet -h \ + COMPREPLY=( $( compgen -W '--status --dry-run --quiet \ --help' -- "$cur" ) ) fi @@ -450,13 +440,12 @@ 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 - case "$prev" in - -@(l|-listname)) + case $prev in + -l|--listname) _mailman_lists return 0 ;; @@ -465,14 +454,13 @@ $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-l --listname -q --queue -h --help' \ - -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--listname --queue --help' -- "$cur" ) ) else _filedir fi } && -complete -F _inject $filenames inject +complete -F _inject -o filenames inject have dumpdb && _dumpdb() @@ -480,17 +468,17 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--marshal -m --pickle -p --noprint -n -h \ + COMPREPLY=( $( compgen -W '--marshal --pickle --noprint \ --help' -- "$cur" ) ) else _filedir fi } && -complete -F _dumpdb $filenames dumpdb +complete -F _dumpdb -o filenames dumpdb have check_db && _check_db() @@ -498,11 +486,10 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--all -a --verbose -v -h --help' \ - -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--all --verbose --help' -- "$cur" ) ) else _mailman_lists fi @@ -516,7 +503,7 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '-f -v -h' -- "$cur" ) ) @@ -531,10 +518,10 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-q --quiet -h --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--quiet --help' -- "$cur" ) ) fi } && @@ -546,10 +533,10 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-c --listcreator -h --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--listcreator --help' -- "$cur" ) ) fi } && @@ -561,14 +548,13 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev _split_longopt && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-r --runner --once -o \ - -l --list -v --verbose -s --subproc -h --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--runner --once \ + --list --verbose --subproc --help' -- "$cur" ) ) fi } && @@ -580,11 +566,11 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-n --no-restart -u --run-as-user \ - -s --stale-lock-cleanup --quiet -q -h --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--no-restart --run-as-user \ + --stale-lock-cleanup --quiet --help' -- "$cur" ) ) else COMPREPLY=( $( compgen -W 'start stop restart reopen' -- "$cur" ) ) fi diff -Nru bash-completion-1.1/contrib/make bash-completion-1.2/contrib/make --- bash-completion-1.1/contrib/make 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/make 2010-06-13 11:21:19.000000000 +0100 @@ -6,13 +6,12 @@ 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 case $prev in - -@(f|o|W|-@(?(make|old-|new-)file|assume-@(old|new)|what-if))) + -f|-o|-W|--file|--makefile|--old-file|--new-file|--assume-old|--assume-new|--what-if) _filedir return 0 ;; @@ -39,9 +38,9 @@ --warn-undefined-variables' -- "$cur" ) ) else # before we check for makefiles, see if a path was specified - # with -C + # with -C/--directory for (( i=0; i < ${#COMP_WORDS[@]}; i++ )); do - if [[ ${COMP_WORDS[i]} == -C ]]; then + if [[ ${COMP_WORDS[i]} == -@(C|-directory) ]]; then # eval for tilde expansion eval makef_dir=${COMP_WORDS[i+1]} break @@ -49,9 +48,9 @@ done # before we scan for targets, see if a Makefile name was - # specified with -f + # specified with -f/--file/--makefile for (( i=0; i < ${#COMP_WORDS[@]}; i++ )); do - if [[ ${COMP_WORDS[i]} == -f ]]; then + if [[ ${COMP_WORDS[i]} == -@(f|-?(make)file) ]]; then # eval for tilde expansion eval makef=${COMP_WORDS[i+1]} break @@ -68,7 +67,7 @@ fi } && -complete -F _make $filenames make gmake gnumake pmake +complete -F _make -o filenames make gmake gnumake pmake # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/man bash-completion-1.2/contrib/man --- bash-completion-1.1/contrib/man 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/man 2010-06-13 11:21:19.000000000 +0100 @@ -7,12 +7,11 @@ { local cur i prev sect manpath manext mansect uname - manext="@([0-9lnp]|[0-9][px]|man|3pm)?(.@(gz|bz2|lzma))" + manext="@([0-9lnp]|[0-9][px]|man|3pm)?(.@([gx]z|bz2|lzma|Z))" 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 @@ -54,7 +53,7 @@ # weed out directory path names and paths to man pages COMPREPLY=( ${COMPREPLY[@]##*/?(:)} ) # strip suffix from man pages - COMPREPLY=( ${COMPREPLY[@]%.@(gz|bz2|lzma)} ) + COMPREPLY=( ${COMPREPLY[@]%.@([gx]z|bz2|lzma|Z)} ) COMPREPLY=( $( compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}" ) ) if [[ "$prev" != $mansect ]]; then @@ -72,7 +71,7 @@ [ $USERLAND = GNU -o $UNAME = Darwin \ -o $UNAME = FreeBSD -o $UNAME = SunOS -o $UNAME = Cygwin \ -o $UNAME = OpenBSD ] && \ -complete -F _man $filenames man apropos whatis +complete -F _man -o filenames man apropos whatis # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/mc bash-completion-1.2/contrib/mc --- bash-completion-1.1/contrib/mc 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/mc 2010-06-13 11:21:19.000000000 +0100 @@ -6,12 +6,11 @@ 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 - case "$prev" in + case $prev in -e|--edit|-v|--view|-l|--ftplog|-P|--printwd) _filedir return 0 @@ -29,17 +28,15 @@ $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-a --stickchars -b --nocolor -c \ - --color -C --colors -d --nomouse -e --edit -f \ - --datadir -k --resetsoft -l --ftplog -P --printwd \ - -s --slow -t --termcap -u --nosubshell -U --subshell \ - -v --view -V --version -x --xterm -D --debuglevel -h \ - --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--stickchars --nocolor --color --colors \ + --nomouse --edit --datadir --resetsoft --ftplog --printwd --slow \ + --termcap --nosubshell --subshell --view --version --xterm \ + --debuglevel --help' -- "$cur" ) ) else _filedir -d fi } && -complete -F _mc $filenames mc +complete -F _mc -o filenames mc # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/mcrypt bash-completion-1.2/contrib/mcrypt --- bash-completion-1.1/contrib/mcrypt 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/mcrypt 2010-06-13 11:21:19.000000000 +0100 @@ -6,58 +6,57 @@ 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)) + case $prev in + -g|--openpgp-z) COMPREPLY=( $( compgen -W '0 1 2 3 4 5 6 7 8 9' -- "$cur" ) ) return 0 ;; - -@(o|-keymode)) + -o|--keymode) COMPREPLY=( $( compgen -W '$( mcrypt --list-keymodes \ 2>/dev/null )' -- "$cur" ) ) return 0 ;; - -@(m|-mode)) + -m|--mode) COMPREPLY=( $( compgen -W "$( mcrypt --list \ 2>/dev/null | sed -e 's/.*: //' -e 's/ $//' | \ - sort | uniq )" -- "$cur" ) ) + sort -u )" -- "$cur" ) ) return 0 ;; - -@(a|-algorithm)) + -a|--algorithm) COMPREPLY=( $( compgen -W "$( mcrypt --list 2>/dev/null | \ awk '{print $1}' )" -- "$cur" ) ) return 0 ;; - -@(h|-hash)) + -h|--hash) COMPREPLY=( $( compgen -W '$( mcrypt --list-hash 2>/dev/null | \ sed -e 1d )' -- "$cur" ) ) return 0 ;; - -@(k|s|-@(key?(size)))) + -k|-s|--key|--keysize) return 0 ;; - -@(f|c|-@(keyfile|config))) + -f|-c|--keyfile|--config) _filedir return 0 ;; - --@(algorithm|mode)s-directory) + --algorithms-directory|--modes-directory) _filedir -d return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-g --openpgp --openpgp-z -d \ - --decrypt -s --keysize -o --keymode -f --keyfile \ - -c --config -a --algorithm --algorithms-directory \ - -m --mode --modes-directory -h --hash -k --key \ - --noiv -b --bare -z --gzip -p --bzip2 --flush -l \ - --doublecheck -u --unlink --nodelete -t --time -F \ - --force --echo -r --random --list --list-keymodes \ - --list-hash -V --verbose -q --quiet --help -v \ - --version -L --license' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--openpgp --openpgp-z \ + --decrypt --keysize --keymode --keyfile \ + --config --algorithm --algorithms-directory \ + --mode --modes-directory --hash --key \ + --noiv --bare --gzip --bzip2 --flush \ + --doublecheck --unlink --nodelete --time \ + --force --echo --random --list --list-keymodes \ + --list-hash --verbose --quiet --help \ + --version --license' -- "$cur" ) ) elif [[ ${COMP_WORDS[0]} == mdecrypt ]]; then _filedir '@(nc)' else @@ -74,7 +73,7 @@ fi fi } && -complete $filenames -F _mcrypt mcrypt mdecrypt +complete -o filenames -F _mcrypt mcrypt mdecrypt # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/mdadm bash-completion-1.2/contrib/mdadm --- bash-completion-1.1/contrib/mdadm 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/mdadm 2010-06-13 11:21:19.000000000 +0100 @@ -1,17 +1,18 @@ # bash completion for mdadm -have mdadm && { +have mdadm && +{ _mdadm_raid_level() { local mode for (( i=1; i < COMP_CWORD; i++ )); do case ${COMP_WORDS[i]} in - -@(C|-create)) + -C|--create) mode=create break ;; - -@(B|-build)) + -B|--build) mode=build break ;; @@ -71,102 +72,76 @@ _mdadm() { - local cur prev mode options + 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 - # --name value style option case $prev in - -@(c|b)) + -c|--config|-b|--bitmap|--backup-file) _filedir return 0 ;; - -l) + -l|--level) _mdadm_raid_level return 0 ;; - -p) + -p|--layout|--parity) _mdadm_raid_layout return 0 ;; - -a) + -a|--auto) _mdadm_auto_flag return 0 ;; - -U) + -U|--update) _mdadm_update_flag return 0 ;; esac - # --name=value style option - if [[ "$cur" == *=* ]]; then - prev=${cur/=*/} - cur=${cur/*=/} - case "$prev" in - --@(config|bitmap|backup-file)) - _filedir - return 0 - ;; - --level) - _mdadm_raid_level - return 0 - ;; - --@(layout|parity)) - _mdadm_raid_layout - return 0 - ;; - --auto) - _mdadm_auto_flag - return 0 - ;; - --update) - _mdadm_update_flag - return 0 - ;; - esac - fi + $split && return 0 - options='-h --help --help-options -V --version -v --verbose -q --quiet -b \ - --brief -f --force -c --config= -s --scan -e --metadata= --homehost=' + options='--help --help-options --version --verbose --quiet \ + --brief --force --config --scan --metadata --homehost' if [[ "$cur" == -* ]]; then if [[ $COMP_CWORD -eq 1 ]] ; then - COMPREPLY=( $( compgen -W "$options -A --assemble -B --build -C \ - --create -F --follow --monitor -G --grow" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "$options --assemble --build \ + --create --monitor --grow" -- "$cur" ) ) else case ${COMP_WORDS[COMP_CWORD-1]} in - -@(A|-assemble)) - COMPREPLY=( $( compgen -W "$options -u --uuid= -m \ - --super-minor= -N --name= -f --force -R --run \ - --no-degraded -a --auto -b --bitmap= --backup-file= \ - -U --update= --auto-update-homehost" -- "$cur" ) ) + -A|--assemble) + COMPREPLY=( $( compgen -W "$options --uuid \ + --super-minor --name --force --run \ + --no-degraded --auto --bitmap --backup-file \ + --update --auto-update-homehost" -- "$cur" ) ) ;; - -@(B|C|G|-build|-create|-grow)) - COMPREPLY=( $( compgen -W "$options -n --raid-devices= -x \ - --spare-devices= -z --size= -c --chunk= --rounding= -l \ - --level= -p --layout= --parity= -b --bitmap= \ - --bitmap-chunk= -W --write-mostly --write-behind= \ - --assume-clean --backup-file= -N --name= -R --run -f \ - --force -a --auto" -- "$cur" ) ) + -B|-C|-G|--build|--create|--grow) + COMPREPLY=( $( compgen -W "$options --raid-devices \ + --spare-devices --size --chunk --rounding \ + --level --layout --parity --bitmap \ + --bitmap-chunk --write-mostly --write-behind \ + --assume-clean --backup-file --name --run \ + --force --auto" -- "$cur" ) ) ;; - -@(F|-follow|-monitor)) - COMPREPLY=( $( compgen -W "$options -m --mail -p --program \ - --alert -y --syslog -d --delay -f --daemonise -i \ - --pid-file -1 --oneshot -t --test" -- "$cur" ) ) + -F|--follow|--monitor) + COMPREPLY=( $( compgen -W "$options --mail --program \ + --alert --syslog --delay --daemonise \ + --pid-file --oneshot --test" -- "$cur" ) ) ;; - @(/dev/*|--add|--fail|--remove)) - COMPREPLY=( $( compgen -W "$options -a --add --re-add -r \ - --remove -f --fail --set-faulty" -- "$cur" ) ) + /dev/*|--add|--fail|--remove) + COMPREPLY=( $( compgen -W "$options --add --re-add \ + --remove --fail --set-faulty" -- "$cur" ) ) ;; *) - COMPREPLY=( $( compgen -W "$options -Q --query -D --detail \ - -E --examine --sparc2.2 -X --examine-bitmap -R --run \ - -S --stop -o --readonly -w --readwrite \ - --zero-superblock -t --test" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "$options --query --detail \ + --examine --sparc2.2 --examine-bitmap --run \ + --stop --readonly --readwrite \ + --zero-superblock --test" -- "$cur" ) ) ;; esac fi diff -Nru bash-completion-1.1/contrib/medusa bash-completion-1.2/contrib/medusa --- bash-completion-1.1/contrib/medusa 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/medusa 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,41 @@ +# bash completion for medusa + +have medusa && +_medusa() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=`_get_pword` + + case $prev in + -h) + _known_hosts_real "$cur" + return 0 + ;; + -H|-U|-P|-C|-O) + _filedir + return 0 + ;; + -M) + COMPREPLY=( $( compgen -W "$(medusa -d | awk '/^ +\+/ {print $2}' \ + | sed -e 's/\.mod$//')" ) ) + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-h -H -u -U -p -P -C -O -e -M -m -d -n -s \ + -g -r -R -t -T -L -f -F -b -q -v -w -V -Z' -- "$cur" ) ) + fi +} && +complete -F _medusa medusa + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/minicom bash-completion-1.2/contrib/minicom --- bash-completion-1.1/contrib/minicom 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/minicom 2010-06-13 11:21:19.000000000 +0100 @@ -6,20 +6,19 @@ 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)) + -a|-c) COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) return 0 ;; - -@(S|C)) + -S|-C) _filedir return 0 ;; -P) - COMPREPLY=( $( command ls /dev/tty* ) ) + COMPREPLY=( $( printf '%s\n' /dev/tty* ) ) COMPREPLY=( $( compgen -W '${COMPREPLY[@]} ${COMPREPLY[@]#/dev/}' \ -- "$cur" ) ) return 0 @@ -37,13 +36,13 @@ [ -n "$( command ls /etc/minicom/minirc.* 2>/dev/null)" ] \ && confdir=/etc/minicom if [ -n "$confdir" ]; then - COMPREPLY=( $( compgen -W '$( command ls $confdir/minirc.* | \ + COMPREPLY=( $( compgen -W '$( printf "%s\n" $confdir/minirc.* | \ sed -e "s|$confdir/minirc.||")' -- "$cur" ) ) return 0 fi fi } && -complete -F _minicom $default minicom +complete -F _minicom -o default minicom # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/mkinitrd bash-completion-1.2/contrib/mkinitrd --- bash-completion-1.1/contrib/mkinitrd 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/mkinitrd 2010-06-13 11:21:19.000000000 +0100 @@ -6,17 +6,16 @@ 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 - case "$prev" in - --@(preload|with|builtin)) + case $prev in + --preload|--with|--builtin) _modules return 0 ;; - --@(fstab|dsdt)) + --fstab|--dsdt) _filedir return 0 ;; diff -Nru bash-completion-1.1/contrib/mock bash-completion-1.2/contrib/mock --- bash-completion-1.1/contrib/mock 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/mock 1970-01-01 00:00:00.000000000 +0000 @@ -1,85 +0,0 @@ -# bash completion for mock - -have mock && -_mock() -{ - local cur prev plugins cfgdir split=false - - COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} - plugins='tmpfs root_cache yum_cache bind_mount ccache' - cfgdir=/etc/mock - - count=0 - for i in "${COMP_WORDS[@]}" ; do - [ $count -eq $COMP_CWORD ] && break - if [[ "$i" == --configdir ]] ; then - cfgdir="${COMP_WORDS[((count+1))]}" - elif [[ "$i" == --configdir=* ]] ; then - cfgdir=${i/*=/} - fi - count=$((++count)) - done - - _split_longopt && split=true - - case $prev in - -@(h|-help|-copy@(in|out)|-arch|D|-define|-with?(out)|-uniqueext|-rpmbuild_timeout|-sources|-cwd)) - return 0 - ;; - -r|--root) - COMPREPLY=( $( compgen -W "$( command ls $cfgdir )" -- $cur ) ) - COMPREPLY=( ${COMPREPLY[@]/%.cfg/} ) - return 0 - ;; - --@(config|result)dir) - _filedir -d - return 0 - ;; - --spec) - _filedir spec - return 0 - ;; - --target) - # Yep, compatible archs, not compatible build archs - # (e.g. ix86 chroot builds in x86_64 mock host) - # This would actually depend on what the target root - # can be used to build for... - COMPREPLY=( $( compgen -W "$( command rpm --showrc | \ - sed -ne 's/^\s*compatible\s\+archs\s*:\s*\(.*\)/\1/i p' )" \ - -- "$cur" ) ) - return 0 - ;; - --@(en|dis)able-plugin) - COMPREPLY=( $( compgen -W "$plugins" -- "$cur" ) ) - return 0 - ;; - esac - - $split && return 0 - - if [[ "$cur" == -* ]] ; then - COMPREPLY=( $( compgen -W '--version -h --help --rebuild \ - --buildsrpm --shell --chroot --clean --init \ - --installdeps --install --update --orphanskill \ - --copyin --copyout -r --root --offline --no-clean \ - --cleanup-after --no-cleanup-after --arch --target \ - -D --define --with --without --resultdir --uniqueext \ - --configdir --rpmbuild_timeout --unpriv --cwd --spec \ - --sources -v --verbose -q --quiet --trace \ - --enable-plugin --disable-plugin --print-root-path' \ - -- "$cur" ) ) - else - _filedir '?(no)src.rpm' - fi -} && -complete -F _mock $filenames mock - -# Local variables: -# mode: shell-script -# sh-basic-offset: 4 -# sh-indent-comment: t -# indent-tabs-mode: nil -# End: -# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/_mock bash-completion-1.2/contrib/_mock --- bash-completion-1.1/contrib/_mock 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/_mock 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,86 @@ +# Use of this file is deprecated. Upstream completion is available in +# mock > 1.1.0, use that instead. + +# bash completion for mock + +have mock && +_mock() +{ + local cur prev plugins cfgdir split=false + + COMPREPLY=() + _get_comp_words_by_ref cur prev + plugins='tmpfs root_cache yum_cache bind_mount ccache' + cfgdir=/etc/mock + + count=0 + for i in "${COMP_WORDS[@]}" ; do + [ $count -eq $COMP_CWORD ] && break + if [[ "$i" == --configdir ]] ; then + cfgdir="${COMP_WORDS[((count+1))]}" + elif [[ "$i" == --configdir=* ]] ; then + cfgdir=${i/*=/} + fi + count=$((++count)) + done + + _split_longopt && split=true + + case $prev in + -h|--help|--copyin|--copyout|--arch|-D|--define|--with|--without|--uniqueext|--rpmbuild_timeout|--sources|--cwd) + return 0 + ;; + -r|--root) + COMPREPLY=( $( compgen -W "$( command ls $cfgdir )" -- $cur ) ) + COMPREPLY=( ${COMPREPLY[@]/%.cfg/} ) + return 0 + ;; + --configdir|--resultdir) + _filedir -d + return 0 + ;; + --spec) + _filedir spec + return 0 + ;; + --target) + # Yep, compatible archs, not compatible build archs + # (e.g. ix86 chroot builds in x86_64 mock host) + # This would actually depend on what the target root + # can be used to build for... + COMPREPLY=( $( compgen -W "$( command rpm --showrc | \ + sed -ne 's/^\s*compatible\s\s*archs\s*:\s*\(.*\)/\1/i p' )" \ + -- "$cur" ) ) + return 0 + ;; + --enable-plugin|--disable-plugin) + COMPREPLY=( $( compgen -W "$plugins" -- "$cur" ) ) + return 0 + ;; + esac + + $split && return 0 + + if [[ "$cur" == -* ]] ; then + COMPREPLY=( $( compgen -W '--version --help --rebuild \ + --buildsrpm --shell --chroot --clean --init \ + --installdeps --install --update --orphanskill \ + --copyin --copyout --root --offline --no-clean \ + --cleanup-after --no-cleanup-after --arch --target \ + --define --with --without --resultdir --uniqueext \ + --configdir --rpmbuild_timeout --unpriv --cwd --spec \ + --sources --verbose --quiet --trace --enable-plugin \ + --disable-plugin --print-root-path' -- "$cur" ) ) + else + _filedir '?(no)src.rpm' + fi +} && +complete -F _mock -o filenames mock + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/module-init-tools bash-completion-1.2/contrib/module-init-tools --- bash-completion-1.1/contrib/module-init-tools 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/module-init-tools 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,61 @@ +# bash completion for Linux module-init-tools + +# Linux rmmod(8) completion. This completes on a list of all currently +# installed kernel modules. +# +have rmmod && +_rmmod() +{ + local cur + + COMPREPLY=() + _get_comp_words_by_ref cur + + _installed_modules "$cur" + return 0 +} && +complete -F _rmmod rmmod + +# Linux insmod(8), modprobe(8) and modinfo(8) completion. This completes on a +# list of all available modules for the version of the kernel currently +# running. +# +have insmod || have modprobe || have modinfo && +_insmod() +{ + local cur prev modpath + + COMPREPLY=() + _get_comp_words_by_ref cur prev + + # behave like lsmod for modprobe -r + if [[ ${1##*/} == modprobe && "${COMP_WORDS[1]}" == -r ]]; then + _installed_modules "$cur" + return 0 + fi + + # do filename completion if we're giving a path to a module + if [[ "$cur" == */* ]]; then + _filedir '@(?(k)o?(.gz))' + return 0 + fi + + if [[ $COMP_CWORD -gt 1 && "${COMP_WORDS[COMP_CWORD-1]}" != -* ]]; then + # do module parameter completion + COMPREPLY=( $( compgen -W "$( /sbin/modinfo -p ${COMP_WORDS[1]} | \ + cut -d: -f1 )" -- "$cur" ) ) + else + _modules $(uname -r) + fi + + return 0 +} && +complete -F _insmod -o filenames insmod modprobe modinfo + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/modules bash-completion-1.2/contrib/modules --- bash-completion-1.1/contrib/modules 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/modules 1970-01-01 00:00:00.000000000 +0000 @@ -1,89 +0,0 @@ -# module completion by Ted Stern -# -# Completion for Environment Modules `module' alias. -# -# See http://sourceforge.net/projects/modules/ -# http://modules.sourceforge.net/ -# -# There are several versions of modules that are commonly used. Older -# Cray UNICOS systems and many other sites use 2.2.2b. The latest GPL'd -# version is 3.1.6. But the module alias is somewhat self-documenting -# via the `module help' command, so use that to print the options. -# -# Programmable completion might be more difficult under tcsh since the -# module command is an alias, and the `module avail' command returns -# its output as stderr. - -# Test for existence of /etc/profile.d/modules.sh too because we may end up -# being sourced before it and thus before the `module' alias has been defined. -have module || [ -f /etc/profile.d/modules.sh ] && { - -_module_list () -{ - local modules="$( echo $LOADEDMODULES | sed 's/:/ /g' | sort )" - compgen -W "$modules" -- $1 -} - -_module_path () -{ - local modules="$( echo $MODULEPATH | sed 's/:/ /g' | sort )" - compgen -W "$modules" -- $1 -} - -_module_avail () -{ - local modules="$( \ - module avail 2>&1 | \ - egrep -v '^(-|$)' | \ - xargs printf '%s\n' | sort )" - - compgen -W "$modules" -- $1 -} - -# A completion function for the module alias -_module () { - local cur prev options - - COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} - - if [ $COMP_CWORD -eq 1 ] ; then - # First parameter on line -- we expect it to be a mode selection - - options="$( module help 2>&1 | egrep '^[[:space:]]*\+' | \ - awk '{print $2}' | sed -e 's/|/ /g' | sort )" - - COMPREPLY=( $(compgen -W "$options" -- "$cur") ) - - elif [ $COMP_CWORD -eq 2 ] ; then - case "$prev" in - @(add|display|help|load|show|whatis)) - COMPREPLY=( $(_module_avail "$cur") ) - ;; - @(rm|switch|swap|unload|update)) - COMPREPLY=( $(_module_list "$cur") ) - ;; - unuse) - COMPREPLY=( $(_module_path "$cur") ) - ;; - esac - elif [ $COMP_CWORD -eq 3 ] ; then - case ${COMP_WORDS[1]} in - @(sw?(ap|itch))) - COMPREPLY=( $(_module_avail "$cur") ) - ;; - esac - fi - return 0 -} -complete -F _module $default module -} - -# Local variables: -# mode: shell-script -# sh-basic-offset: 4 -# sh-indent-comment: t -# indent-tabs-mode: nil -# End: -# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/_modules bash-completion-1.2/contrib/_modules --- bash-completion-1.1/contrib/_modules 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/_modules 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,92 @@ +# Use of this file is deprecated, upstream completion is available in +# modules >= 3.2.7, use that instead. +# +# module completion by Ted Stern +# +# Completion for Environment Modules `module' alias. +# +# See http://sourceforge.net/projects/modules/ +# http://modules.sourceforge.net/ +# +# There are several versions of modules that are commonly used. Older +# Cray UNICOS systems and many other sites use 2.2.2b. The latest GPL'd +# version is 3.1.6. But the module alias is somewhat self-documenting +# via the `module help' command, so use that to print the options. +# +# Programmable completion might be more difficult under tcsh since the +# module command is an alias, and the `module avail' command returns +# its output as stderr. + +# Test for existence of /etc/profile.d/modules.sh too because we may end up +# being sourced before it and thus before the `module' alias has been defined. +have module || [ -f /etc/profile.d/modules.sh ] && { + +_module_list () +{ + local modules="$( sed 's/:/ /g' <<<$LOADEDMODULES | sort )" + compgen -W "$modules" -- $1 +} + +_module_path () +{ + local modules="$( sed 's/:/ /g' <<<$MODULEPATH | sort )" + compgen -W "$modules" -- $1 +} + +_module_avail () +{ + local modules="$( \ + module avail 2>&1 | \ + command grep -E -v '^(-|$)' | \ + xargs printf '%s\n' | sed -e 's/(default)//g' | sort )" + + compgen -W "$modules" -- $1 +} + +# A completion function for the module alias +_module () +{ + local cur prev options + + COMPREPLY=() + _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 + + options="$( module help 2>&1 | command grep -E '^[[:space:]]*\+' | \ + awk '{print $2}' | sed -e 's/|/ /g' | sort )" + + COMPREPLY=( $(compgen -W "$options" -- "$cur") ) + + elif [ $COMP_CWORD -eq 2 ] ; then + case $prev in + add|display|help|load|show|whatis) + COMPREPLY=( $(_module_avail "$cur") ) + ;; + rm|switch|swap|unload|update) + COMPREPLY=( $(_module_list "$cur") ) + ;; + unuse) + COMPREPLY=( $(_module_path "$cur") ) + ;; + esac + elif [ $COMP_CWORD -eq 3 ] ; then + case ${COMP_WORDS[1]} in + swap|switch) + COMPREPLY=( $(_module_avail "$cur") ) + ;; + esac + fi + return 0 +} +complete -F _module -o default module +} + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/monodevelop bash-completion-1.2/contrib/monodevelop --- bash-completion-1.1/contrib/monodevelop 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/monodevelop 2010-06-13 11:21:19.000000000 +0100 @@ -4,7 +4,7 @@ _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 @@ 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 @@ -39,7 +38,7 @@ -S":" -- "$cur" ) ) # TODO: This does not work :( #if [[ "$prev" == *: ]]; then - # case "$prev" in + # case $prev in # @(--p:|--project:)) # COMPREPLY=( $( compgen -f -G "*.mdp" -- "$cur" ) ) # ;; @@ -51,7 +50,7 @@ return 0 ;; "generate-makefiles") - COMPREPLY=( $( compgen $filenames -G"*.mds" -- "$cur" ) ) + COMPREPLY=( $( compgen -o filenames -G"*.mds" -- "$cur" ) ) if [[ "$prev" == *mds ]]; then COMPREPLY=( $( compgen -W '--simple-makefiles --s --d:' \ -- "$cur" ) ) @@ -75,7 +74,7 @@ return 0 } && -complete -F _mdtool $filenames mdtool +complete -F _mdtool -o filenames mdtool # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/mount bash-completion-1.2/contrib/mount --- bash-completion-1.1/contrib/mount 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/mount 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,165 @@ +# mount(8) completion. This will pull a list of possible mounts out of +# /etc/{,v}fstab, unless the word being completed contains a ':', which +# would indicate the specification of an NFS server. In that case, we +# query the server for a list of all available exports and complete on +# that instead. +# +have mount && +{ + +# Just like COMPREPLY=(`compgen -W "${COMPREPLY[*]}" -- "$cur"`), only better! +# +# This will correctly escape special characters in COMPREPLY. +_reply_compgen_array() +{ + # Create the argument for compgen -W by escaping twice. + # + # One round of escape is because we want to reply with escaped arguments. A + # second round is required because compgen -W will helpfully expand it's + # argument. + local i wlist + for i in ${!COMPREPLY[*]}; do + local q=$(quote "$(printf %q "${COMPREPLY[$i]}")") + wlist+=$q$'\n' + done + + # We also have to add another round of escaping to $cur. + local ecur="$cur" + ecur="${ecur//\\/\\\\}" + ecur="${ecur//\'/\'}" + + # Actually generate completions. + local oldifs=$IFS + IFS=$'\n' eval 'COMPREPLY=(`compgen -W "$wlist" -- "${ecur}"`)' + IFS=$oldifs +} + +# Unescape strings in the linux fstab(5) format (with octal escapes). +__linux_fstab_unescape() { + eval $1="'${!1//\'/\047}'" + eval $1="'${!1/%\\/\\\\}'" + eval "$1=$'${!1}'" +} + +# Complete linux fstab entries. +# +# Reads a file from stdin in the linux fstab(5) format; as used by /etc/fstab +# and /proc/mounts. +_linux_fstab() +{ + COMPREPLY=() + + # Read and unescape values into COMPREPLY + local fs_spec fs_file fs_other + local oldifs="$IFS" + while read -r fs_spec fs_file fs_other; do + if [[ $fs_spec = [#]* ]]; then continue; fi + if [[ $1 == -L ]]; then + local fs_label=${fs_spec/#LABEL=} + if [[ $fs_label != "$fs_spec" ]]; then + __linux_fstab_unescape fs_label + IFS=$'\0' + COMPREPLY+=("$fs_label") + IFS=$oldifs + fi + else + __linux_fstab_unescape fs_spec + __linux_fstab_unescape fs_file + IFS=$'\0' + [[ $fs_spec = */* ]] && COMPREPLY+=("$fs_spec") + [[ $fs_file = */* ]] && COMPREPLY+=("$fs_file") + IFS=$oldifs + fi + done + + _reply_compgen_array +} + +_mount() +{ + local cur sm host prev + + COMPREPLY=() + _get_comp_words_by_ref -n : cur prev + + case $prev in + -t|--types) + _fstypes + return 0 + ;; + esac + + [[ "$cur" == \\ ]] && cur="/" + + if [[ "$cur" == *:* ]]; then + for sm in "$(type -P showmount)" {,/usr}/{,s}bin/showmount; do + [ -x "$sm" ] || continue + COMPREPLY=( $( compgen -W "$( "$sm" -e ${cur%%:*} | \ + awk 'NR>1 {print $1}' )" -- "${cur#*:}" ) ) + return 0 + done + fi + + if [[ "$cur" == //* ]]; then + host=${cur#//} + host=${host%%/*} + if [ -n "$host" ]; then + COMPREPLY=( $( compgen -P "//$host" -W \ + "$( smbclient -d 0 -NL $host 2>/dev/null | + sed -ne '/^['"$'\t '"']*Sharename/,/^$/p' | + sed -ne '3,$s|^[^A-Za-z]*\([^'"$'\t '"']*\).*$|/\1|p' )" \ + -- "${cur#//$host}" ) ) + fi + elif [ -r /etc/vfstab ]; then + # Solaris + COMPREPLY=( $( compgen -W "$( awk '! /^[ \t]*#/ {if ($3 ~ /\//) print $3}' /etc/vfstab )" -- "$cur" ) ) + elif [ ! -e /etc/fstab ]; then + # probably Cygwin + COMPREPLY=( $( compgen -W "$( mount | awk '! /^[ \t]*#/ {if ($3 ~ /\//) print $3}' )" -- "$cur" ) ) + else + # probably Linux + if [ "$prev" = -L ]; then + _linux_fstab -L < /etc/fstab + elif [ "$prev" = -U ]; then + COMPREPLY=( $( compgen -W '$(sed -ne "s/^[[:space:]]*UUID=\([^[:space:]]*\).*/\1/p" /etc/fstab )' -- "$cur" ) ) + else + _linux_fstab < /etc/fstab + fi + fi + + return 0 +} && +complete -F _mount -o default -o dirnames mount + +# umount(8) completion. This relies on the mount point being the third +# space-delimited field in the output of mount(8) +# +have umount && +_umount() +{ + local cur + _get_comp_words_by_ref cur + COMPREPLY=() + + if [[ $(uname -s) = Linux && -r /proc/mounts ]]; then + # Linux /proc/mounts is properly quoted. This is important when + # unmounting usb devices with pretty names. + _linux_fstab < /proc/mounts + else + local IFS=$'\n' + COMPREPLY=( $( compgen -W '$( mount | cut -d" " -f 3 )' -- "$cur" ) ) + fi + + return 0 +} && +complete -F _umount -o dirnames umount + +} + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/mplayer bash-completion-1.2/contrib/mplayer --- bash-completion-1.1/contrib/mplayer 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/mplayer 2010-06-13 11:21:19.000000000 +0100 @@ -15,11 +15,10 @@ 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)) + case $prev in + -[av][cfo]|-[av]fm|-vop|-fstype|-demuxer|-o[av]c|-of|-profile) _mplayer_options_list $cmd $prev return 0 ;; @@ -39,10 +38,10 @@ _filedir '@(idx|IDX|ifo|IFO|sub|SUB)' IFS=$'\t\n' COMPREPLY=( $( for i in "${COMPREPLY[@]}"; do - if [ -f $i -a -r $i ]; then - echo ${i%.*} + if [[ -f $i && -r $i ]]; then + printf '%s\n' ${i%.*} else - echo $i + printf '%s\n' $i fi done ) ) IFS=$' \t\n' @@ -67,7 +66,7 @@ IFS=$'\t\n' for i in ~/.mplayer/Skin $skinsdir; do - if [ -d $i -a -r $i ]; then + if [[ -d $i && -r $i ]]; then for j in $( compgen -d $i/$cur ); do COMPREPLY[$k]=${j#$i/} k=$((++k)) @@ -77,30 +76,42 @@ IFS=$' \t\n' return 0 ;; - -@(mixer|@(cdrom|dvd)-device|dvdauth|fb|zrdev)) + -cdrom-device) + _cd_devices + _dvd_devices + return 0 + ;; + -dvd-device) + _dvd_devices + return 0 + ;; + -mixer|-dvdauth|-fb|-zrdev) cur=${cur:=/dev/} _filedir return 0 ;; - -@(edl?(out)|lircconf|menu-cfg|playlist|csslib|dumpfile)| \ - -@(subfile|vobsub|aofile|fbmodeconfig|include|o|dvdkey)| \ + -edl|-edlout|-lircconf|-menu-cfg|-playlist|-csslib|-dumpfile| \ + -subfile|-vobsub|-aofile|-fbmodeconfig|-include|-o|-dvdkey| \ -passlogfile) _filedir return 0 ;; - -@(auto@(q|sync)|loop|menu-root|speed|sstep|aid|alang)| \ - -@(?(@(audio|sub)-)demuxer|bandwidth|cache|chapter)| \ - -@(dvd?(angle)|fps|frames|mc|passwd|user|sb|srate|ss|vcd)| \ - -@(vi?(d|vo)|ffactor|sid|slang|spu@(align|aa|gauss))| \ - -@(vobsubid|delay|bpp|brightness|contrast|dfbopts|display)| \ - -@(fbmode|geometry|guiwid|hue|icelayer|screen[wh]|wid)| \ - -@(monitor@(aspect|-@(dotclock|[hv]freq))|panscan|saturation)| \ - -@(xineramascreen|zr@(crop|norm|quality|[xy]doff|[vh]dec))| \ - -@(aspect|pp|x|y|xy|z|stereo|audio-@(density|delay|preload))| \ - -@(endpos|osdlevel|ffourcc|sws|channels|skiplimit|format)| \ - -@(ofps|aa@(driver|@(osd|sub)color)|vobsubout?(i@(ndex|d)))| \ - -sub@(-bg-@(alpha|color)|cp|delay|fps|pos|align|width)| \ - -sub@(font-@(blur|outline|autoscale|encoding|@(osd|text)-scale))) + -autoq|-autosync|-loop|-menu-root|-speed|-sstep|-aid|-alang| \ + -audo-demuxer|-sub-demuxer|-demuxer|-bandwidth|-cache|-chapter| \ + -dvd|-dvdangle|-fps|-frames|-mc|-passwd|-user|-sb|-srate|-ss|-vcd| \ + -vi|-vid|-vivo|-ffactor|-sid|-slang|-spualign|-spuaa|-spugauss| \ + -vobsubid|-delay|-bpp|-brightness|-contrast|-dfbopts|-display| \ + -fbmode|-geometry|-guiwid|-hue|-icelayer|-screen[wh]|-wid| \ + -monitoraspect|-monitor-dotclock|-monitor-[hv]freq|-panscan| \ + -saturation|-xineramascreen|-zrcrop|-zrnorm|-zrquality| \ + -zr[xy]doff|-zr[vh]dec|-aspect|-pp|-x|-y|-xy|-z|-stereo| \ + -audio-density|-audio-delay|-audio-preload|-endpos|-osdlevel| \ + -ffourcc|-sws|-channels|-skiplimit|-format|-ofps|-aadriver| \ + -aaosdcolor|-aasubcolor|-vobsubout|-vobsuboutid|-vobsuboutindex| \ + -sub-bg-alpha|-sub-bg-color|-sub-cp|-sub-delay|-sub-fps|-sub-pos| \ + -sub-align|-sub-width|-subfont-blur|-subfont-outline| \ + -subfont-autoscale|-subfont-encoding|-subfont-osd-scale| \ + -subfont-osd-text) return 0 ;; -lavdopts) @@ -118,10 +129,11 @@ scplx_mask= naq ildct format= pred qpel precmp= cmp= subcmp= \ predia= dia= trell last_pred= preme= subq= psnr mpeg_quant aic \ umv' -- "$cur" ) ) - return 0 - ;; - -ssf) - COMPREPLY=( $( compgen -W 'lgb= cgb= ls= cs= chs= cvs=' -- "$cur" ) ) + return 0 + ;; + -ssf) + COMPREPLY=( $( compgen -W 'lgb= cgb= ls= cs= chs= cvs=' \ + -- "$cur" ) ) return 0 ;; -jpeg) @@ -216,21 +228,21 @@ ;; esac - case "$cur" in + case $cur in -*) COMPREPLY=( $( compgen -W '$( $cmd -list-options 2>/dev/null | \ sed -ne '1,/^[[:space:]]*Name/d' \ -e "s/^[[:space:]]*/-/" -e "s/[[:space:]:].*//" \ - -e "/^-\(Total\|.*\*\)\?$/!p" )' -- "$cur" ) ) + -e "/^-\(Total\|.*\*\)\{0,1\}$/!p" )' -- "$cur" ) ) ;; *) - _filedir '@(mp?(e)g|MP?(E)G|wm[av]|WM[AV]|avi|AVI|asf|ASF|vob|VOB|bin|BIN|dat|DAT|vcd|VCD|ps|PS|pes|PES|fl[iv]|FL[IV]|viv|VIV|rm?(j)|RM?(J)|ra?(m)|RA?(M)|yuv|YUV|mov|MOV|qt|QT|mp[234]|MP[234]|m4[av]|M4[AV]|og[gmavx]|OG[GMAVX]|w?(a)v|W?(A)V|dump|DUMP|mk[av]|MK[AV]|m4a|M4A|aac|AAC|m[24]v|M[24]V|dv|DV|rmvb|RMVB|mid|MID|ts|TS|3g[p2]|mpc|MPC|flac|FLAC|vro|VRO|divx|DIVX|aif?(f)|AIF?(F)|m2ts|M2TS|vdr|VDR|xvid|XVID|ape|APE)' + _filedir '@(mp?(e)g|MP?(E)G|wm[av]|WM[AV]|avi|AVI|asf|ASF|vob|VOB|bin|BIN|dat|DAT|vcd|VCD|ps|PS|pes|PES|fl[iv]|FL[IV]|fxm|FXM|viv|VIV|rm?(j)|RM?(J)|ra?(m)|RA?(M)|yuv|YUV|mov|MOV|qt|QT|mp[234]|MP[234]|m4[av]|M4[AV]|og[gmavx]|OG[GMAVX]|w?(a)v|W?(A)V|dump|DUMP|mk[av]|MK[AV]|m4a|M4A|aac|AAC|m[24]v|M[24]V|dv|DV|rmvb|RMVB|mid|MID|t[ps]|T[PS]|3g[p2]|mpc|MPC|flac|FLAC|vro|VRO|divx|DIVX|aif?(f)|AIF?(F)|m2ts|M2TS|vdr|VDR|xvid|XVID|ape|APE)' ;; esac return 0 } -complete $filenames -F _mplayer mplayer mencoder gmplayer kplayer +complete -o filenames -F _mplayer mplayer mencoder gmplayer kplayer } # Local variables: diff -Nru bash-completion-1.1/contrib/msynctool bash-completion-1.2/contrib/msynctool --- bash-completion-1.1/contrib/msynctool 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/msynctool 2010-06-13 11:21:19.000000000 +0100 @@ -6,11 +6,7 @@ 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) @@ -27,12 +23,12 @@ esac case $prev in - --@(configure|@(add|del|show)group|sync|addmember)) + --configure|--addgroup|--delgroup|--showgroup|--sync|--addmember) COMPREPLY=( $( compgen -W '$(msynctool --listgroups \ | sed -e '1d' )' -- "$cur" ) ) return 0 ;; - --@(showformats|filter-objtype|slow-sync)) + --showformats|--filter-objtype|--slow-sync) COMPREPLY=( $( compgen -W '$(msynctool --listobjects \ | sed -e '1d' )' -- "$cur" ) ) return 0 diff -Nru bash-completion-1.1/contrib/mtx bash-completion-1.2/contrib/mtx --- bash-completion-1.1/contrib/mtx 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/mtx 2010-06-13 11:21:19.000000000 +0100 @@ -6,8 +6,7 @@ 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" diff -Nru bash-completion-1.1/contrib/munin-node bash-completion-1.2/contrib/munin-node --- bash-completion-1.1/contrib/munin-node 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/munin-node 2010-06-13 11:21:19.000000000 +0100 @@ -1,20 +1,19 @@ # bash completion for munin node have munin-run && -_munin-run() +_munin_run() { local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in - --@(config|sconffile)) + --config|--sconffile) _filedir return 0 ;; - --@(service|sconf)dir) + --servicedir|--sconfdir) _filedir -d return 0 ;; @@ -28,16 +27,28 @@ -- "$cur" ) ) fi } && -complete -F _munin-run munin-run +complete -F _munin_run munin-run + +have munindoc && +_munindoc() +{ + local cur prev + + COMPREPLY=() + _get_comp_words_by_ref cur prev + + COMPREPLY=( $( compgen -W '$( command ls /usr/share/munin/plugins )' \ + -- "$cur" ) ) +} && +complete -F _munindoc munindoc have munin-update && -_munin-update() +_munin_update() { local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in --config) @@ -56,23 +67,22 @@ --fork --nofork --stdout --nostdout --timeout' -- "$cur" ) ) fi } && -complete -F _munin-update munin-update +complete -F _munin_update munin-update have munin-node-configure && -_munin-node-configure() +_munin_node_configure() { local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in --config) _filedir return 0 ;; - --@(service|lib)dir) + --servicedir|--libdir) _filedir -d return 0 ;; @@ -92,7 +102,7 @@ --remove-also --snmp --snmpversion --snmpcommunity' -- "$cur" ) ) fi } && -complete -F _munin-node-configure munin-node-configure +complete -F _munin_node_configure munin-node-configure # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/mutt bash-completion-1.2/contrib/mutt --- bash-completion-1.1/contrib/mutt 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/mutt 2010-06-13 11:21:19.000000000 +0100 @@ -4,17 +4,50 @@ # a "query" function to retrieve addresses, so that's what we use here. have mutt || have muttng && { + +# @param $1 (cur) Current word to complete _muttaddr() { - _muttaliases - _muttquery + _muttaliases "$1" + _muttquery "$1" - cur=`_get_cword` - COMPREPLY=( "${COMPREPLY[@]}" $( compgen -u -- "$cur" ) ) + COMPREPLY=( "${COMPREPLY[@]}" $( compgen -u -- "$1" ) ) return 0 -} +} # _muttaddr() + + +# Find muttrc to use +# @output muttrc filename +_muttrc() +{ + # Search COMP_WORDS for '-F muttrc' or '-Fmuttrc' argument + set -- "${COMP_WORDS[@]}" + while [ $# -gt 0 ]; do + if [ "${1:0:2}" = -F ]; then + if [ ${#1} -gt 2 ]; then + muttrc="$(dequote "${1:2}")" + else + shift + [ "$1" ] && muttrc="$(dequote "$1")" + fi + break + fi + shift + done + + if [ -z "$muttrc" ]; then + [ -f ~/.${muttcmd}/${muttcmd}rc ] && muttrc="~/.${muttcmd}/${muttcmd}rc" + [ -f ~/.${muttcmd}rc ] && muttrc="~/.${muttcmd}rc" + fi + printf "%s" "$muttrc" +} # _muttrc() + +# Recursively build list of sourced config files +# @param $1 List of config files found so far +# @param $2 Config file to process +# @output List of config files _muttconffiles() { local file sofar @@ -23,47 +56,49 @@ sofar=" $1 " shift while [[ "$1" ]]; do - newconffiles=( $(sed -rn 's|^source[[:space:]]+([^[:space:]]+).*$|\1|p' $(eval echo $1) ) ) + newconffiles=( $(sed -n 's|^source[[:space:]]\{1,\}\([^[:space:]]\{1,\}\).*$|\1|p' $(eval echo $1) ) ) for file in "${newconffiles[@]}"; do - [[ ! "$file" ]] || [[ "${sofar/ ${file} / }" != "$sofar" ]] && - continue - sofar="$sofar $file" - sofar=" $(eval _muttconffiles \"$sofar\" $file) " + [[ ! "$file" ]] || [[ "${sofar/ ${file} / }" != "$sofar" ]] && + continue + sofar="$sofar $file" + sofar=" $(eval _muttconffiles \"$sofar\" $file) " done shift done - echo $sofar -} + printf '%s\n' $sofar +} # _muttconffiles() + +# @param $1 (cur) Current word to complete _muttaliases() { - local cur muttrc muttcmd=${COMP_WORDS[0]} + local cur=$1 muttrc muttcmd=${COMP_WORDS[0]} local -a conffiles aliases - cur=`_get_cword =` - [ -f ~/.${muttcmd}/${muttcmd}rc ] && muttrc="~/.${muttcmd}/${muttcmd}rc" - [ -f ~/.${muttcmd}rc ] && muttrc="~/.${muttcmd}rc" + muttrc=$(_muttrc) [ -z "$muttrc" ] && return 0 conffiles=( $(eval _muttconffiles $muttrc $muttrc) ) - aliases=( $( sed -rn 's|^alias[[:space:]]+([^[:space:]]+).*$|\1|p' \ + aliases=( $( sed -n 's|^alias[[:space:]]\{1,\}\([^[:space:]]\{1,\}\).*$|\1|p' \ $(eval echo "${conffiles[@]}") ) ) COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W "${aliases[*]}" -- "$cur" ) ) return 0 } + +# @param $1 (cur) Current word to complete _muttquery() { - local cur querycmd muttcmd=${COMP_WORDS[0]} + local cur=$1 querycmd muttcmd=${COMP_WORDS[0]} local -a queryresults - cur=`_get_cword` - querycmd="$( $muttcmd -Q query_command | sed -r 's|^query_command=\"(.*)\"$|\1|; s|%s|'$cur'|' )" - if [ -z "$cur" -o -z "$querycmd" ]; then + querycmd="$( $muttcmd -Q query_command | sed -e 's|^query_command=\"\(.*\)\"$|\1|' -e 's|%s|'$cur'|' )" + if [[ -z "$cur" || -z "$querycmd" ]]; then queryresults=() else - queryresults=( $( $querycmd | sed -nr '2,$s|^([^[:space:]]+).*|\1|p' ) ) + queryresults=( $( $querycmd | \ + sed -n '2,$s|^\([^[:space:]]\{1,\}\).*|\1|p' ) ) fi COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W "${queryresults[*]}" \ @@ -72,15 +107,15 @@ return 0 } + +# @param $1 (cur) Current word to complete _muttfiledir() { - local cur folder spoolfile muttcmd=${COMP_WORDS[0]} - cur=`_get_cword` + local cur=$1 folder muttrc spoolfile muttcmd=${COMP_WORDS[0]} - # This is currently not working so well. Perhaps this function should - # just call _filedir() for the moment. + muttrc=$(_muttrc) if [[ $cur == [=+]* ]]; then - folder="$( $muttcmd -Q folder | sed -r 's|^folder=\"(.*)\"$|\1|' )" + folder="$( $muttcmd -F "$muttrc" -Q folder | sed -e 's|^folder=\"\(.*\)\"$|\1|' )" : folder:=~/Mail # Match any file in $folder beginning with $cur @@ -89,53 +124,54 @@ COMPREPLY=( ${COMPREPLY[@]#$folder/} ) return 0 elif [ "$cur" == !* ]; then - spoolfile="$( $muttcmd -Q spoolfile | \ - sed -r 's|^spoolfile=\"(.*)\"$|\1|' )" + spoolfile="$( $muttcmd -F "$muttrc" -Q spoolfile | \ + sed -e 's|^spoolfile=\"\(.*\)\"$|\1|' )" [ ! -z "$spoolfile" ] && eval cur="${cur/^!/$spoolfile}"; fi _filedir return 0 -} +} # _muttfiledir + _mutt() { local cur prev - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref -n =+! cur prev + #cur=`_get_cword =+!` + #prev=`_get_pword =+!` COMPREPLY=() - case "$cur" in + case $cur in -*) COMPREPLY=( $( compgen -W '-A -a -b -c -e -f -F -H -i -m -n \ -p -Q -R -s -v -x -y -z -Z -h' -- "$cur" ) ) return 0 ;; *) - case "$prev" in - -@(a|f|F|H|i)) - _muttfiledir + case $prev in + -a|-f|-F|-H|-i) + _muttfiledir "$cur" return 0 ;; -A) - _muttaliases + _muttaliases "$cur" return 0 ;; - -@(e|m|Q|s|h|p|R|v|y|z|Z)) + -e|-m|-Q|-s|-h|-p|-R|-v|-y|-z|-Z) return 0 ;; *) - _muttaddr + _muttaddr "$cur" return 0 ;; esac ;; esac - -} -complete -F _mutt $default $filenames mutt muttng -} +} # _mutt() +complete -F _mutt -o default -o filenames mutt muttng +} # have mutt # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/mysqladmin bash-completion-1.2/contrib/mysqladmin --- bash-completion-1.1/contrib/mysqladmin 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/mysqladmin 2010-06-13 11:21:19.000000000 +0100 @@ -3,31 +3,64 @@ have mysqladmin && _mysqladmin() { - local cur prev + local cur prev split=false COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - -u) - COMPREPLY=( $( compgen -u -- "$cur" ) ) - return 0 - ;; - *) - ;; + _split_longopt && split=true + + case $prev in + -u|--user) + COMPREPLY=( $( compgen -u -- "$cur" ) ) + return 0 + ;; + -h|--host) + _known_hosts_real "$cur" + return 0 + ;; + --character-sets-dir|--ssl-capath) + _filedir -d + return 0 + ;; + -S|--socket) + _filedir sock + return 0 + ;; + --defaults-file|--defaults-extra-file) + _filedir + return 0 + ;; + -c|--count|--default-character-set|-P|--port|-O|--set-variable|\ + -i|--sleep|--ssl-ca|--ssl-cert|--ssl-cipher|--ssl-key|-w|--wait|\ + --connect_timeout|--shutdown_timeout) + # Argument required but no completions available + return 0 + ;; + '-?'|--help|-V|--version) + # All other options are noop with these + return 0 + ;; esac - COMPREPLY=( $( compgen -W '-# -f -? -C -h -p -P -i -r -E -s -S -t -u \ - -v -V -w' -- "$cur" ) ) + $split && return 0 + + COMPREPLY=( $( compgen -W '--count --debug-check --debug-info --force \ + --compress --character-sets-dir --default-character-set --help --host \ + --no-beep --password --port --protocol --relative --set-variable \ + --silent --socket --sleep --ssl --ssl-ca --ssl-capath --ssl-cert \ + --ssl-cipher --ssl-key --ssl-verify-server-cert --user --verbose \ + --version --vertical --wait --connect_timeout --shutdown_timeout \ + --print-defaults --no-defaults --defaults-file --defaults-extra-file' \ + -- "$cur" ) ) COMPREPLY=( "${COMPREPLY[@]}" \ - $( compgen -W 'create drop extended-status flush-hosts flush-logs \ - flush-status flush-tables flush-threads flush-privileges kill \ - password ping processlist reload refresh shutdown status variables \ - version' -- "$cur" ) ) + $( compgen -W 'create debug drop extended-status flush-hosts \ + flush-logs flush-status flush-tables flush-threads flush-privileges \ + kill password old-password ping processlist reload refresh shutdown \ + status start-slave stop-slave variables version' -- "$cur" ) ) } && -complete -F _mysqladmin mysqladmin +complete -F _mysqladmin -o filenames mysqladmin # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/ncftp bash-completion-1.2/contrib/ncftp --- bash-completion-1.1/contrib/ncftp 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/ncftp 2010-06-13 11:21:19.000000000 +0100 @@ -6,16 +6,16 @@ local cur 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" \ ~/.ncftp/bookmarks )' -- "$cur" ) ) fi return 0 } && -complete -F _ncftp $default ncftp +complete -F _ncftp -o default ncftp # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/net-tools bash-completion-1.2/contrib/net-tools --- bash-completion-1.1/contrib/net-tools 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/net-tools 2010-06-13 11:21:19.000000000 +0100 @@ -6,8 +6,7 @@ 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 @@ -27,14 +26,13 @@ $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-v --verbose -V --version -R \ - --reset -r --restart -w --watch -l --log -A \ - --advertise -F --force' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--verbose --version --reset --restart \ + --watch --log --advertise --force' -- "$cur" ) ) else _available_interfaces -a fi } && -complete -F _mii_tool $default mii-tool +complete -F _mii_tool -o default mii-tool have mii-diag && _mii_diag() @@ -42,13 +40,12 @@ 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 case $prev in - -@(F|A|-advertise|-fixed-speed)) + -F|-A|--advertise|--fixed-speed) COMPREPLY=( $( compgen -W '100baseT4 100baseTx \ 100baseTx-FD 100baseTx-HD 10baseT 10baseT-FD \ 10baseT-HD' -- "$cur" ) ) @@ -59,52 +56,45 @@ $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-A --advertise -F --fixed-speed -a \ - --all-interfaces -s --status -D --debug -g \ - --read-parameters -G --set-parameters -M --msg-level \ - -p --phy -r --restart -R --reset -v -V -w --watch \ - -? --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--advertise --fixed-speed --all-interfaces \ + --status --debug --read-parameters --set-parameters --msg-level \ + --phy --restart --reset --verbose --version --watch --help' \ + -- "$cur" ) ) else _available_interfaces -a fi } && -complete -F _mii_diag $default mii-diag +complete -F _mii_diag -o default mii-diag # Linux route(8) completion # -[ $UNAME = Linux ] && +[ $UNAME = Linux ] && have route && _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 - COMPREPLY=( $( ifconfig -a | sed -ne 's|^\('$cur'[^ ]*\).*$|\1|p' )) + _available_interfaces return 0 fi - COMPREPLY=( $( compgen -W 'add del -host -net netmask metric mss \ - window irtt reject mod dyn reinstate dev \ - default gw' -- "$cur" ) ) - - COMPREPLY=( $( echo " ${COMP_WORDS[@]}" | \ - (while read -d ' ' i; do - [ "$i" == "" ] && continue - # flatten array with spaces on either side, - # otherwise we cannot grep on word - # boundaries of first and last word - COMPREPLY=" ${COMPREPLY[@]} " - # remove word from list of completions - COMPREPLY=( ${COMPREPLY/ $i / } ) + # Remove already given options from completions + local i found + for opt in add del -host -net netmask metric mss window irtt reject mod \ + dyn reinstate dev default gw; do + found=false + for (( i=1; i < ${#COMP_WORDS[@]}-1; i++ )); do + [ "${COMP_WORDS[i]}" = "$opt" ] && found=true && break done - echo "${COMPREPLY[@]}") - ) ) - return 0 -} -[ $UNAME = Linux ] && complete -F _route route + $found || COMPREPLY[${#COMPREPLY[@]}]="$opt" + done + + COMPREPLY=( $( compgen -W '"${COMPREPLY[@]}"' -- "$cur" ) ) +} && +complete -F _route route # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/nmap bash-completion-1.2/contrib/nmap --- bash-completion-1.1/contrib/nmap 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/nmap 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,60 @@ +# bash completion for nmap + +have nmap && +_nmap() +{ + local cur prev + + COMPREPLY=() + cur=`_get_cword` + prev=`_get_pword` + + case $prev in + -iL|-oN|-oX|-oS|-oG|---excludefile|--resume|--stylesheet) + _filedir + return 0 + ;; + -oA|--datadir) + _filedir -d + return 0 + ;; + -e) + _available_interfaces + return 0 + ;; + -b|--dns-servers) + _known_hosts_real "$cur" + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-iL -iR --exclude --excludefile -sL -sP \ + -PN -PS -PA -PU -PY -PE -PP -PM -PO -n -R --dns-servers \ + --system-dns --traceroute -sS -sT -sA -sW -sM -sU -sN -sF -sX \ + --scanflags -sI -sY -sZ -sO -b -p -F -r --top-ports --port-ratio \ + -sV --version-intensity --version-light --version-all \ + --version-trace -sC --script= --script-args= --script-trace \ + --script-updatedb -O --osscan-limit --osscan-guess -T0 -T1 -T2 -T3 \ + -T4 -T5 --min-hostgroup --max-hostgroup --min-parallelism \ + --max-parallelism --min-rtt-timeout --max-rtt-timeout \ + --initial-rtt-timeout --max-retries --host-timeout --scan-delay \ + --max-scan-delay --min-rate --max-rate -f --mtu -D -S -e \ + --source-port --data-length --ip-options --ttl --spoof-mac \ + --badsum --adler32 -oN -oX -oS -oG -oA -v -d --reason --open \ + --packet-trace --iflist --log-errors --append-output --resume \ + --stylesheet --webxml --no-stylesheet -6 -A --datadir --send-eth \ + --send-ip --privilege--unprivileged -V -h' -- "$cur" ) ) + else + _known_hosts_real "$cur" + fi +} && +complete -F _nmap nmap + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/ntpdate bash-completion-1.2/contrib/ntpdate --- bash-completion-1.1/contrib/ntpdate 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/ntpdate 2010-06-13 11:21:19.000000000 +0100 @@ -6,8 +6,7 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in -k) diff -Nru bash-completion-1.1/contrib/openldap bash-completion-1.2/contrib/openldap --- bash-completion-1.1/contrib/openldap 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/openldap 2010-06-13 11:21:19.000000000 +0100 @@ -16,10 +16,9 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -h) _known_hosts_real "$cur" return 0 @@ -32,7 +31,7 @@ _filedir -d return 0 ;; - -@(f|y)) + -f|-y) _filedir return 0 ;; @@ -64,10 +63,9 @@ local cur prev options COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -h) _known_hosts_real "$cur" return 0 @@ -76,7 +74,7 @@ _ldap_uris return 0 ;; - -@(S|f|y)) + -S|-f|-y) _filedir return 0 ;; @@ -102,10 +100,9 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -h) _known_hosts_real "$cur" return 0 @@ -114,7 +111,7 @@ _ldap_uris return 0 ;; - -@(f|y)) + -f|-y) _filedir return 0 ;; @@ -136,10 +133,9 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -h) _known_hosts_real "$cur" return 0 @@ -170,10 +166,9 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -h) _known_hosts_real "$cur" return 0 @@ -182,7 +177,7 @@ _ldap_uris return 0 ;; - -@(f|y)) + -f|-y) _filedir return 0 ;; @@ -204,10 +199,9 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -h) _known_hosts_real "$cur" return 0 @@ -216,7 +210,7 @@ _ldap_uris return 0 ;; - -@(f|y)) + -f|-y) _filedir return 0 ;; @@ -238,10 +232,9 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -h) _known_hosts_real "$cur" return 0 @@ -250,7 +243,7 @@ _ldap_uris return 0 ;; - -@(t|T|y)) + -t|-T|-y) _filedir return 0 ;; diff -Nru bash-completion-1.1/contrib/openssl bash-completion-1.2/contrib/openssl --- bash-completion-1.1/contrib/openssl 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/openssl 2010-06-13 11:21:19.000000000 +0100 @@ -32,7 +32,7 @@ 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,21 +53,24 @@ 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|out|oid|prvrify|rand|recip|revoke|sess_in|sess_out|spkac|sign|signkey|signer|signature|ss_cert|untrusted|verify)) + -CA|-CAfile|-CAkey|-CAserial|-cert|-certfile|-config|-content| \ + -dcert|-dkey|-dhparam|-extfile|-in|-inkey|-kfile|-key|-keyout| \ + -out|-oid|-prvrify|-rand|-recip|-revoke|-sess_in|-sess_out| \ + -spkac|-sign|-signkey|-signer|-signature|-ss_cert|-untrusted| \ + -verify) _filedir return 0 ;; - -@(outdir|CApath)) + -outdir|-CApath) _filedir -d return 0 ;; - -@(name|crlexts|extensions)) + -name|-crlexts|-extensions) _openssl_sections return 0 ;; - -@(in|out|key|cert|CA|CAkey|dkey|dcert)form) + -inform|-outform|-keyform|-certform|-CAform|-CAkeyform|-dkeyform|-dcertform) formats='DER PEM' case $command in x509) @@ -222,7 +225,7 @@ -CAcreateserial -CAserial -text -C -md2 -md5 -sha1 \ -mdc2 -clrext -extfile -extensions -engine' ;; - @(md5|md4|md2|sha1|sha|mdc2|ripemd160)) + md5|md4|md2|sha1|sha|mdc2|ripemd160) options='-c -d' ;; esac @@ -239,7 +242,7 @@ fi fi } -complete -F _openssl $default openssl +complete -F _openssl -o default openssl } # Local variables: diff -Nru bash-completion-1.1/contrib/p4 bash-completion-1.2/contrib/p4 --- bash-completion-1.1/contrib/p4 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/p4 2010-06-13 11:21:19.000000000 +0100 @@ -3,11 +3,10 @@ have p4 && _p4() { - local cur prev prev2 p4commands p4filetypes + 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}' )" @@ -18,7 +17,7 @@ if [ $COMP_CWORD -eq 1 ]; then COMPREPLY=( $( compgen -W "$p4commands" -- "$cur" ) ) elif [ $COMP_CWORD -eq 2 ]; then - case "$prev" in + case $prev in help) COMPREPLY=( $( compgen -W "simple commands \ environment filetypes jobview revisions \ @@ -31,10 +30,9 @@ ;; esac elif [ $COMP_CWORD -gt 2 ]; then - prev2=${COMP_WORDS[COMP_CWORD-2]} - case "$prev" in + case $prev in -t) - case "$prev2" in + case $preprev in add|edit|reopen) COMPREPLY=( $( compgen -W "$p4filetypes" -- "$cur") ) ;; @@ -49,7 +47,7 @@ return 0 } && -complete -F _p4 $default p4 g4 +complete -F _p4 -o default p4 g4 # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/perl bash-completion-1.2/contrib/perl --- bash-completion-1.1/contrib/perl 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/perl 2010-06-13 11:21:19.000000000 +0100 @@ -4,7 +4,8 @@ { _perlmodules() { - COMPREPLY=( $( compgen -P "$prefix" -W "$( perl -e 'sub mods { my ($base,$dir)=@_; return if $base !~ /^\Q$ENV{cur}/; chdir($dir) or return; for (glob(q[*.pm])) {s/\.pm$//; print qq[$base$_\n]}; mods(/^(?:[.\d]+|$Config{archname}-$Config{osname}|auto)$/ ? undef : qq[${base}${_}\\\\:\\\\:],qq[$dir/$_]) for grep {-d} glob(q[*]); } mods(undef,$_) for @INC;' )" -- "$cur" ) ) + COMPREPLY=( $( compgen -P "$prefix" -W "$( perl -e 'sub mods { my ($base,$dir)=@_; return if $base !~ /^\Q$ENV{cur}/; chdir($dir) or return; for (glob(q[*.pm])) {s/\.pm$//; print qq[$base$_\n]}; mods(/^(?:[.\d]+|$Config{archname}-$Config{osname}|auto)$/ ? undef : qq[${base}${_}::],qq[$dir/$_]) for grep {-d} glob(q[*]); } mods(undef,$_) for @INC;' )" -- "$cur" ) ) + __ltrim_colon_completions "$1" } _perl() @@ -13,8 +14,7 @@ local optPrefix optSuffix COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref -n : cur prev prefix="" # If option not followed by whitespace, reassign prev and cur @@ -28,34 +28,33 @@ fi # only handle module completion for now - case "$prev" in + case $prev in -I|-x) local IFS=$'\t\n' COMPREPLY=( $( compgen -d $optPrefix $optSuffix -- "$cur" ) ) return 0 ;; -m|-M) - _perlmodules + _perlmodules "$cur" return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-C -s -T -u -U -W -X -h -v -V -c -w -d \ - -D -p -n -a -F -l -0 -I -m -M -P -S -x -i -e ' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '-C -s -T -u -U -W -X -h -v -V -c -w -d \ + -D -p -n -a -F -l -0 -I -m -M -P -S -x -i -e ' -- "$cur" ) ) else _filedir fi } -complete -F _perl $nospace $filenames perl +complete -F _perl -o nospace -o filenames perl _perldoc() { local cur prev prefix temp COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref -n : cur prev prefix="" # completing an option (may or may not be separated by a space) @@ -76,14 +75,14 @@ shift splice unshift grep join map qw reverse sort unpack \ delete each exists keys values binmode close closedir \ dbmclose dbmopen die eof fileno flock format getc print \ - printf read readdir rewinddir seek seekdir select syscall \ + printf read readdir rewinddir say seek seekdir select syscall \ sysread sysseek syswrite tell telldir truncate warn write \ pack read syscall sysread syswrite unpack vec -X chdir chmod \ chown chroot fcntl glob ioctl link lstat mkdir open opendir \ readlink rename rmdir stat symlink umask unlink utime caller \ continue do dump eval exit goto last next redo return \ - sub wantarray caller import local my our package use defined \ - formline reset scalar undef \ + sub wantarray break caller import local my our state package \ + use defined formline reset scalar undef \ alarm exec fork getpgrp getppid getpriority kill pipe qx \ setpgrp setpriority sleep system times wait waitpid \ import no package require use bless dbmclose dbmopen package \ @@ -97,7 +96,7 @@ getnetbyaddr getnetbyname getnetent getprotobyname \ getprotobynumber getprotoent getservbyname getservbyport \ getservent sethostent setnetent setprotoent setservent \ - gmtime localtime time times' -- "$cur" ) ) + gmtime localtime time times lock' -- "$cur" ) ) return 0 ;; esac @@ -107,15 +106,16 @@ else # return available modules (unless it is clearly a file) if [[ "$cur" != */* ]]; then - _perlmodules + _perlmodules "$cur" COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W \ '$( PAGER=/bin/cat man perl | \ sed -ne "/perl.*Perl overview/,/perlwin32/p" | \ - awk "\$NF=2 { print \$1}" | grep perl )' -- "$cur" ) ) + awk "\$NF=2 { print \$1}" | command grep perl )' -- "$cur" ) ) fi + _filedir '@(pl|PL|pm|PM|pod|POD)' fi } -complete -F _perldoc $default perldoc +complete -F _perldoc -o bashdefault perldoc } # Local variables: diff -Nru bash-completion-1.1/contrib/pine bash-completion-1.2/contrib/pine --- bash-completion-1.1/contrib/pine 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/pine 2010-06-13 11:21:19.000000000 +0100 @@ -1,17 +1,17 @@ # PINE address-book completion -have pine && +have pine || have alpine && _pineaddr() { local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur COMPREPLY=( $( compgen -W '$( awk "{print \$1}" ~/.addressbook \ 2>/dev/null)' -- "$cur" ) ) } && -complete -F _pineaddr $default pine +complete -F _pineaddr -o default pine alpine # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/pkg-config bash-completion-1.2/contrib/pkg-config --- bash-completion-1.1/contrib/pkg-config 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/pkg-config 2010-06-13 11:21:19.000000000 +0100 @@ -6,13 +6,13 @@ 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 case $prev in - --@(?(define-)variable|@(atleast?(-pkgconfig)|exact|max)-version)) + --variable|--define-variable|--atleast-version|--atleast-pkgconfig-version| \ + --exact-version|--max-version) # argument required but no completions available return 0 ;; @@ -34,8 +34,7 @@ --exists --uninstalled --atleast-version \ --exact-version --max-version --list-all --debug \ --print-errors --silence-errors --errors-to-stdout \ - --print-provides --print-requires -? --help --usage' \ - -- "$cur") ) + --print-provides --print-requires --help --usage' -- "$cur") ) else COMPREPLY=( $( compgen -W "$( pkg-config --list-all \ 2>/dev/null | awk '{print $1}' )" -- "$cur" ) ) diff -Nru bash-completion-1.1/contrib/pkg_install bash-completion-1.2/contrib/pkg_install --- bash-completion-1.1/contrib/pkg_install 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/pkg_install 2010-06-13 11:21:19.000000000 +0100 @@ -8,17 +8,16 @@ local cur pkgdir prev pkgdir=${PKG_DBDIR:-/var/db/pkg}/ - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - [ "$prev" = "-o" -o "$prev" = "-p" -o "$prev" = "-W" ] && return 0 + [[ "$prev" == -o || "$prev" == -p || "$prev" == -W ]] && return 0 COMPREPLY=( $( compgen -d "$pkgdir$cur" ) ) COMPREPLY=( ${COMPREPLY[@]#$pkgdir} ) return 0 } -complete -F _pkg_delete $dirnames pkg_delete pkg_info +complete -F _pkg_delete -o dirnames pkg_delete pkg_info } diff -Nru bash-completion-1.1/contrib/pkgtools bash-completion-1.2/contrib/pkgtools --- bash-completion-1.1/contrib/pkgtools 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/pkgtools 2010-06-13 11:21:19.000000000 +0100 @@ -6,12 +6,12 @@ local packages cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur COMPREPLY=( $( (cd /var/log/packages; compgen -f -- "$cur") ) ) } && -complete -F _removepkg $filenames removepkg && - complete $dirnames -f -X '!*.tgz' installpkg upgradepkg explodepkg +complete -F _removepkg -o filenames removepkg && + complete -o dirnames -f -X '!*.t[bglx]z' installpkg upgradepkg explodepkg # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/pm-utils bash-completion-1.2/contrib/pm-utils --- bash-completion-1.1/contrib/pm-utils 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/pm-utils 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,37 @@ +# bash completion for pm-utils + +have pm-is-supported && +_pm_is_supported() +{ + local cur + _get_comp_words_by_ref cur + COMPREPLY=( $( compgen -W '--help --suspend --hibernate --suspend-hybrid' \ + -- "$cur" ) ) +} && +complete -F _pm_is_supported pm-is-supported + +have pm-hibernate || have pm-suspend || have pm-suspend-hybrid && +_pm_action() +{ + local cur + _get_comp_words_by_ref cur + COMPREPLY=( $( compgen -W "--help $( _parse_help "$1" )" -- "$cur" ) ) +} && +complete -F _pm_action pm-hibernate pm-suspend pm-suspend-hybrid + +have pm-powersave && +_pm_powersave() +{ + local cur + _get_comp_words_by_ref cur + COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) +} && +complete -F _pm_powersave pm-powersave + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/portupgrade bash-completion-1.2/contrib/portupgrade --- bash-completion-1.1/contrib/portupgrade 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/portupgrade 2010-06-13 11:21:19.000000000 +0100 @@ -6,10 +6,9 @@ local cur pkgdir prev pkgdir=${PKG_DBDIR:-/var/db/pkg}/ - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - [ "$prev" = "-l" -o "$prev" = "-L" -o "$prev" = "-o" ] && return 0 + [[ "$prev" == -l || "$prev" == -L || "$prev" == -o ]] && return 0 COMPREPLY=( $( compgen -d "$pkgdir$cur" ) ) COMPREPLY=( ${COMPREPLY[@]#$pkgdir} ) @@ -17,7 +16,7 @@ return 0 } && -complete -F _portupgrade $dirnames portupgrade +complete -F _portupgrade -o dirnames portupgrade have portinstall && _portinstall() @@ -26,29 +25,28 @@ local -a COMPREPLY2 portsdir=${PORTSDIR:-/usr/ports}/ - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev # First try INDEX-5 indexfile=$portsdir/INDEX-5 # Then INDEX if INDEX-5 does not exist or system is not FreeBSD 5.x - [ "${OSTYPE%.*}" = "freebsd5" -a -f $indexfile ] || - indexfile=$portsdir/INDEX + [[ "${OSTYPE%.*}" == freebsd5 && -f $indexfile ]] || + indexfile=$portsdir/INDEX - [ "$prev" = "-l" -o "$prev" = "-L" -o "$prev" = "-o" ] && return 0 + [[ "$prev" == -l || "$prev" == -L || "$prev" == -o ]] && return 0 - COMPREPLY=( $( egrep "^$cur" < $indexfile | cut -d'|' -f1 ) ) - COMPREPLY2=( $( egrep "^[^\|]+\|$portsdir$cur" < $indexfile | \ + COMPREPLY=( $( command grep -E "^$cur" < $indexfile | cut -d'|' -f1 ) ) + COMPREPLY2=( $( command grep -E "^[^\|]+\|$portsdir$cur" < $indexfile | \ cut -d'|' -f2 ) ) COMPREPLY2=( ${COMPREPLY2[@]#$portsdir} ) COMPREPLY=( "${COMPREPLY[@]}" "${COMPREPLY2[@]}" ) return 0 } && -complete -F _portinstall $dirnames portinstall +complete -F _portinstall -o dirnames portinstall # _pkg_delete is in pkg_install type _pkg_delete &>/dev/null && have pkg_deinstall && \ -complete -F _pkg_delete $dirnames pkg_deinstall +complete -F _pkg_delete -o dirnames pkg_deinstall # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/postfix bash-completion-1.2/contrib/postfix --- bash-completion-1.1/contrib/postfix 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/postfix 2010-06-13 11:21:19.000000000 +0100 @@ -8,8 +8,7 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in -c) @@ -30,7 +29,7 @@ COMPREPLY=( $( compgen -W 'check start stop abort flush reload status \ set-permissions upgrade-configuration' -- "$cur" ) ) } -complete -F _postfix $filenames postfix +complete -F _postfix -o filenames postfix # postalias(1) and postmap(1) # @@ -39,8 +38,7 @@ local cur prev len idx COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in -c) @@ -75,7 +73,7 @@ fi return 0 } -complete -F _postmap $filenames postmap postalias +complete -F _postmap -o filenames postmap postalias # postcat(1) # @@ -84,8 +82,7 @@ local cur prev pval len idx qfile COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in -c) @@ -107,7 +104,7 @@ len=${#cur} idx=0 for pval in $( mailq 2>/dev/null | \ - sed -e '1d; $d; /^[^0-9A-Z]\|^$/d; s/[* !].*$//' ); do + sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* !].*$//' ); do if [[ "$cur" == "${pval:0:$len}" ]]; then COMPREPLY[$idx]=$pval idx=$(($idx+1)) @@ -119,7 +116,7 @@ return 0 fi } -complete -F _postcat $filenames postcat +complete -F _postcat -o filenames postcat # postconf(1) # @@ -128,8 +125,7 @@ local cur prev pval len idx eqext COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in -b|-t) @@ -162,7 +158,7 @@ done return 0 } -complete -F _postconf $filenames postconf +complete -F _postconf -o filenames postconf # postsuper(1) # @@ -171,8 +167,7 @@ local cur prev pval len idx COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in -c) @@ -182,8 +177,8 @@ -[dr]) len=${#cur} idx=0 - for pval in $( echo ALL; mailq 2>/dev/null | \ - sed -e '1d; $d; /^[^0-9A-Z]\|^$/d; s/[* !].*$//' ); do + for pval in ALL $( mailq 2>/dev/null | \ + sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* !].*$//' ); do if [[ "$cur" == "${pval:0:$len}" ]]; then COMPREPLY[$idx]=$pval idx=$(($idx+1)) @@ -194,8 +189,8 @@ -h) len=${#cur} idx=0 - for pval in $( echo ALL; mailq 2>/dev/null | \ - sed -e '1d; $d; /^[^0-9A-Z]\|^$/d; s/[* ].*$//; /!$/d' ); do + for pval in ALL $( mailq 2>/dev/null | \ + sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* ].*$//; /!$/d' ); do if [[ "$cur" == "${pval:0:$len}" ]]; then COMPREPLY[$idx]=$pval idx=$(($idx+1)) @@ -206,8 +201,8 @@ -H) len=${#cur} idx=0 - for pval in $( echo ALL; mailq 2>/dev/null | \ - sed -e '1d; $d; /^[^0-9A-Z]\|^$/d; /^[0-9A-Z]*[* ]/d; s/!.*$//' ); do + for pval in ALL $( mailq 2>/dev/null | \ + sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; /^[0-9A-Z]*[* ]/d; s/!.*$//' ); do if [[ "$cur" == "${pval:0:$len}" ]]; then COMPREPLY[$idx]=$pval idx=$(($idx+1)) @@ -224,7 +219,7 @@ COMPREPLY=( $( compgen -W 'hold incoming active deferred' -- "$cur" ) ) } -complete -F _postsuper $filenames postsuper +complete -F _postsuper -o filenames postsuper } # Local variables: diff -Nru bash-completion-1.1/contrib/postgresql bash-completion-1.2/contrib/postgresql --- bash-completion-1.1/contrib/postgresql 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/postgresql 2010-06-13 11:21:19.000000000 +0100 @@ -13,7 +13,7 @@ { # See https://launchpad.net/bugs/164772 #COMPREPLY=( $( psql -qtc 'select usename from pg_user' template1 2>/dev/null | \ - # grep "^ $cur" ) ) + # command grep "^ $cur" ) ) #[ ${#COMPREPLY[@]} -eq 0 ] && COMPREPLY=( $( compgen -u -- $cur ) ) COMPREPLY=( $( compgen -u -- "$cur" ) ) } @@ -25,12 +25,11 @@ 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 - case "$prev" in + case $prev in -h|--host) _known_hosts_real "$cur" return 0 @@ -52,14 +51,14 @@ $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-D -T -E -h -p -U -W -e -q \ - --tablespace --template --encoding --host --port \ - --username --password --echo --quiet --help --version' -- "$cur" )) + COMPREPLY=( $( compgen -W '--tablespace --template --encoding --host \ + --port --username --password --echo --quiet --help --version' \ + -- "$cur" ) ) else _pg_databases fi } -complete -F _createdb $default createdb +complete -F _createdb -o default createdb # dropdb(1) completion # @@ -68,12 +67,11 @@ 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 - case "$prev" in + case $prev in -h|--host) _known_hosts_real "$cur" return 0 @@ -91,14 +89,13 @@ $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-h -p -U -W -i -e -q \ - --host --port --username --password --interactive \ - --echo --quiet --help --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--host --port --username --password \ + --interactive --echo --quiet --help --version' -- "$cur" ) ) else _pg_databases fi } -complete -F _dropdb $default dropdb +complete -F _dropdb -o default dropdb # psql(1) completion # @@ -107,12 +104,11 @@ 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 - case "$prev" in + case $prev in -h|--host) _known_hosts_real "$cur" return 0 @@ -144,22 +140,18 @@ if [[ "$cur" == -* ]]; then # return list of available options - COMPREPLY=( $( compgen -W '-a --echo-all -A --no-align \ - -c --command -d --dbname -e --echo-queries \ - -E --echo-hidden -f --file -F --field-separator \ - -h --host -H --html -l --list -L --log-file -n \ - -o --output -p --port -P --pset -q --quiet \ - -R --record-separator -s --single-step \ - -S --single-line -t --tuples-only -T --table-attr \ - -U --username -v --set --variable -V --version \ - -W --password -x --expanded -X --no-psqlrc \ - -1 --single-transaction -? --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--echo-all --no-align --command --dbname \ + --echo-queries --echo-hidden --file --field-separator --host \ + --html --list --log-file --output --port --pset --quiet \ + --record-separator --single-step --single-line --tuples-only \ + --table-attr --username --set --version --password --expanded \ + --no-psqlrc --single-transaction --help' -- "$cur" ) ) else # return list of available databases _pg_databases fi } -complete -F _psql $filenames psql +complete -F _psql -o filenames psql } # Local variables: diff -Nru bash-completion-1.1/contrib/povray bash-completion-1.2/contrib/povray --- bash-completion-1.1/contrib/povray 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/povray 2010-06-13 11:21:19.000000000 +0100 @@ -7,8 +7,7 @@ defoext=png # default output extension, if cannot be determined FIXME COMPREPLY=() - povcur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref povcur prev _expand || return 0 @@ -22,14 +21,14 @@ ;; [-+]O*) # guess what output file type user may want - case $( ( IFS=$'\n'; echo "${COMP_WORDS[*]}" | grep '^[-+]F' ) ) in + case $( ( IFS=$'\n'; command grep '^[-+]F' <<<"${COMP_WORDS[*]}" ) ) in [-+]FN) oext=png ;; [-+]FP) oext=ppm ;; [-+]F[CT]) oext=tga ;; *) oext=$defoext ;; esac # complete filename corresponding to previously specified +I - COMPREPLY=( $( ( IFS=$'\n'; echo "${COMP_WORDS[*]}" | grep '^[-+]I' ) ) ) + COMPREPLY=( $( ( IFS=$'\n'; command grep '^[-+]I' <<<"${COMP_WORDS[*]}" ) ) ) COMPREPLY=( ${COMPREPLY[@]#[-+]I} ) COMPREPLY=( ${COMPREPLY[@]/%.pov/.$oext} ) cur="${povcur#[-+]O}" # to confuse _filedir @@ -55,7 +54,7 @@ ;; esac } && -complete -F _povray $filenames povray xpovray spovray +complete -F _povray -o filenames povray xpovray spovray # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/procps bash-completion-1.2/contrib/procps --- bash-completion-1.1/contrib/procps 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/procps 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,49 @@ +# Completions for tools included in procps and related + +# killall(1) (Linux and FreeBSD) and pkill(1) completion. +# +[[ $UNAME == Linux || $UNAME == FreeBSD ]] || have pkill && +_killall() +{ + local cur + + COMPREPLY=() + _get_comp_words_by_ref cur + + if [[ $COMP_CWORD -eq 1 && "$cur" == -* ]]; then + _signals + else + _pnames + fi + + return 0 +} +[[ $UNAME == Linux || $UNAME == FreeBSD ]] && complete -F _killall killall +have pkill && complete -F _killall pkill + +# pgrep(1) completion. +# +[ $UNAME = Linux ] || have pgrep && +_pgrep() +{ + local cur + + COMPREPLY=() + _get_comp_words_by_ref cur + + _pnames + + return 0 +} +have pgrep && complete -F _pgrep pgrep + +# Linux pidof(8) completion. +[ $UNAME = Linux ] && complete -F _pgrep pidof + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/python bash-completion-1.2/contrib/python --- bash-completion-1.1/contrib/python 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/python 2010-06-13 11:21:19.000000000 +0100 @@ -6,10 +6,9 @@ local prev cur i COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]##*/} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -Q) COMPREPLY=( $( compgen -W "old new warn warnall" -- "$cur" ) ) return 0 @@ -48,7 +47,7 @@ return 0 } && -complete -F _python $filenames python +complete -F _python -o filenames python # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/qdbus bash-completion-1.2/contrib/qdbus --- bash-completion-1.1/contrib/qdbus 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/qdbus 2010-06-13 11:21:19.000000000 +0100 @@ -1,21 +1,18 @@ -# Qt qdbus completion +# Qt qdbus, dcop completion -have qdbus && +have qdbus || have dcop && _qdbus() { - local cur compstr + local cur COMPREPLY=() - cur=`_get_cword` - if [ -z "$cur" ]; then - compstr=${COMP_WORDS[*]} - else - compstr=$( command echo ${COMP_WORDS[*]} | sed "s/ ${cur/\//\\/}$//" ) - fi - COMPREPLY=( $( compgen -W '$( command $compstr | sed s/\(.*\)// )' \ - -- "$cur" ) ) + _get_comp_words_by_ref cur + + [ -n "$cur" ] && unset COMP_WORDS[${#COMP_WORDS[@]}-1] + COMPREPLY=( $( compgen -W '$( command ${COMP_WORDS[@]} 2>/dev/null | \ + sed s/\(.*\)// )' -- "$cur" ) ) } && -complete -F _qdbus qdbus +complete -F _qdbus qdbus dcop # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/qemu bash-completion-1.2/contrib/qemu --- bash-completion-1.1/contrib/qemu 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/qemu 2010-06-13 11:21:19.000000000 +0100 @@ -6,15 +6,15 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in - -@(fd[ab]|hd[abcd]|cdrom|option-rom|kernel|initrd|bootp|pidfile|loadvm|mtdblock|sd|pflash|bios)) + -fd[ab]|-hd[abcd]|-cdrom|-option-rom|-kernel|-initrd|-bootp|-pidfile| \ + -loadvm|-mtdblock|-sd|-pflash|-bios) _filedir return 0 ;; - -@(tftp|smb|L|chroot)) + -tftp|-smb|-L|-chroot) _filedir -d return 0 ;; @@ -53,7 +53,7 @@ -- "$cur" ) ) return 0 ;; - -@(serial|parallel|monitor)) + -serial|-parallel|-monitor) COMPREPLY=( $( compgen -W 'vc pty none null /dev/ \ file: stdio pipe: COM udp: tcp: telnet: unix: \ mon: braille' -- "$cur" ) ) @@ -111,7 +111,7 @@ -s -p -S -d -hdachs -L -std-vga -no-acpi -no-reboot -loadvm \ -semihosting -cpu -bt -vga -drive -startdate -name -curses \ -no-frame -no-quit -bootp -echr -no-shutdown -icount -g \ - -prom-env -h -help -version -numa -mtdblock -sd -pflash \ + -prom-env -help -version -numa -mtdblock -sd -pflash \ -device -uuid -alt-grab -sdl -portrait -rtc-td-hack -no-hpet \ -balloon -acpitable -smbios -singlestep -gdb -hdachs -bios \ -kernel-kqemu -enable-kqemu -enable-kvm -clock -watchdog \ @@ -121,7 +121,7 @@ _filedir fi } && -complete -F _qemu $filenames qemu +complete -F _qemu -o filenames qemu # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/quota-tools bash-completion-1.2/contrib/quota-tools --- bash-completion-1.1/contrib/quota-tools 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/quota-tools 2010-06-13 11:21:19.000000000 +0100 @@ -35,8 +35,7 @@ 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 @@ -58,15 +57,14 @@ _user_or_group fi } -complete -F _quota $default quota +complete -F _quota -o default quota _setquota() { 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 @@ -98,15 +96,14 @@ fi } -complete -F _setquota $default setquota +complete -F _setquota -o default setquota _edquota() { 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 @@ -115,7 +112,7 @@ _quota_formats return 0 ;; - -@(f|-filesystem)) + -f|--filesystem) _filesystems return 0 ;; @@ -131,15 +128,14 @@ _user_or_group fi } -complete -F _edquota $default edquota +complete -F _edquota -o default edquota _quotacheck() { 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 @@ -161,15 +157,14 @@ _filesystems fi } -complete -F _quotacheck $default quotacheck +complete -F _quotacheck -o default quotacheck _repquota() { 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 @@ -191,15 +186,14 @@ _filesystems fi } -complete -F _repquota $default repquota +complete -F _repquota -o default repquota _quotaon() { 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 @@ -219,15 +213,14 @@ _filesystems fi } -complete -F _quotaon $default quotaon +complete -F _quotaon -o default quotaon _quotaoff() { 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 @@ -236,7 +229,7 @@ _quota_formats return 0 ;; - -@(x|-xfs-command)) + -x|--xfs-command) COMPREPLY=( $( compgen -W 'delete enforce' -- "$cur" ) ) return 0 ;; @@ -252,7 +245,7 @@ _filesystems fi } -complete -F _quotaoff $default quotaoff +complete -F _quotaoff -o default quotaoff } # Local variables: diff -Nru bash-completion-1.1/contrib/rcs bash-completion-1.2/contrib/rcs --- bash-completion-1.1/contrib/rcs 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/rcs 2010-06-13 11:21:19.000000000 +0100 @@ -6,8 +6,7 @@ local cur prev file dir i COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev file=${cur##*/} dir=${cur%/*} @@ -31,9 +30,9 @@ # default to files if nothing returned and we're checking in. # otherwise, default to directories - [ ${#COMPREPLY[@]} -eq 0 -a $1 = ci ] && _filedir || _filedir -d + [[ ${#COMPREPLY[@]} -eq 0 && $1 == ci ]] && _filedir || _filedir -d } && -complete -F _rcs $filenames ci co rlog rcs rcsdiff +complete -F _rcs -o filenames ci co rlog rcs rcsdiff # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/rdesktop bash-completion-1.2/contrib/rdesktop --- bash-completion-1.1/contrib/rdesktop 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/rdesktop 2010-06-13 11:21:19.000000000 +0100 @@ -6,14 +6,13 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in -k) COMPREPLY=( $( command ls \ /usr/share/rdesktop/keymaps 2>/dev/null | \ - egrep -v '(common|modifiers)' ) ) + command grep -E -v '(common|modifiers)' ) ) COMPREPLY=( ${COMPREPLY[@]:-} $( command ls \ $HOME/.rdesktop/keymaps 2>/dev/null ) ) COMPREPLY=( ${COMPREPLY[@]:-} $( command ls \ @@ -31,7 +30,7 @@ return 0 ;; -r) - # FIXME: should do $nospace for the colon options + # FIXME: should do -o nospace for the colon options COMPREPLY=( $( compgen -W 'comport: disk: lptport: \ printer: sound: lspci scard' -- "$cur" ) ) return 0 diff -Nru bash-completion-1.1/contrib/repomanage bash-completion-1.2/contrib/repomanage --- bash-completion-1.1/contrib/repomanage 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/repomanage 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ -# bash completion for repomanage - -have repomanage && -_repomanage() -{ - local cur prev - - COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} - - [[ "$prev" == -@(h|-help|k|-keep) ]] && return 0 - - if [[ "$cur" == -* ]] ; then - COMPREPLY=( $( compgen -W '-o --old -n --new -s --space -k \ - --keep -c --nocheck -h --help' -- "$cur" ) ) - else - _filedir -d - fi -} && -complete -F _repomanage $filenames repomanage - -# Local variables: -# mode: shell-script -# sh-basic-offset: 4 -# sh-indent-comment: t -# indent-tabs-mode: nil -# End: -# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/reportbug bash-completion-1.2/contrib/reportbug --- bash-completion-1.1/contrib/reportbug 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/reportbug 2010-06-13 11:21:19.000000000 +0100 @@ -6,10 +6,9 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -f|--filename|-i|--include|--mta|-o|--output) _filedir return 0 @@ -42,7 +41,7 @@ COMPREPLY=( $( compgen -W "gnats debbugs" -- "$cur" ) ) return 0 ;; - -T|--tags) + -T|--tag) COMPREPLY=( $( compgen -W "none \ woody potato sarge sarge-ignore etch etch-ignore \ lenny lenny-ignore sid experimental confirmed \ @@ -51,23 +50,30 @@ unreproducible upstream wontfix ipv6 lfs" -- "$cur" )) return 0 ;; + --from-buildd) + COMPREPLY=( $( compgen -S "_" -W '$( apt-cache dumpavail | \ + command grep "^Source: $cur" | sort -u | cut -f2 -d" " )' )) + return 0 + ;; *) ;; esac - COMPREPLY=($( compgen -W '-h --help -v --version -a --af -b \ - --no-query-bts --query-bts -B --bts -c --configure \ - --no-config-files --check-available -d --debug \ - --no-check-available -e --editor --email -f \ - --filename -g --gnupg -H --header -i --include -j \ - --justification -l --ldap --no-ldap -L --list-cc -m \ - --maintonly --mode --mua --mta --mutt -n --mh --nmh \ - -o --output -p --print -P --pgp --proxy --http_proxy\ - -q --quiet -Q --query-only --realname --report-quiet \ - --reply-to --replyto -s --subject -S --severity \ - --smtphost -t --type -T --tags --template -V -x \ - --no-cc --package-version -z --no-compress \ - --ui --interface -u \ + COMPREPLY=($( compgen -W '--help --version --attach \ + --no-query-bts --query-bts --bts --body --body-file --bodyfile \ + --no-config-files --class --configure --check-available --debug \ + --no-check-available --debconf --test --draftpath --editor --email \ + --exit-prompt --filename --from-buildd --gnupg --gpg --path --gnus \ + --header --include --no-check-installed --check-installed \ + --justification --kudos --keyid --license --list-cc \ + --maintonly --mirror --mode --mua --mta --mutt --mh --nmh \ + --bugnumber --no-bug-script --no-cc-menu --output --offline \ + --print --paranoid --no-paranoid --pgp --proxy --http_proxy \ + --pseudo-header --quiet --query-only --query-source --no-query-source \ + --realname --report-quiet --reply-to --replyto --subject --severity \ + --smtphost --timeout --tls --smtpuser --smtppasswd --src --source --type \ + --tag --template --verify --no-verify --no-cc --package-version \ + --no-compress --ui --interface \ wnpp boot-floppies kernel bugs.debian.org \ cdimage.debian.org general installation-reports \ listarchives lists.debian.org mirrors nm.debian.org \ @@ -78,7 +84,7 @@ _filedir return 0 } && -complete -F _reportbug $filenames reportbug +complete -F _reportbug -o filenames reportbug have querybts && _querybts() @@ -86,12 +92,11 @@ 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 - case "$prev" in + case $prev in -B|--bts) COMPREPLY=( $( compgen -W "debian guug kde mandrake help" \ -- "$cur" )) @@ -116,7 +121,7 @@ www.debian.org' -- "$cur" ) \ $( apt-cache pkgnames -- "$cur" 2> /dev/null) ) } && -complete -F _querybts $filenames querybts +complete -F _querybts -o filenames querybts # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/resolvconf bash-completion-1.2/contrib/resolvconf --- bash-completion-1.1/contrib/resolvconf 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/resolvconf 2010-06-13 11:21:19.000000000 +0100 @@ -6,11 +6,10 @@ local cur command COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in - -@(a|d)) + -a|-d) _available_interfaces return 0 ;; diff -Nru bash-completion-1.1/contrib/rfkill bash-completion-1.2/contrib/rfkill --- bash-completion-1.1/contrib/rfkill 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/rfkill 2010-06-13 11:21:19.000000000 +0100 @@ -6,7 +6,7 @@ local cur prev COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur prev if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '--version' -- "$cur" ) ) @@ -17,8 +17,7 @@ -- "$cur" ) ) ;; 2) - prev=${COMP_WORDS[COMP_CWORD-1]} - if [ $prev == block -o $prev == unblock ]; then + if [[ $prev == block || $prev == unblock ]]; then COMPREPLY=( $( compgen -W "$(rfkill list | awk -F: \ '/^[0-9]/ {print $1}') all wifi bluetooth uwb wimax \ wwan gps" -- "$cur" ) ) diff -Nru bash-completion-1.1/contrib/ri bash-completion-1.2/contrib/ri --- bash-completion-1.1/contrib/ri 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/ri 2010-06-13 11:21:19.000000000 +0100 @@ -38,7 +38,7 @@ local -a classes COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur ri_path=$(type -p ri) # which version of ri are we using? @@ -64,33 +64,33 @@ # integrated ri from Ruby 1.9 classes=( $( ri -c | ruby -ne 'if /^\s*$/..$stdin.eof then \ if /, [A-Z]+/ then print; end; end' ) ) - elif [ "$ri_version" = "ri 1.8a" ]; then - classes=( $( ruby -W0 $ri_path | \ + elif [ "$ri_version" = "ri 1.8a" ]; then + classes=( $( ruby -W0 $ri_path | \ ruby -ne 'if /^'"'"'ri'"'"' has/..$stdin.eof then \ if /^ .*[A-Z]/ then print; end; end' )) - else - classes=( $( ruby -W0 $ri_path | \ - ruby -ne 'if /^I have/..$stdin.eof then \ + else + classes=( $( ruby -W0 $ri_path | \ + ruby -ne 'if /^I have/..$stdin.eof then \ if /^ .*[A-Z]/ then print; end; end' )) - fi + fi + + COMPREPLY=( $( compgen -W '${classes[@]}' -- "$cur" ) ) + if [[ "$cur" == [A-Z]* ]]; then + # we're completing on class or module alone + return 0 + fi - COMPREPLY=( $( compgen -W '${classes[@]}' -- "$cur" ) ) - if [[ "$cur" == [A-Z]* ]]; then - # we're completing on class or module alone - return 0 - fi - - # we're completing on methods - method=$cur - ri_get_methods - } - complete -F _ri ri - } - - # Local variables: - # mode: shell-script - # sh-basic-offset: 4 - # sh-indent-comment: t - # indent-tabs-mode: nil - # End: - # ex: ts=4 sw=4 et filetype=sh + # we're completing on methods + method=$cur + ri_get_methods +} +complete -F _ri ri +} + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/rpcdebug bash-completion-1.2/contrib/rpcdebug --- bash-completion-1.1/contrib/rpcdebug 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/rpcdebug 2010-06-13 11:21:19.000000000 +0100 @@ -14,7 +14,7 @@ if [ -n "$module" ]; then COMPREPLY=( $( compgen -W "$(rpcdebug -vh 2>&1 \ - | grep '^'$module' '\ + | command grep '^'$module' '\ | awk '{$1 = ""; print $0}')" -- "$cur" ) ) fi } @@ -24,8 +24,7 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in -s) diff -Nru bash-completion-1.1/contrib/rpm bash-completion-1.2/contrib/rpm --- bash-completion-1.1/contrib/rpm 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/rpm 2010-06-13 11:21:19.000000000 +0100 @@ -7,12 +7,15 @@ { local nodig="$1" nosig="$2" - if [ -r /var/log/rpmpkgs -a \ - /var/log/rpmpkgs -nt /var/lib/rpm/Packages ]; then + if [[ -r /var/log/rpmpkgs && \ + /var/log/rpmpkgs -nt /var/lib/rpm/Packages ]]; then # using RHL 7.2 or later - this is quicker than querying the DB - COMPREPLY=( $( sed -ne \ - 's|^\('$cur'[^[:space:]]*\)-[^[:space:]-]\+-[^[:space:]-]\+\.rpm$|\1|p' \ - /var/log/rpmpkgs ) ) + COMPREPLY=( $( compgen -W "$( sed -ne \ + 's|^\([^[:space:]]\{1,\}\)-[^[:space:]-]\{1,\}-[^[:space:]-]\{1,\}\.rpm$|\1|p' \ + /var/log/rpmpkgs )" -- "$cur" ) ) + elif type rpmqpack &>/dev/null ; then + # SUSE's rpmqpack is faster than rpm -qa + COMPREPLY=( $( compgen -W '$( rpmqpack )' -- "$cur" ) ) else _rpm_nodigsig COMPREPLY=( $( rpm -qa $nodig $nosig --qf='%{NAME} ' "$cur*" ) ) @@ -30,7 +33,7 @@ _rpm_nodigsig() { - if [ -z "$nodig" -a -z "$nosig" ]; then + if [[ -z "$nodig" && -z "$nosig" ]]; then local rpmver rpmver=$(rpm --version) @@ -52,15 +55,14 @@ local cur prev opts nodig nosig COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev nodig="" nosig="" _rpm_nodigsig if [ $COMP_CWORD -eq 1 ]; then # first parameter on line - case "$cur" in + case $cur in -b*) COMPREPLY=( $( compgen -W '-ba -bb -bc -bi -bl -bp -bs' \ -- "$cur" ) ) @@ -86,16 +88,16 @@ return 0 fi - case "$prev" in - --@(@(db|exclude)path|prefix|relocate|root)) + case $prev in + --dbpath|--excludepath|--prefix|--relocate|--root) _filedir -d return 0 ;; --eval|-E) # get a list of macros - COMPREPLY=( $( rpm --showrc | sed -ne \ - 's/^-\?[0-9]\+[:=][[:space:]]\+\('${cur#%}'[^[:space:](]*\).*/\1/p' ) ) - COMPREPLY=( "${COMPREPLY[@]/#/%}" ) + COMPREPLY=( $( compgen -W "$( rpm --showrc | sed -ne \ + 's/^-\{0,1\}[0-9]\{1,\}[:=][[:space:]]\{1,\}\([^[:space:](]\{3,\}\).*/%\1/p' )" \ + -- "$cur" ) ) return 0 ;; --pipe) @@ -136,7 +138,7 @@ ;; --target) COMPREPLY=( $( compgen -W "$( command rpm --showrc | sed -ne \ - 's/^\s*compatible\s\+build\s\+archs\s*:\s*\(.*\)/\1/ p' )" \ + 's/^\s*compatible\s\s*build\s\s*archs\s*:\s*\(.*\)/\1/ p' )" \ -- "$cur" ) ) return 0 ;; @@ -150,8 +152,8 @@ opts="--define --eval --macros --nodigest --nosignature --rcfile \ --quiet --pipe --verbose" - case "${COMP_WORDS[1]}" in - -@([iFU]*|-install|-freshen|-upgrade)) + case ${COMP_WORDS[1]} in + -[iFU]*|--install|--freshen|--upgrade) if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W "$opts --percent --force \ --test --replacepkgs --replacefiles --root \ @@ -165,7 +167,7 @@ _filedir 'rpm' fi ;; - -@(e|-erase)) + -e|--erase) if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W "$opts --allmatches \ --noscripts --notriggers --nodeps --test --repackage" \ @@ -174,7 +176,7 @@ _rpm_installed_packages "$nodig" "$nosig" fi ;; - -@(q*|-query)) + -q*|--query) # options common to all query types opts="$opts --changelog --configfiles --conflicts --docfiles --dump --enhances --filesbypkg --filecaps --fileclass @@ -212,7 +214,7 @@ fi fi ;; - -@(K*|-checksig)) + -K*|--checksig) if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W "$opts --nopgp --nogpg --nomd5" \ -- "$cur" ) ) @@ -220,7 +222,7 @@ _filedir 'rpm' fi ;; - -@([Vy]*|-verify)) + -[Vy]*|--verify) if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W "$opts --root --dbpath --nodeps \ --nogroup --nolinkto --nomode --nomtime --nordev --nouser \ @@ -248,7 +250,7 @@ _filedir '@(t?(ar.)@([gx]z|bz?(2))|tar.@(lzma|Z))' fi ;; - --re@(build|compile)) + --rebuild|--recompile) if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W "$opts --nodeps --rmsource \ --rmspec --sign --nodirtokens --target" -- "$cur" ) ) @@ -259,13 +261,13 @@ --tarbuild) _filedir '@(t?(ar.)@([gx]z|bz?(2))|tar.@(lzma|Z))' ;; - --@(re|add)sign) + --resign|--addsign) _filedir 'rpm' ;; - --set@(perms|gids)) + --setperms|--setgids) _rpm_installed_packages "$nodig" "$nosig" ;; - --@(clean|rms@(ource|pec))) + --clean|--rmsource|--rmspec) if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '--clean --rmsource --rmspec' \ -- "$cur" ) ) @@ -273,7 +275,7 @@ _filedir 'spec' fi ;; - --@(import|dbpath|root)) + --import|--dbpath|--root) if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '--import --dbpath --root' \ -- "$cur" ) ) @@ -285,7 +287,7 @@ return 0 } -complete -F _rpm $filenames rpm rpmbuild +complete -F _rpm -o filenames rpm rpmbuild } # Local variables: diff -Nru bash-completion-1.1/contrib/rpmcheck bash-completion-1.2/contrib/rpmcheck --- bash-completion-1.1/contrib/rpmcheck 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/rpmcheck 2010-06-13 11:21:19.000000000 +0100 @@ -6,8 +6,7 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in -base) diff -Nru bash-completion-1.1/contrib/rrdtool bash-completion-1.2/contrib/rrdtool --- bash-completion-1.1/contrib/rrdtool 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/rrdtool 2010-06-13 11:21:19.000000000 +0100 @@ -3,7 +3,9 @@ have rrdtool && _rrdtool () { - cur=`_get_cword` + local cur + _get_comp_words_by_ref cur + COMPREPLY=( $( compgen -W 'create update updatev graph dump restore last \ lastupdate first info fetch tune resize xport' -- "$cur" ) ) } && diff -Nru bash-completion-1.1/contrib/rsync bash-completion-1.2/contrib/rsync --- bash-completion-1.1/contrib/rsync 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/rsync 2010-06-13 11:21:19.000000000 +0100 @@ -5,92 +5,83 @@ { # TODO: _split_longopt - local cur prev shell i userhost path - COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + local cur prev + _get_comp_words_by_ref -n : cur prev _expand || return 0 - case "$prev" in - --@(config|password-file|include-from|exclude-from)) - _filedir - return 0 - ;; - -@(T|-temp-dir|-compare-dest)) - _filedir -d - return 0 - ;; - -@(e|-rsh)) - COMPREPLY=( $( compgen -W 'rsh ssh' -- "$cur" ) ) - return 0 - ;; + case $prev in + --config|--password-file|--include-from|--exclude-from) + _filedir + return 0 + ;; + -T|--temp-dir|--compare-dest) + _filedir -d + return 0 + ;; + -e|--rsh) + COMPREPLY=( $( compgen -W 'rsh ssh' -- "$cur" ) ) + return 0 + ;; + --compress-level) + COMPREPLY=( $( compgen -W '1 2 3 4 5 6 7 8 9' -- "$cur" ) ) + return 0 + ;; esac - case "$cur" in - -*) - COMPREPLY=( $( compgen -W '-v -q -c -a -r -R -b -u -l -L -H \ - -p -o -g -D -t -S -n -W -x -B -e -C -I -T -P \ - -z -h -4 -6 --verbose --quiet --checksum \ - --archive --recursive --relative --backup \ - --backup-dir --suffix= --update --links \ - --copy-links --copy-unsafe-links --safe-links \ - --hard-links --perms --owner --group --devices\ - --times --sparse --dry-run --whole-file \ - --no-whole-file --one-file-system \ - --block-size= --rsh= --rsync-path= \ - --cvs-exclude --existing --ignore-existing \ - --delete --delete-excluded --delete-after \ - --ignore-errors --max-delete= --partial \ - --force --numeric-ids --timeout= \ - --ignore-times --size-only --modify-window= \ - --temp-dir= --compare-dest= --compress \ - --exclude= --exclude-from= --include= \ - --include-from= --version --daemon --no-detach\ - --address= --config= --port= --blocking-io \ - --no-blocking-io --stats --progress \ - --log-format= --password-file= --bwlimit= \ - --write-batch= --read-batch= --help' -- "$cur" )) - ;; - *:*) - # find which remote shell is used - shell=ssh - for (( i=1; i < COMP_CWORD; i++ )); do - if [[ "${COMP_WORDS[i]}" == -@(e|-rsh) ]]; then - shell=${COMP_WORDS[i+1]} - break - fi - done - if [[ "$shell" == ssh ]]; then - # remove backslash escape from : - cur=${cur/\\:/:} - userhost=${cur%%?(\\):*} - path=${cur#*:} - # unescape spaces - path=${path//\\\\\\\\ / } - if [ -z "$path" ]; then - # default to home dir of specified - # user on remote host - path=$(ssh -o 'Batchmode yes' $userhost pwd 2>/dev/null) + case $cur in + -*) + COMPREPLY=( $( compgen -W '--verbose --quiet --no-motd --checksum \ + --archive --recursive --relative --no-implied-dirs \ + --backup --backup-dir --suffix= --update --inplace --append \ + --append-verify --dirs --old-dirs --links --copy-links \ + --copy-unsafe-links --safe-links --copy-dirlinks \ + --keep-dirlinks --hard-links --perms --executability --chmod= \ + --acls --xattrs --owner --group --devices --copy-devices \ + --specials --times --omit-dir-times --super --fake-super \ + --sparse --dry-run --whole-file --no-whole-file \ + --one-file-system --block-size= --rsh= --rsync-path= \ + --existing --ignore-existing --remove-source-files --delete \ + --delete-before --delete-during --delete-delay --delete-after \ + --delete-excluded --ignore-errors --force --max-delete= \ + --max-size= --min-size= --partial --partial-dir= \ + --delay-updates --prune-empty-dirs --numeric-ids --timeout= \ + --contimeout= --ignore-times --size-only --modify-window= \ + --temp-dir= --fuzzy --compare-dest= --copy-dest= --link-dest= \ + --compress --compress-level= --skip-compress= --cvs-exclude \ + --filter= --exclude= --exclude-from= --include= \ + --include-from= --files-from= --from0 --protect-args \ + --address= --port= --sockopts= --blocking-io --no-blocking-io \ + --stats --8-bit-output --human-readable --progress \ + --itemize-changes --out-format= --log-file= \ + --log-file-format= --password-file= --list-only --bwlimit= \ + --write-batch= --only-write-batch= --read-batch= --protocol= \ + --iconv= --ipv4 --ipv6 --version --help --daemon --config= \ + --no-detach' -- "$cur" ) ) + ;; + *:*) + if type _scp_remote_files &>/dev/null; then + # find which remote shell is used + local i shell=ssh + for (( i=1; i < COMP_CWORD; i++ )); do + if [[ "${COMP_WORDS[i]}" == -@(e|-rsh) ]]; then + shell=${COMP_WORDS[i+1]} + break + fi + done + [ "$shell" = ssh ] && _scp_remote_files fi - # escape spaces; remove executables, aliases, pipes - # and sockets; add space at end of file names - COMPREPLY=( $( ssh -o 'Batchmode yes' $userhost \ - command ls -aF1d "$path*" 2>/dev/null | \ - sed -e 's/ /\\\\\\\ /g' -e 's/[*@|=]$//g' \ - -e 's/[^\/]$/& /g' ) ) - fi - ;; - *) - _known_hosts_real -c -a "$cur" - _filedir - ;; + ;; + *) + _known_hosts_real -c -a "$cur" + type _scp_local_files &>/dev/null && _scp_local_files || _filedir + ;; esac return 0 } && -complete -F _rsync $nospace $filenames rsync +complete -F _rsync -o nospace rsync # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/rtcwake bash-completion-1.2/contrib/rtcwake --- bash-completion-1.1/contrib/rtcwake 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/rtcwake 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,40 @@ +# bash completion for rtcwake + +have rtcwake && +_rtcwake() +{ + COMPREPLY=() + local cur prev split=false + _get_comp_words_by_ref cur prev + + _split_longopt && split=true + + case "$prev" in + --help|-h|--version|-V|--seconds|-s|--time|-t) + return 0 + ;; + --mode|-m) + COMPREPLY=( $( compgen -W 'standby mem disk on no off' -- "$cur" ) ) + return 0 + ;; + --device|-d) + COMPREPLY=( $( command ls -d /dev/rtc?* 2>/dev/null ) ) + COMPREPLY=( $( compgen -W '${COMPREPLY[@]#/dev/}' -- "$cur" ) ) + return 0 + ;; + esac + + $split && return 0 + + COMPREPLY=( $( compgen -W '--device --local --mode --seconds --time --utc \ + --verbose --version --help' -- "$cur" ) ) +} && +complete -F _rtcwake rtcwake + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/samba bash-completion-1.2/contrib/samba --- bash-completion-1.1/contrib/samba 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/samba 2010-06-13 11:21:19.000000000 +0100 @@ -32,8 +32,7 @@ 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 @@ -99,13 +98,12 @@ 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 case $prev in - -@(o|f|-outputfile|-rcfile)) + -o|-f|--outputfile|--rcfile) _filedir return 0; ;; @@ -132,8 +130,7 @@ 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 @@ -166,8 +163,7 @@ 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 @@ -190,8 +186,8 @@ if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '-u -L -F -S -n -t -v -h --help -V \ - -s -d --debuglevel -l --log-basename -N -k -A \ - --authentication-file -U --user' -- "$cur" ) ) + -s --debuglevel --log-basename -N -k \ + --authentication-file --user' -- "$cur" ) ) fi } complete -F _smbcquotas smbcquotas @@ -201,8 +197,7 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in -r) @@ -235,11 +230,10 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in - -@(r|t)) + -r|-t) _filedir tar return 0; ;; @@ -265,8 +259,7 @@ 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 diff -Nru bash-completion-1.1/contrib/sbcl bash-completion-1.2/contrib/sbcl --- bash-completion-1.1/contrib/sbcl 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/sbcl 2010-06-13 11:21:19.000000000 +0100 @@ -7,7 +7,7 @@ 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 @@ -20,7 +20,7 @@ return 0 } && -complete -F _sbcl $filenames sbcl sbcl-mt +complete -F _sbcl -o filenames sbcl sbcl-mt # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/screen bash-completion-1.2/contrib/screen --- bash-completion-1.1/contrib/screen 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/screen 2010-06-13 11:21:19.000000000 +0100 @@ -8,30 +8,29 @@ if [ -n "$1" ]; then pattern=".*$1.*" else - pattern=".*" + pattern=".*" fi COMPREPLY=( $( command screen -ls | sed -ne \ - 's|^['$'\t'']\+\('"$cur"'[0-9]\+\.[^'$'\t'']\+\)'"$pattern"'$|\1|p' ) ) + 's|^['$'\t'']\{1,\}\('"$cur"'[0-9]\{1,\}\.[^'$'\t'']\{1,\}\)'"$pattern"'$|\1|p' ) ) } && _screen() { - local cur prev preprev + local cur prev words cword COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev words cword - [ "$COMP_CWORD" -ge 2 ] && preprev=${COMP_WORDS[COMP_CWORD-2]} - - case "$preprev" in - -[dD]) - _screen_sessions - return 0 - ;; - esac + if ((cword > 2)); then + case ${words[cword-2]} in + -[dD]) + _screen_sessions + return 0 + ;; + esac + fi - case "$prev" in + case $prev in -[rR]) # list detached _screen_sessions 'Detached' @@ -43,8 +42,8 @@ return 0 ;; -s) - # shells - COMPREPLY=( $( grep ^${cur:-[^#]} /etc/shells ) ) + _shells + return 0 ;; -c) _filedir @@ -53,12 +52,12 @@ esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-a -A -c -d -D -e -f -fn -fa -h -i \ - -l -ln -ls -list -L -m -O -p -q -r -R -s -S -t -U -v \ - -wipe -x -X' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '-a -A -c -d -D -e -f -fn -fa -h -i -ln \ + -list -L -m -O -p -q -r -R -s -S -t -U -v -wipe -x -X --help \ + --version' -- "$cur" ) ) fi } && -complete -F _screen $default screen +complete -F _screen -o default screen # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/service bash-completion-1.2/contrib/service --- bash-completion-1.1/contrib/service 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/service 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,45 @@ +# service(8) and /etc/init.d/* completion + +# This completes on a list of all available service scripts for the +# 'service' command and/or the SysV init.d directory, followed by +# that script's available commands +# +{ have service || [ -d /etc/init.d/ ]; } && +_service() +{ + local cur prev sysvdir + + COMPREPLY=() + _get_comp_words_by_ref cur prev + + # don't complete for things like killall, ssh and mysql if it's + # the standalone command, rather than the init script + [[ ${COMP_WORDS[0]} != @(*init.d/!(functions|~)|service) ]] && return 0 + + # don't complete past 2nd token + [ $COMP_CWORD -gt 2 ] && return 0 + + [ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d || sysvdir=/etc/init.d + + if [[ $COMP_CWORD -eq 1 ]] && [[ $prev == "service" ]]; then + _services + else + COMPREPLY=( $( compgen -W '`sed -e "y/|/ /" \ + -ne "s/^.*\(U\|msg_u\)sage.*{\(.*\)}.*$/\2/p" \ + $sysvdir/${prev##*/} 2>/dev/null`' -- "$cur" ) ) + fi + + return 0 +} && +complete -F _service service +[ -d /etc/init.d/ ] && complete -F _service -o default \ + $(for i in /etc/init.d/*; do + complete -p ${i##*/} &>/dev/null || printf '%s\n' ${i##*/}; done) + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/shadow bash-completion-1.2/contrib/shadow --- bash-completion-1.1/contrib/shadow 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/shadow 2010-06-13 11:21:19.000000000 +0100 @@ -6,15 +6,14 @@ 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 # TODO: if -o/--non-unique is given, could complete on existing uids # with -u/--uid - case "$prev" in + case $prev in -c|--comment|-h|--help|-e|--expiredate|-f|--inactive|-k|--key|-p|--password|-u|--uid|-Z|--selinux-user) return 0 ;; @@ -24,14 +23,12 @@ ;; -g|--gid) _gids - [ -n "$bash205" ] && \ - COMPREPLY=( "${COMPREPLY[@]}" $( compgen -g ) ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '${COMPREPLY[@]} $( compgen -g )' \ + -- "$cur" ) ) return 0 ;; -G|--groups) - [ -n "$bash205" ] && \ - COMPREPLY=( $( compgen -g -- "$cur" ) ) + COMPREPLY=( $( compgen -g -- "$cur" ) ) return 0 ;; -s|--shell) @@ -43,12 +40,11 @@ $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-b --base-dir -c --comment -d --home\ - -D --defaults -e --expiredate -f --inactive -g --gid \ - -G --groups -h --help -k --skel -K --key -l -M \ - -m --create-home -N --no-user-group -o --non-unique \ - -p --password -r --system -s --shell -u --uid \ - -U --user-group -Z --selinux-user' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--base-dir --comment --home-dir --defaults \ + --expiredate --inactive --gid --groups --help --skel --key \ + --no-log-init --create-home --no-create-home --no-user-group \ + --non-unique --password --system --shell --uid --user-group \ + --selinux-user' -- "$cur" ) ) return 0 fi } && @@ -60,28 +56,25 @@ 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 # TODO: if -o/--non-unique is given, could complete on existing uids # with -u/--uid - case "$prev" in + case $prev in -c|--comment|-d|--home|-e|--expiredate|-f|--inactive|-h|--help|-l|--login|-p|--password|-u|--uid|-Z|--selinux-user) return 0 ;; -g|--gid) _gids - [ -n "$bash205" ] && \ - COMPREPLY=( "${COMPREPLY[@]}" $( compgen -g ) ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '${COMPREPLY[@]} $( compgen -g )' \ + -- "$cur" ) ) return 0 ;; -G|--groups) - [ -n "$bash205" ] && \ - COMPREPLY=( $( compgen -g -- "$cur" ) ) + COMPREPLY=( $( compgen -g -- "$cur" ) ) return 0 ;; -s|--shell) @@ -94,11 +87,10 @@ if [[ "$cur" == -* ]]; then # TODO: -U/--unlock, -p/--password, -L/--lock mutually exclusive - COMPREPLY=( $( compgen -W '-a --append -c --comment -d --home \ - -e --expiredate -f --inactive -g --gid -G --groups \ - -h --help -l --login -L --lock -o --non-unique \ - -p --password -s --shell -u --uid -U --unlock \ - -Z --selinux-user' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--append --comment --home --expiredate \ + --inactive --gid --groups --help --login --lock --move-home \ + --non-unique --password --shell --uid --unlock --selinux-user' \ + -- "$cur" ) ) return 0 fi @@ -112,11 +104,10 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-f --force -h --help -r --remove' \ - -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--force --help --remove' -- "$cur" ) ) return 0 fi @@ -130,12 +121,11 @@ 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 - case "$prev" in + case $prev in -d|--lastday|-E|--expiredate|-h|--help|-I|--inactive|-m|--mindays|-M|--maxdays|-W|--warndays) return 0 ;; @@ -144,9 +134,8 @@ $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-d --lastday -E --expiredate \ - -h --help -I --inactive -l --list -m --mindays \ - -M --maxdays -W --warndays' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--lastday --expiredate --help --inactive \ + --list --mindays --maxdays --warndays' -- "$cur" ) ) return 0 fi @@ -160,10 +149,9 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -n|-x|-w|-i|-\?|--help|--usage) return 0 ;; @@ -185,12 +173,11 @@ 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 - case "$prev" in + case $prev in -c|--crypt) COMPREPLY=( $( compgen -W 'DES MD5 NONE SHA256 SHA512' \ -- "$cur" ) ) @@ -204,8 +191,8 @@ $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-c --crypt-method -e --encrypted \ - -h --help -m --md5 -s --sha-rounds' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--crypt-method --encrypted \ + --help --md5 --sha-rounds' -- "$cur" ) ) return 0 fi } && @@ -217,12 +204,11 @@ 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 - case "$prev" in + case $prev in -c|--crypt) COMPREPLY=( $( compgen -W 'DES MD5 NONE SHA256 SHA512' \ -- "$cur" ) ) @@ -236,14 +222,14 @@ $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-c --crypt-method --r --system \ - -s --sha-rounds' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--crypt-method --help --system \ + --sha-rounds' -- "$cur" ) ) return 0 fi _filedir } && -complete -F _newusers $filenames newusers +complete -F _newusers -o filenames newusers have pwck && _pwck() @@ -251,7 +237,7 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '-q -r -s' -- "$cur" ) ) @@ -260,7 +246,7 @@ _filedir } && -complete -F _pwck $filenames pwck +complete -F _pwck -o filenames pwck have groupadd && _groupadd() @@ -268,15 +254,14 @@ 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 # TODO: if -o/--non-unique is given, could complete on existing gids # with -g/--gid - case "$prev" in + case $prev in -g|--gid|-K|--key|-p|--password) return 0 ;; @@ -285,9 +270,8 @@ $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-f --force -g --gid -h --help \ - -K --key -o --non-unique -p --password -r --system' \ - -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--force --gid --help \ + --key --non-unique --password --system' -- "$cur" ) ) return 0 fi } && @@ -299,15 +283,14 @@ 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 # TODO: if -o/--non-unique is given, could complete on existing gids # with -g/--gid - case "$prev" in + case $prev in -g|--gid|-h|--help|-n|--new-name|-p|--password) return 0 ;; @@ -316,16 +299,16 @@ $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-g --gid -h --help -n --new-name \ - -o --non-unique -p --password' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--gid --help --new-name \ + --non-unique --password' -- "$cur" ) ) return 0 fi - [ -n "$bash205" ] && COMPREPLY=( $( compgen -g -- "$cur" ) ) + COMPREPLY=( $( compgen -g -- "$cur" ) ) } && complete -F _groupmod groupmod -[ -n "$bash205" ] && complete -g groupdel +complete -g groupdel have newgrp && _newgrp() @@ -335,7 +318,7 @@ COMPREPLY=( - ) fi } && -complete ${bash205:+-g} -F _newgrp newgrp +complete -g -F _newgrp newgrp have gpasswd && _gpasswd() @@ -343,10 +326,9 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -a|-d|-A|-M) COMPREPLY=( $( compgen -u -- "$cur" ) ) return 0 @@ -358,7 +340,7 @@ return 0 fi - [ -n "$bash205" ] && COMPREPLY=( $( compgen -g -- "$cur" ) ) + COMPREPLY=( $( compgen -g -- "$cur" ) ) } && complete -F _gpasswd gpasswd @@ -368,17 +350,15 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -a|-d) COMPREPLY=( $( compgen -u -- "$cur" ) ) return 0 ;; -g) - [ -n "$bash205" ] && \ - COMPREPLY=( $( compgen -g -- "$cur" ) ) + COMPREPLY=( $( compgen -g -- "$cur" ) ) return 0 ;; esac @@ -396,7 +376,7 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '-r -s' -- "$cur" ) ) @@ -405,7 +385,7 @@ _filedir } && -complete -F _grpck $filenames grpck +complete -F _grpck -o filenames grpck have vipw || have vigr && _vipw() @@ -413,18 +393,17 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -h|--help) return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-g --group -h --help -p --passwd \ - -q --quiet -s --shadow' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--group --help --passwd \ + --quiet --shadow' -- "$cur" ) ) return 0 fi } && @@ -436,12 +415,11 @@ 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 - case "$prev" in + case $prev in -h|--help|-l|--lock-time|-m|--maximum|-t|--time) return 0 ;; @@ -454,8 +432,8 @@ $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-a --all -h --help -l --lock-time \ - -m --maximum -r --reset -t --time -u --user' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--all --help --lock-time \ + --maximum --reset --time --user' -- "$cur" ) ) return 0 fi } && @@ -467,12 +445,11 @@ 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 - case "$prev" in + case $prev in -b|--before|-h|--help|-t|--time) return 0 ;; @@ -485,8 +462,7 @@ $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-b --before -h --help -t --time \ - -u --user' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--before --help --time --user' -- "$cur" ) ) return 0 fi } && diff -Nru bash-completion-1.1/contrib/sitecopy bash-completion-1.2/contrib/sitecopy --- bash-completion-1.1/contrib/sitecopy 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/sitecopy 2010-06-13 11:21:19.000000000 +0100 @@ -8,20 +8,20 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur - case "$cur" in + case $cur in --*) - COMPREPLY=( $( compgen -W "$(sitecopy -h | grep -e '--\w' | \ + COMPREPLY=( $( compgen -W "$(sitecopy -h | command grep -e '--\w' |\ awk '{sub (/=(FILE|PATH)/, "", $2); print $2}')" -- "$cur" ) ) ;; -*) - COMPREPLY=( $( compgen -W "$(sitecopy -h | grep -e '-\w' | \ + COMPREPLY=( $( compgen -W "$(sitecopy -h | command grep -e '-\w' | \ awk '{sub (",", "", $1); print $1}')" -- "$cur" ) ) ;; *) if [ -r ~/.sitecopyrc ]; then - COMPREPLY=( $( compgen -W "$(grep '^["$'\t '"]*site' \ + COMPREPLY=( $( compgen -W "$(command grep '^["$'\t '"]*site' \ ~/.sitecopyrc | awk '{print $2}')" -- "$cur" ) ) fi ;; @@ -29,7 +29,7 @@ return 0 } && -complete -F _sitecopy $default sitecopy +complete -F _sitecopy -o default sitecopy # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/smartctl bash-completion-1.2/contrib/smartctl --- bash-completion-1.1/contrib/smartctl 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/smartctl 2010-06-13 11:21:19.000000000 +0100 @@ -1,141 +1,138 @@ # bash completion for smartctl(8) -have smartctl && { +have smartctl && +{ _smartctl_quietmode() { - COMPREPLY=( $( compgen -W 'errorsonly silent noserial' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'errorsonly silent noserial' -- "$cur" ) ) } _smartctl_device() { - local i opts='ata scsi sat marvell hpt cciss' - for (( i=0; i <= 31; i++ )) ; do - opts="$opts 3ware,$i" - done - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) + local i opts='ata scsi sat marvell hpt cciss' + for (( i=0; i <= 31; i++ )) ; do + opts="$opts 3ware,$i" + done + COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) } _smartctl_tolerance() { - COMPREPLY=( $( compgen -W 'normal conservative permissive \ - verypermissive' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'normal conservative permissive \ + verypermissive' -- "$cur" ) ) } _smartctl_badsum() { - COMPREPLY=( $( compgen -W 'warn exit ignore' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'warn exit ignore' -- "$cur" ) ) } _smartctl_report() { - COMPREPLY=( $( compgen -W 'ioctl ataioctl scsiioctl' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'ioctl ataioctl scsiioctl' -- "$cur" ) ) } _smartctl_powermode() { - COMPREPLY=( $( compgen -W 'never sleep standby idle' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'never sleep standby idle' -- "$cur" ) ) } _smartctl_feature() { - COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) } _smartctl_log() { - COMPREPLY=( $( compgen -W 'error selftest selective directory' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'error selftest selective directory' -- "$cur" ) ) } _smartctl_vendorattribute() { - COMPREPLY=( $( compgen -W 'help 9,minutes 9,seconds 9,halfminutes \ - 9,temp 192,emergencyretractcyclect 193,loadunload \ - 194,10xCelsius 194,unknown 198,offlinescanuncsectorct \ - 200,writeerrorcount 201,detectedtacount 220,temp' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'help 9,minutes 9,seconds 9,halfminutes \ + 9,temp 192,emergencyretractcyclect 193,loadunload \ + 194,10xCelsius 194,unknown 198,offlinescanuncsectorct \ + 200,writeerrorcount 201,detectedtacount 220,temp' -- "$cur" ) ) } _smartctl_firmwarebug() { - COMPREPLY=( $( compgen -W 'none samsung samsung2 samsung3 swapid' \ + COMPREPLY=( $( compgen -W 'none samsung samsung2 samsung3 swapid' \ -- "$cur" ) ) } _smartctl_presets() { - COMPREPLY=( $( compgen -W 'use ignore show showall' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'use ignore show showall' -- "$cur" ) ) } _smartctl_test() { - COMPREPLY=( $( compgen -W 'offline short long conveyance select \ - afterselect,on afterselect,off pending scttempint' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'offline short long conveyance select \ + afterselect,on afterselect,off pending scttempint' -- "$cur" ) ) } _smartctl() { - local cur prev split=false + local cur prev split=false + + COMPREPLY=() + _get_comp_words_by_ref cur prev + + _split_longopt && split=true - COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} - - _split_longopt && split=true - - case "$prev" in - -q|--quietmode) - _smartctl_quietmode - ;; - -d|--device) - _smartctl_device - return 0 - ;; - -t|--tolerance) - _smartctl_tolerance - return 0 - ;; - -b|--badsum) - _smartctl_badsum - return 0 - ;; - -r|--report) - _smartctl_report - return 0 - ;; - -n|--nocheck) - _smartctl_powermode - return 0 - ;; - -s|--smart|-o|--offlineauto|-S|--saveauto) - _smartctl_feature - return 0 - ;; - -l|--log) - _smartctl_log - return 0 - ;; - -v|--vendorattribute) - _smartctl_vendorattribute - return 0 - ;; - -F|--firmwarebug) - _smartctl_firmwarebug - return 0 - ;; - -P|--presets) - _smartctl_presets - return 0 - ;; - -t|--test) - _smartctl_test - return 0 - ;; - esac - - $split && return 0 - - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-h --help --usage -V --version \ - --copyright --license-i --info -a --all -q \ - --quietmode -d --device -T --tolerance -b --badsum \ - -r --report -n --nocheck -s --smart -o --offlineauto \ - -S --saveauto -H --health -c --capabilities -A \ - --attributes -l --log -v --vendorattribute -F \ - --firmwarebug -P --presets -t --test -C \ - --captive -X --abort' -- "$cur" ) ) - else - cur=${cur:=/dev/} - _filedir - fi + case $prev in + -q|--quietmode) + _smartctl_quietmode + ;; + -d|--device) + _smartctl_device + return 0 + ;; + -t|--tolerance) + _smartctl_tolerance + return 0 + ;; + -b|--badsum) + _smartctl_badsum + return 0 + ;; + -r|--report) + _smartctl_report + return 0 + ;; + -n|--nocheck) + _smartctl_powermode + return 0 + ;; + -s|--smart|-o|--offlineauto|-S|--saveauto) + _smartctl_feature + return 0 + ;; + -l|--log) + _smartctl_log + return 0 + ;; + -v|--vendorattribute) + _smartctl_vendorattribute + return 0 + ;; + -F|--firmwarebug) + _smartctl_firmwarebug + return 0 + ;; + -P|--presets) + _smartctl_presets + return 0 + ;; + -t|--test) + _smartctl_test + return 0 + ;; + esac + + $split && return 0 + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--help --version --info --all --quietmode \ + --device --tolerance --badsum --report --nocheck --smart \ + --offlineauto --saveauto --health --capabilities --attributes \ + --log --vendorattribute --firmwarebug --presets --test --captive \ + --abort' -- "$cur" ) ) + else + cur=${cur:=/dev/} + _filedir + fi } complete -F _smartctl smartctl } diff -Nru bash-completion-1.1/contrib/snownews bash-completion-1.2/contrib/snownews --- bash-completion-1.1/contrib/snownews 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/snownews 2010-06-13 11:21:19.000000000 +0100 @@ -1,4 +1,4 @@ -# snownews completion by Guillaume Rousse +# snownews(1) completion have snownews && _snownews() @@ -6,7 +6,7 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then # return list of available options diff -Nru bash-completion-1.1/contrib/ssh bash-completion-1.2/contrib/ssh --- bash-completion-1.1/contrib/ssh 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/ssh 2010-06-13 11:21:19.000000000 +0100 @@ -1,108 +1,194 @@ # ssh(1) completion -have ssh && { +have ssh && +{ + +_ssh_bindaddress() +{ + COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W \ + "$( PATH="$PATH:/sbin" ifconfig -a | \ + sed -ne 's/.*addr:\([^[:space:]]*\).*/\1/p' \ + -ne 's/.*inet[[:space:]]\{1,\}\([^[:space:]]*\).*/\1/p' )" \ + -- "$cur" ) ) +} + +_ssh_ciphers() +{ + COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W '3des-cbc aes128-cbc \ + aes192-cbc aes256-cbc aes128-ctr aes192-ctr aes256-ctr arcfour128 \ + arcfour256 arcfour blowfish-cbc cast128-cbc' -- "$cur" ) ) +} + +_ssh_macs() +{ + COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W 'hmac-md5 hmac-sha1 \ + umac-64@openssh.com hmac-ripemd160 hmac-sha1-96 hmac-md5-96' \ + -- "$cur" ) ) +} -_ssh_options() { - COMPREPLY=( $( compgen -W 'AddressFamily BatchMode BindAddress \ - ChallengeResponseAuthentication CheckHostIP Cipher Ciphers \ - ClearAllForwardings Compression CompressionLevel \ - ConnectionAttempts ConnectTimeout ControlMaster ControlPath \ - DynamicForward EscapeChar ExitOnForwardFailure ForwardAgent \ - ForwardX11 ForwardX11Trusted GatewayPorts GlobalKnownHostsFile \ - GSSAPIAuthentication GSSAPIDelegateCredentials HashKnownHosts \ - Host HostbasedAuthentication HostKeyAlgorithms HostKeyAlias \ - HostName IdentityFile IdentitiesOnly KbdInteractiveDevices \ - LocalCommand LocalForward LogLevel MACs \ - NoHostAuthenticationForLocalhost NumberOfPasswordPrompts \ - PasswordAuthentication PermitLocalCommand Port \ - PreferredAuthentications Protocol ProxyCommand \ - PubkeyAuthentication RekeyLimit RemoteForward \ - RhostsRSAAuthentication RSAAuthentication SendEnv \ - ServerAliveInterval ServerAliveCountMax SmartcardDevice \ - StrictHostKeyChecking TCPKeepAlive Tunnel TunnelDevice \ - UsePrivilegedPort User UserKnownHostsFile VerifyHostKeyDNS \ - VisualHostKey XAuthLocation' -- "$cur" ) ) +_ssh_options() +{ + type compopt &>/dev/null && compopt -o nospace + COMPREPLY=( $( compgen -S = -W 'AddressFamily BatchMode BindAddress \ + ChallengeResponseAuthentication CheckHostIP Cipher Ciphers \ + ClearAllForwardings Compression CompressionLevel ConnectionAttempts \ + ConnectTimeout ControlMaster ControlPath DynamicForward EscapeChar \ + ExitOnForwardFailure ForwardAgent ForwardX11 ForwardX11Trusted \ + GatewayPorts GlobalKnownHostsFile GSSAPIAuthentication \ + GSSAPIDelegateCredentials HashKnownHosts Host HostbasedAuthentication \ + HostKeyAlgorithms HostKeyAlias HostName IdentityFile IdentitiesOnly \ + KbdInteractiveDevices LocalCommand LocalForward LogLevel MACs \ + NoHostAuthenticationForLocalhost NumberOfPasswordPrompts \ + PasswordAuthentication PermitLocalCommand Port \ + PreferredAuthentications Protocol ProxyCommand PubkeyAuthentication \ + RekeyLimit RemoteForward RhostsRSAAuthentication RSAAuthentication \ + SendEnv ServerAliveInterval ServerAliveCountMax SmartcardDevice \ + StrictHostKeyChecking TCPKeepAlive Tunnel TunnelDevice \ + UsePrivilegedPort User UserKnownHostsFile VerifyHostKeyDNS \ + VisualHostKey XAuthLocation' -- "$cur" ) ) +} + +# Complete a ssh suboption (like ForwardAgent=y) +# Only one parameter: the string to complete including the equal sign. +# Not all suboptions are completed. +# Doesn't handle comma-separated lists. +_ssh_suboption() +{ + # Split into subopt and subval + local prev=${1%%=*} cur=${1#*=} + + case $prev in + BatchMode|ChallengeResponseAuthentication|CheckHostIP|\ + ClearAllForwardings|Compression|ExitOnForwardFailure|ForwardAgent|\ + ForwardX11|ForwardX11Trusted|GatewayPorts|GSSAPIAuthentication|\ + GSSAPIKeyExchange|GSSAPIDelegateCredentials|GSSAPITrustDns|\ + HashKnownHosts|HostbasedAuthentication|IdentitiesOnly|\ + KbdInteractiveAuthentication|KbdInteractiveDevices|\ + NoHostAuthenticationForLocalhost|PasswordAuthentication|\ + PubkeyAuthentication|RhostsRSAAuthentication|RSAAuthentication|\ + StrictHostKeyChecking|TCPKeepAlive|UsePrivilegedPort|\ + VerifyHostKeyDNS|VisualHostKey) + COMPREPLY=( $( compgen -W 'yes no' -- "$cur") ) + ;; + AddressFamily) + COMPREPLY=( $( compgen -W 'any inet inet6' -- "$cur" ) ) + ;; + BindAddress) + _ssh_bindaddress + ;; + Cipher) + COMPREPLY=( $( compgen -W 'blowfish des 3des' -- "$cur" ) ) + ;; + Protocol) + COMPREPLY=( $( compgen -W '1 2 1,2 2,1' -- "$cur" ) ) + ;; + Tunnel) + COMPREPLY=( $( compgen -W 'yes no point-to-point ethernet' \ + -- "$cur" ) ) + ;; + PreferredAuthentications) + COMPREPLY=( $( compgen -W 'gssapi-with-mic host-based \ + publickey keyboard-interactive password' -- "$cur" ) ) + ;; + MACs) + _ssh_macs + ;; + Ciphers) + _ssh_ciphers + ;; + esac + return 0 +} + +# Try to complete -o SubOptions= +# +# Returns 0 if the completion was handled or non-zero otherwise. +_ssh_suboption_check() +{ + # Get prev and cur words without splitting on = + local cureq=`_get_cword :=` preveq=`_get_pword :=` + if [[ $cureq == *=* && $preveq == -o ]]; then + _ssh_suboption $cureq + return $? + fi + return 1 } _ssh() { - local cur prev configfile - local -a config + local cur prev configfile + local -a config - COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} - - case "$prev" in - -@(F|i|S)) - _filedir - return 0 - ;; - -c) - COMPREPLY=( $( compgen -W '3des-cbc aes128-cbc \ - aes192-cbc aes256-cbc aes128-ctr aes192-ctr \ - aes256-ctr arcfour128 arcfour256 arcfour \ - blowfish-cbc cast128-cbc' -- "$cur" ) ) - return 0 - ;; - -c) - COMPREPLY=( $( compgen -W 'hmac-md5 hmac-sha1 \ - umac-64@openssh.com hmac-ripemd160 \ - hmac-sha1-96 hmac-md5-96' -- "$cur" ) ) - return 0 - ;; - -l) - COMPREPLY=( $( compgen -u -- "$cur" ) ) - return 0 - ;; - -o) - _ssh_options - return 0 - ;; - -w) - _available_interfaces - return 0 - ;; - -b) - COMPREPLY=( $( compgen -W "$(/sbin/ifconfig | \ - awk '/adr:/ {print $2}' | \ - awk -F: '{print $2}' )" -- "$cur" ) ) - return 0 - ;; - esac - - if [[ "$cur" == -F* ]]; then - cur=${cur#-F} - _filedir - # Prefix completions with '-F' - COMPREPLY=( "${COMPREPLY[@]/#/-F}" ) - cur=-F$cur # Restore cur - elif [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-1 -2 -4 -6 -A -a -C -f -g -K -k -M \ - -N -n -q -s -T -t -V -v -X -v -Y -y -b -b -c -D -e -F \ - -i -L -l -m -O -o -p -R -S -w' -- "$cur" ) ) - else - # Search COMP_WORDS for '-F configfile' or '-Fconfigfile' argument - set -- "${COMP_WORDS[@]}" - while [ $# -gt 0 ]; do - if [ "${1:0:2}" = -F ]; then - if [ ${#1} -gt 2 ]; then - configfile="$(dequote "${1:2}")" - else - shift - [ "$1" ] && configfile="$(dequote "$1")" - fi - break - fi - shift - done - _known_hosts_real -a -F "$configfile" "$cur" - if [ $COMP_CWORD -ne 1 ]; then - COMPREPLY=( "${COMPREPLY[@]}" $( compgen -c -- "$cur" ) ) - fi - fi + COMPREPLY=() + _get_comp_words_by_ref -n : cur prev + #cur=`_get_cword :` + #prev=`_get_pword` + + _ssh_suboption_check && return 0 + + case $prev in + -F|-i|-S) + _filedir + return 0 + ;; + -c) + _ssh_ciphers + return 0 + ;; + -m) + _ssh_macs + return 0 + ;; + -l) + COMPREPLY=( $( compgen -u -- "$cur" ) ) + return 0 + ;; + -o) + _ssh_options + return 0 + ;; + -w) + _available_interfaces + return 0 + ;; + -b) + _ssh_bindaddress + return 0 + ;; + esac + + if [[ "$cur" == -F* ]]; then + cur=${cur#-F} + _filedir + # Prefix completions with '-F' + COMPREPLY=( "${COMPREPLY[@]/#/-F}" ) + cur=-F$cur # Restore cur + elif [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-1 -2 -4 -6 -A -a -C -f -g -K -k -M \ + -N -n -q -s -T -t -V -v -X -v -Y -y -b -b -c -D -e -F \ + -i -L -l -m -O -o -p -R -S -w' -- "$cur" ) ) + else + # Search COMP_WORDS for '-F configfile' or '-Fconfigfile' argument + set -- "${COMP_WORDS[@]}" + while [ $# -gt 0 ]; do + if [ "${1:0:2}" = -F ]; then + if [ ${#1} -gt 2 ]; then + configfile="$(dequote "${1:2}")" + else + shift + [ "$1" ] && configfile="$(dequote "$1")" + fi + break + fi + shift + done + _known_hosts_real -a -F "$configfile" "$cur" + if [ $COMP_CWORD -ne 1 ]; then + COMPREPLY=( "${COMPREPLY[@]}" $( compgen -c -- "$cur" ) ) + fi + fi - return 0 + return 0 } shopt -u hostcomplete && complete -F _ssh ssh slogin autossh @@ -110,144 +196,226 @@ # _sftp() { - local cur prev configfile + local cur prev configfile + + COMPREPLY=() + _get_comp_words_by_ref cur prev + + _ssh_suboption_check && return 0 - COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} - - case "$prev" in - -@(b|F|P)) - _filedir - return 0 - ;; - -o) - _ssh_options - return 0 - ;; - esac - - if [[ "$cur" == -F* ]]; then - cur=${cur#-F} - _filedir - # Prefix completions with '-F' - COMPREPLY=( "${COMPREPLY[@]/#/-F}" ) - cur=-F$cur # Restore cur - elif [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-1 -C -v -B -b -F -o -P -R -S -s' \ - -- "$cur" ) ) - else - # Search COMP_WORDS for '-F configfile' argument - set -- "${COMP_WORDS[@]}" - while [ $# -gt 0 ]; do - if [ "${1:0:2}" = -F ]; then - if [ ${#1} -gt 2 ]; then - configfile="$(dequote "${1:2}")" - else - shift - [ "$1" ] && configfile="$(dequote "$1")" - fi - break - fi - shift - done - _known_hosts_real -a -F "$configfile" "$cur" - fi + case $prev in + -b|-F|-P) + _filedir + return 0 + ;; + -o) + _ssh_options + return 0 + ;; + esac + + if [[ "$cur" == -F* ]]; then + cur=${cur#-F} + _filedir + # Prefix completions with '-F' + COMPREPLY=( "${COMPREPLY[@]/#/-F}" ) + cur=-F$cur # Restore cur + elif [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-1 -C -v -B -b -F -o -P -R -S -s' \ + -- "$cur" ) ) + else + # Search COMP_WORDS for '-F configfile' argument + set -- "${COMP_WORDS[@]}" + while [ $# -gt 0 ]; do + if [ "${1:0:2}" = -F ]; then + if [ ${#1} -gt 2 ]; then + configfile="$(dequote "${1:2}")" + else + shift + [ "$1" ] && configfile="$(dequote "$1")" + fi + break + fi + shift + done + _known_hosts_real -a -F "$configfile" "$cur" + fi - return 0 + return 0 } shopt -u hostcomplete && complete -F _sftp sftp +# things we want to escape in remote scp paths +_scp_path_esc="[][(){}<>\",:;^&\!$=?\`|\\ ']" + +# Complete remote files with ssh. If the first arg is -d, complete on dirs +# only. Returns paths escaped with three backslashes. +_scp_remote_files() +{ + local IFS=$'\t\n' + + # remove backslash escape from the first colon + cur=${cur/\\:/:} + + local userhost=${cur%%?(\\):*} + local path=${cur#*:} + + # unescape (3 backslashes to 1 for chars we escaped) + path=$( sed -e 's/\\\\\\\('$_scp_path_esc'\)/\\\1/g' <<<"$path" ) + + # default to home dir of specified user on remote host + if [ -z "$path" ]; then + path=$(ssh -o 'Batchmode yes' $userhost pwd 2>/dev/null) + fi + + local files + if [ "$1" = -d ] ; then + # escape problematic characters; remove non-dirs + files=$( ssh -o 'Batchmode yes' $userhost \ + command ls -aF1d "$path*" 2>/dev/null | \ + sed -e 's/'$_scp_path_esc'/\\\\\\&/g' -e '/[^\/]$/d' ) + else + # escape problematic characters; remove executables, aliases, pipes + # and sockets; add space at end of file names + files=$( ssh -o 'Batchmode yes' $userhost \ + command ls -aF1d "$path*" 2>/dev/null | \ + sed -e 's/'$_scp_path_esc'/\\\\\\&/g' -e 's/[*@|=]$//g' \ + -e 's/[^\/]$/& /g' ) + fi + COMPREPLY=( "${COMPREPLY[@]}" $files ) +} + +# This approach is used instead of _filedir to get a space appended +# after local file/dir completions, and -o nospace retained for others. +# If first arg is -d, complete on directory names only. The next arg is +# an optional prefix to add to returned completions. +_scp_local_files() +{ + local IFS=$'\t\n' + + local dirsonly=false + if [ "$1" = -d ]; then + dirsonly=true + shift + fi + + if $dirsonly ; then + COMPREPLY=( "${COMPREPLY[@]}" $( command ls -aF1d $cur* 2>/dev/null | \ + sed -e "s/$_scp_path_esc/\\\\&/g" -e '/[^\/]$/d' -e "s/^/$1/") ) + else + COMPREPLY=( "${COMPREPLY[@]}" $( command ls -aF1d $cur* 2>/dev/null | \ + sed -e "s/$_scp_path_esc/\\\\&/g" -e 's/[*@|=]$//g' \ + -e 's/[^\/]$/& /g' -e "s/^/$1/") ) + fi +} # scp(1) completion # _scp() { - local configfile cur userhost path prefix + local configfile cur prev prefix - COMPREPLY=() - cur=`_get_cword ":"` + COMPREPLY=() + _get_comp_words_by_ref -n : cur prev - _expand || return 0 + _ssh_suboption_check && { + COMPREPLY=( "${COMPREPLY[@]/%/ }" ) + return 0 + } + + case $prev in + -l|-P) + return 0 + ;; + -F|-i|-S) + _filedir + type compopt &>/dev/null && compopt +o nospace + return 0 + ;; + -c) + _ssh_ciphers + COMPREPLY=( "${COMPREPLY[@]/%/ }" ) + return 0 + ;; + -o) + _ssh_options + return 0 + ;; + esac + + _expand || return 0 + + if [[ "$cur" == *:* ]]; then + _scp_remote_files + return 0 + fi + + if [[ "$cur" == -F* ]]; then + cur=${cur#-F} + prefix=-F + else + # Search COMP_WORDS for '-F configfile' or '-Fconfigfile' argument + set -- "${COMP_WORDS[@]}" + while [ $# -gt 0 ]; do + if [ "${1:0:2}" = -F ]; then + if [ ${#1} -gt 2 ]; then + configfile="$(dequote "${1:2}")" + else + shift + [ "$1" ] && configfile="$(dequote "$1")" + fi + break + fi + shift + done + + case $cur in + -*) + COMPREPLY=( $( compgen -W '-1 -2 -4 -6 -B -C -c -F -i -l -o \ + -P -p -q -r -S -v' -- "$cur" ) ) + COMPREPLY=( "${COMPREPLY[@]/%/ }" ) + return 0 + ;; + */*) + # pass through + ;; + *) + _known_hosts_real -c -a -F "$configfile" "$cur" + ;; + esac + fi - if [[ "$cur" == *:* ]]; then - local IFS=$'\t\n' - # remove backslash escape from : - cur=${cur/\\:/:} - userhost=${cur%%?(\\):*} - path=${cur#*:} - # unescape spaces - path=${path//\\\\\\\\ / } - if [ -z "$path" ]; then - # default to home dir of specified user on remote host - path=$(ssh -o 'Batchmode yes' $userhost pwd 2>/dev/null) - fi - # escape spaces; remove executables, aliases, pipes and sockets; - # add space at end of file names - COMPREPLY=( $( ssh -o 'Batchmode yes' $userhost \ - command ls -aF1d "$path*" 2>/dev/null | \ - sed -e "s/[][(){}<>\",:;^&\!$=?\`|\\ ']/\\\\\\\\\\\\&/g" \ - -e 's/[*@|=]$//g' -e 's/[^\/]$/& /g' ) ) - return 0 - fi - - if [[ "$cur" = -F* ]]; then - cur=${cur#-F} - prefix=-F - else - # Search COMP_WORDS for '-F configfile' or '-Fconfigfile' argument - set -- "${COMP_WORDS[@]}" - while [ $# -gt 0 ]; do - if [ "${1:0:2}" = -F ]; then - if [ ${#1} -gt 2 ]; then - configfile="$(dequote "${1:2}")" - else - shift - [ "$1" ] && configfile="$(dequote "$1")" - fi - break - fi - shift - done - - [[ "$cur" == */* ]] || _known_hosts_real -c -a -F "$configfile" "$cur" - fi - # This approach is used instead of _filedir to get a space appended - # after local file/dir completions, and $nospace retained for others. - local IFS=$'\t\n' - COMPREPLY=( "${COMPREPLY[@]}" $( command ls -aF1d $cur* 2>/dev/null | sed \ - -e "s/[][(){}<>\",:;^&\!$=?\`|\\ ']/\\\\&/g" \ - -e 's/[*@|=]$//g' -e 's/[^\/]$/& /g' -e "s/^/$prefix/") ) + _scp_local_files "$prefix" - return 0 + return 0 } -complete -F _scp $nospace scp sshfs +complete -F _scp -o nospace scp # ssh-copy-id(1) completion # -_ssh_copy_id() { - local cur prev +_ssh_copy_id() +{ + local cur prev + + COMPREPLY=() + _get_comp_words_by_ref cur prev - COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} - - case "$prev" in - -i) - _filedir - return 0 - ;; - esac - - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-i' -- "$cur" ) ) - else - _known_hosts_real -a "$cur" - fi + case $prev in + -i) + _filedir + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '-i' -- "$cur" ) ) + else + _known_hosts_real -a "$cur" + fi - return 0 + return 0 } -complete -F _ssh_copy_id $filenames ssh-copy-id +complete -F _ssh_copy_id -o filenames ssh-copy-id } # Local variables: diff -Nru bash-completion-1.1/contrib/sshfs bash-completion-1.2/contrib/sshfs --- bash-completion-1.1/contrib/sshfs 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/sshfs 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,34 @@ +# sshfs(1) completion + +have sshfs && +_sshfs() +{ + local cur userhost path + + COMPREPLY=() + _get_comp_words_by_ref -n : cur + + _expand || return 0 + + if [[ "$cur" == *:* ]] && type _scp_remote_files &>/dev/null ; then + _scp_remote_files -d + # unlike scp and rsync, sshfs works with 1 backslash instead of 3 + COMPREPLY=( "${COMPREPLY[@]//\\\\\\/\\}" ) + return 0 + fi + + [[ "$cur" == */* ]] || _known_hosts_real -c -a "$cur" + + type _scp_local_files &>/dev/null && _scp_local_files -d + + return 0 +} && +complete -F _sshfs -o nospace sshfs + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/strace bash-completion-1.2/contrib/strace --- bash-completion-1.1/contrib/strace 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/strace 2010-06-13 11:21:19.000000000 +0100 @@ -9,7 +9,7 @@ offset=0 for (( i=1; i <= COMP_CWORD; i++ )); do case ${COMP_WORDS[$i]} in - -@(o|e|p)) + -o|-e|-p) i=$((i+1)) continue ;; @@ -27,8 +27,7 @@ else COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in -e) @@ -43,7 +42,7 @@ /usr/include/asm/unistd.h | sed -e \ 's/__NR_//') if [ -z "$syscalls" ]; then - if [[ "$arch" =~ 86$ ]]; then + if [[ "$arch" == *86 ]]; then unistd=/usr/include/asm/unistd_32.h else unistd=/usr/include/asm/unistd_64.h @@ -84,7 +83,7 @@ esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-c -d -f -ff -F -h --help -i -q \ + COMPREPLY=( $( compgen -W '-c -d -f -ff -F --help -i -q \ -r -t -tt -ttt -T -v -V -x -xx -a -e -o -O -p \ -s -S -u -E' -- "$cur" ) ) else @@ -92,7 +91,7 @@ fi fi } && -complete -F _strace $default strace +complete -F _strace -o default strace # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/_subversion bash-completion-1.2/contrib/_subversion --- bash-completion-1.1/contrib/_subversion 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/_subversion 2010-06-13 11:21:19.000000000 +0100 @@ -1,425 +1,423 @@ +# Use of this file is deprecated. Upstream completion is available in +# subversion >= 0.12.0, use that instead. + # svn completion have svn && { _svn() { - local cur prev commands options command + local cur prev commands options command - COMPREPLY=() - cur=`_get_cword` + COMPREPLY=() + _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 \ - info list ls lock log merge mkdir move mv rename ren \ - propdel pdel pd propedit pedit pe propget pget pg \ - proplist plist pl propset pset ps resolved revert \ - status stat st switch sw unlock update up' - - if [[ $COMP_CWORD -eq 1 ]] ; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--version' -- $cur ) ) - else - COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) - fi - else - - prev=${COMP_WORDS[COMP_CWORD-1]} - case $prev in - --config-dir) - _filedir -d - return 0; - ;; - -@(F|-file|-targets)) - _filedir - return 0; - ;; - --encoding) - COMPREPLY=( $( compgen -W \ - '$( iconv --list | sed -e "s@//@@;" )' \ - -- "$cur" ) ) - return 0; - ;; - --@(editor|diff|diff3)-cmd) - COMP_WORDS=(COMP_WORDS[0] $cur) - COMP_CWORD=1 - _command - return 0; - ;; - esac - - command=${COMP_WORDS[1]} - - if [[ "$cur" == -* ]]; then - # possible options for the command - case $command in - add) - options='--auto-props --no-auto-props \ - --force --targets --no-ignore \ - --non-recursive -N -q --quiet' - ;; - @(blame|annotate|ann|praise)) - options='-r --revisions --username \ - --password --no-auth-cache \ - --non-interactive -v \ - --verbose --incremental --xml' - ;; - cat) - options='-r --revision --username \ - --password --no-auth-cache \ - --non-interactive' - ;; - @(checkout|co)) - options='-r --revision -q --quiet -N \ - --non-recursive --username \ - --password --no-auth-cache \ - --non-interactive \ - --ignore-externals' - ;; - cleanup) - options='--diff3-cmd' - ;; - @(commit|ci)) - options='-m --message -F --file \ - --encoding --force-log -q \ - --quiet --non-recursive -N \ - --targets --editor-cmd \ - --username --password \ - --no-auth-cache \ - --non-interactive --no-unlock' - ;; - @(copy|cp)) - options='-m --message -F --file \ - --encoding --force-log -r \ - --revision -q --quiet \ - --editor-cmd -username \ - --password --no-auth-cache \ - --non-interactive' - ;; - @(delete|del|remove|rm)) - options='--force -m --message -F \ - --file --encoding --force-log \ - -q --quiet --targets \ - --editor-cmd -username \ - --password --no-auth-cache \ - --non-interactive' - ;; - @(diff|di)) - options='-r --revision -x --extensions \ - --diff-cmd --no-diff-deleted \ - -N --non-recursive --username \ - --password --no-auth-cache \ - --non-interactive --force \ - --old --new --notice-ancestry' - ;; - export) - options='-r --revision -q --quiet \ - --username --password \ - --no-auth-cache \ - --non-interactive -N \ - --non-recursive --force \ - --native-eol --ignore-externals' - ;; - import) - options='--auto-props --no-auto-props \ - -m --message -F --file \ - --encoding --force-log -q \ - --quiet --non-recursive \ - --no-ignore --editor-cmd \ - --username --password \ - --no-auth-cache \ - --non-interactive' - ;; - info) - options='--username --password \ - --no-auth-cache \ - --non-interactive -r \ - --revision --xml --targets \ - -R --recursive --incremental' - ;; - @(list|ls)) - options='-r --revision -v --verbose -R \ - --recursive --username \ - --password --no-auth-cache \ - --non-interactive \ - --incremental --xml' - ;; - lock) - options='-m --message -F --file \ - --encoding --force-log \ - --targets --force --username \ - --password --no-auth-cache \ - --non-interactive' - ;; - log) - options='-r --revision -v --verbose \ - --targets --username \ - --password --no-auth-cache \ - --non-interactive \ - --stop-on-copy --incremental \ - --xml -q --quiet --limit' - ;; - merge) - options='-r --revision -N \ - --non-recursive -q --quiet \ - --force --dry-run --diff3-cmd \ - --username --password \ - --no-auth-cache \ - --non-interactive \ - --ignore-ancestry' - ;; - mkdir) - options='-m --message -F --file \ - --encoding --force-log -q \ - --quiet --editor-cmd \ - --username --password \ - --no-auth-cache \ - --non-interactive' - ;; - @(move|mv|rename|ren)) - options='-m --message -F --file \ - --encoding --force-log -r \ - --revision -q --quiet \ - --force --editor-cmd \ - --username --password \ - --no-auth-cache \ - --non-interactive' - ;; - @(propdel|pdel|pd)) - options='-q --quiet -R --recursive -r \ - --revision --revprop \ - --username --password \ - --no-auth-cache \ - --non-interactive' - ;; - @(propedit|pedit|pe)) - options='-r --revision --revprop \ - --encoding --editor-cmd \ - --username --password \ - --no-auth-cache \ - --non-interactive --force' - ;; - @(propget|pget|pg)) - options='-R --recursive -r --revision \ - --revprop --strict --username \ - --password --no-auth-cache \ - --non-interactive' - ;; - @(proplist|plist|pl)) - options='-v --verbose -R --recursive \ - -r --revision --revprop -q \ - --quiet --username --password \ - --no-auth-cache \ - --non-interactive' - ;; - @(propset|pset|ps)) - options='-F --file -q --quiet \ - --targets -R --recursive \ - --revprop --encoding \ - --username --password \ - --no-auth-cache \ - --non-interactive -r \ - --revision --force' - ;; - resolved) - options='--targets -R --recursive -q \ - --quiet' - ;; - revert) - options='--targets -R --recursive -q \ - --quiet' - ;; - @(status|stat|st)) - options='-u --show-updates -v \ - --verbose -N --non-recursive \ - -q --quiet --username \ - --password --no-auth-cache \ - --non-interactive --no-ignore \ - --ignore-externals \ - --incremental --xml' - ;; - @(switch|sw)) - options='--relocate -r --revision -N \ - --non-recursive -q --quiet \ - --username --password \ - --no-auth-cache \ - --non-interactive --diff3-cmd' - ;; - unlock) - options='--targets --force --username \ - --password --no-auth-cache \ - --non-interactive' - ;; - @(update|up)) - options='-r --revision -N \ - --non-recursive -q --quiet \ - --username --password \ - --no-auth-cache \ - --non-interactive \ - --diff3-cmd --ignore-externals' - ;; - esac - options="$options --help -h --config-dir" - - COMPREPLY=( $( compgen -W "$options" -- $cur ) ) - else - if [[ "$command" == @(help|h|\?) ]]; then - COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) - else - _filedir - fi - fi - fi + commands='add blame praise annotate ann cat checkout co cleanup commit \ + ci copy cp delete del remove rm diff di export help ? h import \ + info list ls lock log merge mkdir move mv rename ren \ + propdel pdel pd propedit pedit pe propget pget pg \ + proplist plist pl propset pset ps resolved revert \ + status stat st switch sw unlock update up' + + if [[ $COMP_CWORD -eq 1 ]] ; then + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--version' -- $cur ) ) + else + COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) + fi + else + + case $prev in + --config-dir) + _filedir -d + return 0; + ;; + -F|--file|--targets) + _filedir + return 0; + ;; + --encoding) + COMPREPLY=( $( compgen -W '$( iconv --list | \ + sed -e "s@//@@;" )' -- "$cur" ) ) + return 0; + ;; + --editor-cmd|--diff-cmd|--diff3-cmd) + COMP_WORDS=(COMP_WORDS[0] $cur) + COMP_CWORD=1 + _command + return 0; + ;; + esac + + command=${COMP_WORDS[1]} + + if [[ "$cur" == -* ]]; then + # possible options for the command + case $command in + add) + options='--auto-props --no-auto-props \ + --force --targets --no-ignore \ + --non-recursive -N -q --quiet' + ;; + blame|annotate|ann|praise) + options='-r --revisions --username \ + --password --no-auth-cache \ + --non-interactive -v \ + --verbose --incremental --xml' + ;; + cat) + options='-r --revision --username \ + --password --no-auth-cache \ + --non-interactive' + ;; + checkout|co) + options='-r --revision -q --quiet -N \ + --non-recursive --username \ + --password --no-auth-cache \ + --non-interactive \ + --ignore-externals' + ;; + cleanup) + options='--diff3-cmd' + ;; + commit|ci) + options='-m --message -F --file \ + --encoding --force-log -q \ + --quiet --non-recursive -N \ + --targets --editor-cmd \ + --username --password \ + --no-auth-cache \ + --non-interactive --no-unlock' + ;; + copy|cp) + options='-m --message -F --file \ + --encoding --force-log -r \ + --revision -q --quiet \ + --editor-cmd -username \ + --password --no-auth-cache \ + --non-interactive' + ;; + delete|del|remove|rm) + options='--force -m --message -F \ + --file --encoding --force-log \ + -q --quiet --targets \ + --editor-cmd -username \ + --password --no-auth-cache \ + --non-interactive' + ;; + diff|di) + options='-r --revision -x --extensions \ + --diff-cmd --no-diff-deleted \ + -N --non-recursive --username \ + --password --no-auth-cache \ + --non-interactive --force \ + --old --new --notice-ancestry' + ;; + export) + options='-r --revision -q --quiet \ + --username --password \ + --no-auth-cache \ + --non-interactive -N \ + --non-recursive --force \ + --native-eol --ignore-externals' + ;; + import) + options='--auto-props --no-auto-props \ + -m --message -F --file \ + --encoding --force-log -q \ + --quiet --non-recursive \ + --no-ignore --editor-cmd \ + --username --password \ + --no-auth-cache \ + --non-interactive' + ;; + info) + options='--username --password \ + --no-auth-cache \ + --non-interactive -r \ + --revision --xml --targets \ + -R --recursive --incremental' + ;; + list|ls) + options='-r --revision -v --verbose -R \ + --recursive --username \ + --password --no-auth-cache \ + --non-interactive \ + --incremental --xml' + ;; + lock) + options='-m --message -F --file \ + --encoding --force-log \ + --targets --force --username \ + --password --no-auth-cache \ + --non-interactive' + ;; + log) + options='-r --revision -v --verbose \ + --targets --username \ + --password --no-auth-cache \ + --non-interactive \ + --stop-on-copy --incremental \ + --xml -q --quiet --limit' + ;; + merge) + options='-r --revision -N \ + --non-recursive -q --quiet \ + --force --dry-run --diff3-cmd \ + --username --password \ + --no-auth-cache \ + --non-interactive \ + --ignore-ancestry' + ;; + mkdir) + options='-m --message -F --file \ + --encoding --force-log -q \ + --quiet --editor-cmd \ + --username --password \ + --no-auth-cache \ + --non-interactive' + ;; + move|mv|rename|ren) + options='-m --message -F --file \ + --encoding --force-log -r \ + --revision -q --quiet \ + --force --editor-cmd \ + --username --password \ + --no-auth-cache \ + --non-interactive' + ;; + propdel|pdel|pd) + options='-q --quiet -R --recursive -r \ + --revision --revprop \ + --username --password \ + --no-auth-cache \ + --non-interactive' + ;; + propedit|pedit|pe) + options='-r --revision --revprop \ + --encoding --editor-cmd \ + --username --password \ + --no-auth-cache \ + --non-interactive --force' + ;; + propget|pget|pg) + options='-R --recursive -r --revision \ + --revprop --strict --username \ + --password --no-auth-cache \ + --non-interactive' + ;; + proplist|plist|pl) + options='-v --verbose -R --recursive \ + -r --revision --revprop -q \ + --quiet --username --password \ + --no-auth-cache \ + --non-interactive' + ;; + propset|pset|ps) + options='-F --file -q --quiet \ + --targets -R --recursive \ + --revprop --encoding \ + --username --password \ + --no-auth-cache \ + --non-interactive -r \ + --revision --force' + ;; + resolved) + options='--targets -R --recursive -q --quiet' + ;; + revert) + options='--targets -R --recursive -q --quiet' + ;; + status|stat|st) + options='-u --show-updates -v \ + --verbose -N --non-recursive \ + -q --quiet --username \ + --password --no-auth-cache \ + --non-interactive --no-ignore \ + --ignore-externals \ + --incremental --xml' + ;; + switch|sw) + options='--relocate -r --revision -N \ + --non-recursive -q --quiet \ + --username --password \ + --no-auth-cache \ + --non-interactive --diff3-cmd' + ;; + unlock) + options='--targets --force --username \ + --password --no-auth-cache \ + --non-interactive' + ;; + update|up) + options='-r --revision -N \ + --non-recursive -q --quiet \ + --username --password \ + --no-auth-cache \ + --non-interactive \ + --diff3-cmd --ignore-externals' + ;; + esac + options="$options --help -h --config-dir" + + COMPREPLY=( $( compgen -W "$options" -- $cur ) ) + else + if [[ "$command" == @(help|h|\?) ]]; then + COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) + else + _filedir + fi + fi + fi - return 0 + return 0 } -complete -F _svn $filenames svn +complete -F _svn -o filenames svn _svnadmin() { - local cur prev commands options mode + local cur prev commands options mode - COMPREPLY=() - cur=`_get_cword` + COMPREPLY=() + _get_comp_words_by_ref cur prev - commands='create deltify dump help ? hotcopy list-dblogs \ - list-unused-dblogs load lslocks lstxns recover rmlocks \ - rmtxns setlog verify' - - if [[ $COMP_CWORD -eq 1 ]] ; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--version' -- $cur ) ) - else - COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) - fi - else - prev=${COMP_WORDS[COMP_CWORD-1]} - case $prev in - --config-dir) - _filedir -d - return 0; - ;; - --fs-type) - COMPREPLY=( $( compgen -W 'fsfs bdb' -- $cur ) ) - return 0; - ;; - esac - - command=${COMP_WORDS[1]} - - if [[ "$cur" == -* ]]; then - # possible options for the command - case $command in - create) - options='--bdb-txn-nosync \ - --bdb-log-keep --config-dir \ - --fs-type' - ;; - deltify) - options='-r --revision -q --quiet' - ;; - dump) - options='-r --revision --incremental \ - -q --quiet --deltas' - ;; - hotcopy) - options='--clean-logs' - ;; - load) - options='--ignore-uuid --force-uuid \ - --parent-dir -q --quiet \ - --use-pre-commit-hook \ - --use-post-commit-hook' - ;; - rmtxns) - options='-q --quiet' - ;; - setlog) - options='-r --revision --bypass-hooks' - ;; - esac - - options="$options --help -h" - COMPREPLY=( $( compgen -W "$options" -- $cur ) ) - else - if [[ "$command" == @(help|h|\?) ]]; then - COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) - else - _filedir - fi - fi - fi + commands='create deltify dump help ? hotcopy list-dblogs \ + list-unused-dblogs load lslocks lstxns recover rmlocks \ + rmtxns setlog verify' + + if [[ $COMP_CWORD -eq 1 ]] ; then + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--version' -- $cur ) ) + else + COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) + fi + else + case $prev in + --config-dir) + _filedir -d + return 0; + ;; + --fs-type) + COMPREPLY=( $( compgen -W 'fsfs bdb' -- $cur ) ) + return 0; + ;; + esac + + command=${COMP_WORDS[1]} + + if [[ "$cur" == -* ]]; then + # possible options for the command + case $command in + create) + options='--bdb-txn-nosync \ + --bdb-log-keep --config-dir \ + --fs-type' + ;; + deltify) + options='-r --revision -q --quiet' + ;; + dump) + options='-r --revision --incremental \ + -q --quiet --deltas' + ;; + hotcopy) + options='--clean-logs' + ;; + load) + options='--ignore-uuid --force-uuid \ + --parent-dir -q --quiet \ + --use-pre-commit-hook \ + --use-post-commit-hook' + ;; + rmtxns) + options='-q --quiet' + ;; + setlog) + options='-r --revision --bypass-hooks' + ;; + esac + + options="$options --help -h" + COMPREPLY=( $( compgen -W "$options" -- $cur ) ) + else + if [[ "$command" == @(help|h|\?) ]]; then + COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) + else + _filedir + fi + fi + fi - return 0 + return 0 } -complete -F _svnadmin $default svnadmin +complete -F _svnadmin -o default svnadmin _svnlook() { - local cur prev commands options mode + local cur prev commands options mode - COMPREPLY=() - cur=`_get_cword` + COMPREPLY=() + _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 \ - youngest' - - if [[ $COMP_CWORD -eq 1 ]] ; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--version' -- $cur ) ) - else - COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) - fi - else - command=${COMP_WORDS[1]} - - if [[ "$cur" == -* ]]; then - # possible options for the command - case $command in - @(author|cat|date|dirs-changed|info|log)) - options='-r --revision -t \ - --transaction' - ;; - changed) - options='-r --revision -t \ - --transaction --copy-info' - ;; - diff) - options='-r --revision -t \ - --transaction \ - --no-diff-deleted \ - --no-diff-added \ - --diff-copy-from' - ;; - history) - options='-r --revision --show-ids' - ;; - prop@(get|list)) - options='-r --revision -t \ - --transaction --revprop' - ;; - tree) - options='-r --revision -t \ - --transaction --show-ids \ - --full-paths' - ;; - esac - - options="$options --help -h" - COMPREPLY=( $( compgen -W "$options" -- $cur ) ) - else - if [[ "$command" == @(help|h|\?) ]]; then - COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) - else - _filedir - fi - fi - fi + commands='author cat changed date diff dirs-changed help ? h history \ + info lock log propget pget pg proplist plist pl tree uuid \ + youngest' + + if [[ $COMP_CWORD -eq 1 ]] ; then + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--version' -- $cur ) ) + else + COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) + fi + else + command=${COMP_WORDS[1]} + + if [[ "$cur" == -* ]]; then + # possible options for the command + case $command in + author|cat|date|dirs-changed|info|log) + options='-r --revision -t \ + --transaction' + ;; + changed) + options='-r --revision -t \ + --transaction --copy-info' + ;; + diff) + options='-r --revision -t \ + --transaction \ + --no-diff-deleted \ + --no-diff-added \ + --diff-copy-from' + ;; + history) + options='-r --revision --show-ids' + ;; + propget|proplist) + options='-r --revision -t \ + --transaction --revprop' + ;; + tree) + options='-r --revision -t \ + --transaction --show-ids \ + --full-paths' + ;; + esac + + options="$options --help -h" + COMPREPLY=( $( compgen -W "$options" -- $cur ) ) + else + if [[ "$command" == @(help|h|\?) ]]; then + COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) + else + _filedir + fi + fi + fi - return 0 + return 0 } -complete -F _svnlook $default svnlook +complete -F _svnlook -o default svnlook } # Local variables: diff -Nru bash-completion-1.1/contrib/svk bash-completion-1.2/contrib/svk --- bash-completion-1.1/contrib/svk 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/svk 2010-06-13 11:21:19.000000000 +0100 @@ -1,4 +1,4 @@ -# svk completion by Guillaume Rousse +# svk(1) completion have svk && _svk() @@ -6,7 +6,7 @@ local cur prev commands options command COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur prev commands='add admin annotate ann blame praise cat checkout co cleanup \ cmerge cm commit ci copy cp delete del remove rm depotmap \ @@ -23,10 +23,8 @@ COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi else - - prev=${COMP_WORDS[COMP_CWORD-1]} case $prev in - -@(F|-file|-targets)) + -F|--file|--targets) _filedir return 0; ;; @@ -45,44 +43,44 @@ add) options=' --non-recursive -N -q --quiet' ;; - @(blame|annotate|ann|praise)) + blame|annotate|ann|praise) options='-r --revisions -x --cross' ;; cat) options='-r --revision' ;; - @(checkout|co)) + checkout|co) options='-r --revision -q --quiet -N --non-recursive -l \ --list -d --detach --export --relocate --purge' ;; cleanup) options='-a --all' ;; - @(cmerge|cm)) + cmerge|cm) options='-c --change -l --log -r --revision -a --auto \ --verbatim --no-ticket -m --message -F --file \ --template --encoding -P --patch -S --sign -C \ --check-only --direct' ;; - @(commit|ci)) + commit|ci) options='--import -m --message -F --file --encoding \ --template -P --patch -S --sign -C --check-only -N \ --non-recursive --direct' ;; - @(copy|cp)) + copy|cp) options='-r --revision -p --parent -q --quiet -m --message \ -F --file --template --encoding -P --patch -S --sign \ -C --check-only --direct' ;; - @(delete|del|remove|rm)) + delete|del|remove|rm) options='-k --keep-local -m --message -F --file --encoding \ --template -P --patch -S --sign -C --check-only \ --direct' ;; - @(depotmap|depot)) + depotmap|depot) options='-i --init -l --list -d --detach --relocate' ;; - @(diff|di)) + diff|di) options='-r --revision -s --summarize -b --verbose -N \ --non-recursive' ;; @@ -91,7 +89,7 @@ -F --file --template --encoding -P --patch -S --sign \ -C --check-only -N --non-recursive --direct' ;; - @(list|ls)) + list|ls) options='-r --revision -v --verbose -R --recursive -d \ --depth -f --full-path' ;; @@ -106,7 +104,7 @@ -F --file --template --encoding -P --patch -S --sign \ -C --check-only --direct' ;; - @(mirror|mi)) + mirror|mi) options='-l --list -d --detach --relocate --recover \ --unlock --upgrade' ;; @@ -115,7 +113,7 @@ --encoding -P --patch -S --sign -C --check-only \ --direct' ;; - @(move|mv|rename|ren)) + move|mv|rename|ren) options='-r --revision -p --parent -q --quiet -m \ --message -F --file --encoding --template -P --patch \ -S --sign -C --check-only --direct' @@ -123,20 +121,20 @@ patch) options='--depot' ;; - @(propdel|propset|pdel|pset|pd|ps)) + propdel|propset|pdel|pset|pd|ps) options='-R --recursive -r --revision --revprop -m \ --message -F --file --template --encoding -P --patch \ -S --sign -C --check-only -q --quiet --direct' ;; - @(propedit|pedit|pe)) + propedit|pedit|pe) options='-R --recursive -r --revision --revprop -m \ --message -F --file --template --encoding -P --patch \ -S --sign -C --check-only --direct' ;; - @(propget|pget|pg)) + propget|pget|pg) options='-R --recursive -r --revision --revprop --strict' ;; - @(proplist|plist|pl)) + proplist|plist|pl) options='-R --recursive -v --verbose \ -r --revision --revprop' ;; @@ -153,24 +151,24 @@ revert) options='-R --recursive -q --quiet' ;; - @(smerge|sm)) + smerge|sm) options='-I --incremental -l --log -B --baseless -b \ --base -s --sync -t --to -f --from --verbatim \ --no-ticket --track-rename --host --remoterev -m \ --message -F --file --template --encoding -P --patch \ -S --sign -C --check-only --direct' ;; - @(status|stat|st)) + status|stat|st) options='-q --quiet --no-ignore -N --non-recursive -v \ --verbose' ;; - @(switch|sw)) + switch|sw) options='-r --revision -d --detach -q --quiet' ;; - @(sync|sy)) + sync|sy) options='-a --all -s --skipto -t --torev' ;; - @(update|up)) + update|up) options='-r --revision -N --non-recursive -C --check-only \ -s --sync -m --merge -q --quiet' ;; @@ -180,7 +178,7 @@ COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) else case $command in - @(help|h|\?)) + help|h|\?) COMPREPLY=( $( compgen -W "$commands \ environment commands intro" -- "$cur" ) ) ;; @@ -198,7 +196,7 @@ COMPREPLY=( $( compgen -W "$( svk mirror --list \ 2>/dev/null | awk '/^\//{print $1}' )" -- "$cur" ) ) ;; - @(co|checkout|push|pull)) + co|checkout|push|pull) if [[ "$cur" == //*/* ]]; then path=${cur%/*}/ else @@ -216,7 +214,7 @@ return 0 } && -complete -F _svk $filenames svk +complete -F _svk -o filenames svk # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/sysctl bash-completion-1.2/contrib/sysctl --- bash-completion-1.1/contrib/sysctl 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/sysctl 2010-06-13 11:21:19.000000000 +0100 @@ -6,7 +6,7 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur COMPREPLY=( $( compgen -W "$(sysctl -N -a 2>/dev/null)" -- "$cur" ) ) diff -Nru bash-completion-1.1/contrib/sysv-rc bash-completion-1.2/contrib/sysv-rc --- bash-completion-1.1/contrib/sysv-rc 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/sysv-rc 2010-06-13 11:21:19.000000000 +0100 @@ -7,26 +7,24 @@ { local cur prev sysvdir services options valid_options - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev [ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d \ || sysvdir=/etc/init.d - services=( $(echo $sysvdir/!(README*|*.sh|*.dpkg*|*.rpm@(orig|new|save))) ) + services=( $(printf '%s ' $sysvdir/!(README*|*.sh|*.dpkg*|*.rpm@(orig|new|save))) ) services=( ${services[@]#$sysvdir/} ) options=( -f -n ) if [[ $COMP_CWORD -eq 1 || "$prev" == -* ]]; then valid_options=( $( \ - echo "${COMP_WORDS[@]} ${options[@]}" \ - | tr " " "\n" \ - | sed -ne "/$( echo "${options[@]}" | sed "s/ /\\|/g" )/p" \ + tr " " "\n" <<<"${COMP_WORDS[@]} ${options[@]}" \ + | sed -ne "/$( sed "s/ /\\|/g" <<<"${options[@]}" )/p" \ | sort | uniq -u \ ) ) COMPREPLY=( $( compgen -W '${options[@]} ${services[@]}' \ - -X '$( echo ${COMP_WORDS[@]} | tr " " "|" )' -- "$cur" ) ) - elif [[ "$prev" == ?($( echo ${services[@]} | tr " " "|" )) ]]; then + -X '$( tr " " "|" <<<${COMP_WORDS[@]} )' -- "$cur" ) ) + elif [[ "$prev" == ?($( tr " " "|" <<<${services[@]} )) ]]; then COMPREPLY=( $( compgen -W 'remove defaults start stop' -- "$cur" ) ) elif [[ "$prev" == defaults && "$cur" == [0-9] ]]; then COMPREPLY=( 0 1 2 3 4 5 6 7 8 9 ) @@ -73,28 +71,27 @@ { local cur prev sysvdir services options valid_options - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev [ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d \ || sysvdir=/etc/init.d - services=( $(echo $sysvdir/!(README*|*.sh|*.dpkg*|*.rpm@(orig|new|save))) ) + services=( $( printf '%s ' \ + $sysvdir/!(README*|*.sh|*.dpkg*|*.rpm@(orig|new|save)) ) ) services=( ${services[@]#$sysvdir/} ) options=( --help --quiet --force --try-anyway --disclose-deny --query \ --no-fallback ) if [[ ($COMP_CWORD -eq 1) || ("$prev" == --* ) ]]; then valid_options=( $( \ - echo ${COMP_WORDS[@]} ${options[@]} \ - | tr " " "\n" \ - | sed -ne "/$( echo ${options[@]} | sed "s/ /\\\\|/g" )/p" \ + tr " " "\n" <<<"${COMP_WORDS[@]} ${options[@]}" \ + | sed -ne "/$( sed "s/ /\\\\|/g" <<<"${options[@]}" )/p" \ | sort | uniq -u \ ) ) COMPREPLY=( $( compgen -W '${valid_options[@]} ${services[@]}' -- "$cur" ) ) elif [ -x $sysvdir/$prev ]; then - COMPREPLY=( $( compgen -W '`sed -ne "y/|/ /; \ - s/^.*Usage:[ ]*[^ ]*[ ]*{*\([^}\"]*\).*$/\1/p" \ + COMPREPLY=( $( compgen -W '`sed -e "y/|/ /" \ + -ne "s/^.*Usage:[ ]*[^ ]*[ ]*{*\([^}\"]*\).*$/\1/p" \ $sysvdir/$prev`' -- "$cur" ) ) else COMPREPLY=() diff -Nru bash-completion-1.1/contrib/tar bash-completion-1.2/contrib/tar --- bash-completion-1.1/contrib/tar 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/tar 2010-06-13 11:21:19.000000000 +0100 @@ -6,20 +6,20 @@ local cur ext regex tar untar COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [ $COMP_CWORD -eq 1 ]; then COMPREPLY=( $( compgen -W 'c t x u r d A' -- "$cur" ) ) return 0 fi - case "${COMP_WORDS[1]}" in + case ${COMP_WORDS[1]} in ?(-)[cr]*f) _filedir return 0 ;; +([^IZzJjy])f) - ext='t@(ar?(.@(Z|gz|bz?(2)|lz?(ma)))|gz|bz?(2)|lz?(ma))' + ext='t@(ar?(.@(Z|gz|bz?(2)|lz?(ma)|xz))|gz|bz?(2)|lz?(ma)|xz)' regex='t\(ar\(\.\(Z\|gz\|bz2\?\|lzma\|xz\)\)\?\|gz\|bz2\?\|lzma\|xz\)' ;; *[Zz]*f) @@ -45,11 +45,11 @@ # complete on files in tar file # # get name of tar file from command line - tar=$( echo "$COMP_LINE" | sed -e 's/^.* \([^ ]*'$regex'\) .*$/\1/' ) + tar=$( sed -e 's/^.* \([^ ]*'$regex'\) .*$/\1/' <<<"$COMP_LINE" ) # devise how to untar and list it untar=t${COMP_WORDS[1]//[^Izjyf]/} - COMPREPLY=( $( compgen -W "$( echo $( tar $untar $tar \ + COMPREPLY=( $( compgen -W "$( printf '%s ' $( tar $untar $tar \ 2>/dev/null ) )" -- "$cur" ) ) return 0 fi @@ -59,8 +59,8 @@ return 0 } -[ -n "${COMP_TAR_INTERNAL_PATHS:-}" ] && complete -F _tar $dirnames tar || - complete -F _tar $filenames tar +[ -n "${COMP_TAR_INTERNAL_PATHS:-}" ] && complete -F _tar -o dirnames tar || + complete -F _tar -o filenames tar } # Local variables: diff -Nru bash-completion-1.1/contrib/tcpdump bash-completion-1.2/contrib/tcpdump --- bash-completion-1.1/contrib/tcpdump 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/tcpdump 2010-06-13 11:21:19.000000000 +0100 @@ -6,11 +6,10 @@ 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)) + case $prev in + -r|-w|-F) _filedir return 0 ;; diff -Nru bash-completion-1.1/contrib/unace bash-completion-1.2/contrib/unace --- bash-completion-1.1/contrib/unace 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/unace 2010-06-13 11:21:19.000000000 +0100 @@ -1,4 +1,4 @@ -# unace(1) completion by Guillaume Rousse +# unace(1) completion have unace && _unace() @@ -6,26 +6,19 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur - case "$cur" in - -*) - COMPREPLY=( $( compgen -W '-c -c- -f -f- -o -o- -p -y -y-' \ - -- "$cur" ) ) - ;; - *) + if [[ "$cur" == -* ]] ; then + COMPREPLY=( $( compgen -W '-c -c- -f -f- -o -o- -p -y -y-' -- "$cur" ) ) + else if [ $COMP_CWORD -eq 1 ]; then COMPREPLY=( $( compgen -W 'e l t v x' -- "$cur" ) ) else _filedir '@(ace|ACE)' fi - ;; - esac - - return 0 - + fi } && -complete -F _unace $filenames unace +complete -F _unace -o filenames unace # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/unrar bash-completion-1.2/contrib/unrar --- bash-completion-1.1/contrib/unrar 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/unrar 2010-06-13 11:21:19.000000000 +0100 @@ -1,4 +1,4 @@ -# unrar(1) completion by Guillaume Rousse +# unrar(1) completion have unrar && _unrar() @@ -6,26 +6,22 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur - case "$cur" in - -*) + if [[ "$cur" == -* ]] ; then COMPREPLY=( $( compgen -W '-ad -ap -av- -c- -cfg- -cl -cu \ -dh -ep -f -idp -ierr -inul -kb -o+ -o- -ow -p -p- -r -ta \ -tb -tn -to -u -v -ver -vp -x -x@ -y' -- "$cur" ) ) - ;; - *) + else if [ $COMP_CWORD -eq 1 ]; then COMPREPLY=( $( compgen -W 'e l lb lt p t v vb vt x' -- "$cur" ) ) else _filedir '@(rar|RAR)' fi - ;; - esac + fi - return 0 } && -complete -F _unrar $filenames unrar +complete -F _unrar -o filenames unrar # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/update-alternatives bash-completion-1.2/contrib/update-alternatives --- bash-completion-1.1/contrib/update-alternatives 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/update-alternatives 2010-06-13 11:21:19.000000000 +0100 @@ -22,22 +22,21 @@ local cur prev mode args i COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in - --@(altdir|admindir)) - _filedir -d - return 0 - ;; - --@(help|version)) - return 0 - ;; + case $prev in + --altdir|--admindir) + _filedir -d + return 0 + ;; + --help|--usage|--version) + return 0 + ;; esac # find which mode to use and how many real args used so far for (( i=1; i < COMP_CWORD; i++ )); do - if [[ "${COMP_WORDS[i]}" == --@(install|remove|auto|display|config|remove-all) ]]; then + if [[ "${COMP_WORDS[i]}" == --@(install|remove|auto|display|config|remove-all|set) ]]; then mode=${COMP_WORDS[i]} args=$(($COMP_CWORD - i)) break @@ -45,46 +44,48 @@ done case $mode in - --install) - case $args in - 1) - _filedir + --install) + case $args in + 1|3) + _filedir + ;; + 2) + _installed_alternatives + ;; + 4) + # priority - no completions + ;; + *) + case $((args % 4)) in + 0|2) + _filedir + ;; + 1) + COMPREPLY=( $( compgen -W '--slave' -- "$cur" ) ) + ;; + 3) + _installed_alternatives + ;; + esac + esac ;; - 2) - _installed_alternatives + --remove|--set) + case $args in + 1) + _installed_alternatives + ;; + 2) + _filedir + ;; + esac ;; - 3) - _filedir - ;; - esac - ;; - --remove) - case $args in - 1) + --auto|--remove-all|--display|--config) _installed_alternatives ;; - 2) - _filedir - ;; - esac - ;; - --auto) - _installed_alternatives - ;; - --remove-all) - _installed_alternatives - ;; - --display) - _installed_alternatives - ;; - --config) - _installed_alternatives - ;; - *) - COMPREPLY=( $( compgen -W '--verbose --quiet --help --version \ - --altdir --admindir' -- "$cur" ) \ - $( compgen -W '--install --remove --auto --display \ - --config' -- "$cur" ) ) + *) + COMPREPLY=( $( compgen -W '--verbose --quiet --help --version \ + --altdir --admindir --install --remove --auto --display \ + --config --set' -- "$cur" ) ) esac } complete -F _update_alternatives update-alternatives alternatives diff -Nru bash-completion-1.1/contrib/util-linux bash-completion-1.2/contrib/util-linux --- bash-completion-1.1/contrib/util-linux 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/util-linux 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,76 @@ +# Completions for tools included in util-linux (not necessarily Linux specific) + +# renice(8) completion +# +have renice && +_renice() +{ + local command cur curopt i + + COMPREPLY=() + _get_comp_words_by_ref cur + command=$1 + + i=0 + # walk back through command line and find last option + while [[ $i -le $COMP_CWORD && ${#COMPREPLY[@]} -eq 0 ]]; do + curopt=${COMP_WORDS[COMP_CWORD-$i]} + case "$curopt" in + -u) + COMPREPLY=( $( compgen -u -- "$cur" ) ) + ;; + -g) + _pgids + ;; + -p|$command) + _pids + ;; + esac + i=$(( ++i )) + done +} && +complete -F _renice renice + +# kill(1) completion +# +have kill && +_kill() +{ + local cur + + COMPREPLY=() + _get_comp_words_by_ref cur + + if [[ $COMP_CWORD -eq 1 && "$cur" == -* ]]; then + # return list of available signals + _signals + else + # return list of available PIDs + _pids + fi +} && +complete -F _kill kill + +# look(1) completion +# +have look && +_look() +{ + local cur + + COMPREPLY=() + _get_comp_words_by_ref cur + + if [ $COMP_CWORD = 1 ]; then + COMPREPLY=( $( compgen -W '$(look "$cur" 2>/dev/null)' -- "$cur" ) ) + fi +} && +complete -F _look -o default look + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/vncviewer bash-completion-1.2/contrib/vncviewer --- bash-completion-1.1/contrib/vncviewer 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/vncviewer 2010-06-13 11:21:19.000000000 +0100 @@ -1,20 +1,19 @@ # bash completion for vncviewer have vncviewer && -_vncviewer_bootstrap() { +_vncviewer_bootstrap() +{ local fname - case "$(_realcommand vncviewer)" in - # If `vncviewer' not installed, default file-dir completion - '') _filedir `_get_cword` ;; + case $(_realcommand vncviewer) in *xvnc4viewer) fname=_xvnc4viewer ;; - *tightvncviewer|*) fname=_tightvncviewer ;; + *tightvncviewer) fname=_tightvncviewer ;; + *) fname=_known_hosts ;; esac - if [ $fname ]; then - # Install real completion for subsequent completions - complete -F $fname vncviewer - $fname # Generate completions once for now - unset -f _vncviewer_bootstrap - fi + + # Install real completion for subsequent completions + complete -F $fname vncviewer + $fname # Generate completions once for now + unset -f _vncviewer_bootstrap } && complete -F _vncviewer_bootstrap vncviewer @@ -24,8 +23,7 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in -passwd) @@ -57,7 +55,8 @@ complete -F _tightvncviewer tightvncviewer -# NOTE: - VNC Viewer options are case-insensivite. Preferred case is taken from -help. +# NOTE: - VNC Viewer options are case insensitive. +# Preferred case is taken from -help. # - Both single dash (-) and double dash (--) are allowed as option prefix have xvnc4viewer && _xvnc4viewer() @@ -65,8 +64,7 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev # Convert double dash to single dash case ${prev/#--/-} in @@ -101,21 +99,21 @@ ) [[ "$cur" == --* ]] && dash=-- || dash=- # Is a `nocasematch' variable available (bash > v3.1)? - if shopt nocasematch 2> /dev/null | grep -q ^nocasematch; then + if shopt nocasematch 2> /dev/null | command grep -q ^nocasematch; then # Variable `nocasematch' is available # Use vncviewer camelcase options local option oldNoCaseMatch=$(shopt -p nocasematch) shopt -s nocasematch COMPREPLY=( $( for option in "${options[@]}"; do - [[ $dash$option == "$cur"* ]] && echo $dash$option + [[ $dash$option == "$cur"* ]] && printf '%s\n' $dash$option done ) ) eval "$oldNoCaseMatch" 2> /dev/null else # Variable 'nocasematch' isn't available; # Convert completions to lowercase - COMPREPLY=( $( compgen -W "$( - echo ${options[@]/#/$dash} | tr [:upper:] [:lower:] - )" -- "$(echo "$cur" | tr [:upper:] [:lower:])" ) ) + COMPREPLY=( $( compgen -W \ + "$( tr [:upper:] [:lower:] <<<${options[@]/#/$dash} )" \ + -- "$( tr [:upper:] [:lower:] <<<"$cur" )" ) ) fi else _known_hosts_real "$cur" diff -Nru bash-completion-1.1/contrib/vpnc bash-completion-1.2/contrib/vpnc --- bash-completion-1.1/contrib/vpnc 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/vpnc 2010-06-13 11:21:19.000000000 +0100 @@ -6,8 +6,7 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in --pfs) @@ -18,7 +17,7 @@ COMPREPLY=( $( compgen -W 'dh1 dh2 dh5' -- "$cur" ) ) return 0 ;; - --@(pid-file|script)) + --pid-file|--script) _filedir return 0 ;; diff -Nru bash-completion-1.1/contrib/wireless-tools bash-completion-1.2/contrib/wireless-tools --- bash-completion-1.1/contrib/wireless-tools 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/wireless-tools 2010-06-13 11:21:19.000000000 +0100 @@ -9,8 +9,7 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in mode) @@ -23,7 +22,7 @@ if [ -n "${COMP_IWLIST_SCAN:-}" ]; then COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W \ "$( iwlist ${COMP_WORDS[1]} scan | \ - awk -F '\"' '/ESSID/ {print $2}' )" -- "$cur" ) ) + awk -F'\"' '/ESSID/ {print $2}' )" -- "$cur" ) ) fi return 0 ;; @@ -33,13 +32,13 @@ ;; channel) COMPREPLY=( $( compgen -W "$( iwlist ${COMP_WORDS[1]} channel | \ - awk '/^[[:space:]]*Channel/ {print $2}' )" -- "$cur" ) ) + awk '/^[ \t]*Channel/ {print $2}' )" -- "$cur" ) ) return 0 ;; freq) COMPREPLY=( $( compgen -W "$( iwlist ${COMP_WORDS[1]} channel | \ - awk '/^[[:space:]]*Channel/ {print $4\"G\"}')" -- "$cur" ) ) + awk '/^[ \t]*Channel/ {print $4"G"}')" -- "$cur" ) ) return 0 ;; ap) @@ -55,7 +54,7 @@ COMPREPLY=( $( compgen -W 'auto fixed' -- "$cur" ) ) COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W \ "$( iwlist ${COMP_WORDS[1]} rate | \ - awk '/^[[:space:]]*[0-9]/ {print $1\"M\"}' )" -- "$cur" ) ) + awk '/^[ \t]*[0-9]/ {print $1"M"}' )" -- "$cur" ) ) return 0 ;; rts|frag) @@ -101,8 +100,7 @@ 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 if [[ "$cur" == -* ]]; then @@ -125,7 +123,7 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [ $COMP_CWORD -eq 1 ]; then if [[ "$cur" == -* ]]; then @@ -146,10 +144,9 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in roam) COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) return 0 diff -Nru bash-completion-1.1/contrib/wodim bash-completion-1.2/contrib/wodim --- bash-completion-1.1/contrib/wodim 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/wodim 2010-06-13 11:21:19.000000000 +0100 @@ -6,15 +6,14 @@ local cur prev i generic_options track_options track_mode COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev # foo=bar style option if [[ "$cur" == *=* ]]; then prev=${cur/=*/} cur=${cur/*=/} - case "$prev" in - @(text|cue)file) + case $prev in + textfile|cuefile) _filedir return 0 ;; @@ -35,7 +34,7 @@ esac fi - generic_options=(-version -v -V -d -silent -s -force -immed -dummy \ + generic_options=(-version -v -V -d -silent -force -immed -dummy \ -dao -raw -raw96r -raw96p -raw16 -multi -msinfo -toc \ -atip -fix -nofix -waiti -load -lock -eject -format \ -setdropts -checkdrive -prcap -inq -scanbus -reset \ @@ -74,7 +73,7 @@ fi } && -complete -F _cdrecord $filenames cdrecord wodim +complete -F _cdrecord -o filenames cdrecord wodim # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/wol bash-completion-1.2/contrib/wol --- bash-completion-1.1/contrib/wol 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/wol 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,47 @@ +# wol(1) completion + +have wol && +_wol() +{ + local cur prev split=false + COMPREPLY=() + _get_comp_words_by_ref -n : cur prev + _split_longopt && split=true + + case $prev in + -V|--version|--help|-p|--port|--passwd|-w|--wait) + return 0 + ;; + -h|--host|-i|--ipaddr) + # Broadcast addresses + COMPREPLY=( $( PATH=$PATH:/sbin ifconfig -a 2>/dev/null | \ + sed -ne 's/.*[[:space:]]\{1,\}Bcast:\([^[:space:]]*\).*/\1/p' \ + -e 's/.*[[:space:]]\{1,\}broadcast[[:space:]]\{1,\}\([^[:space:]]*\).*/\1/p' ) ) + _known_hosts_real "$cur" + return 0 + ;; + -f|--file) + _filedir + return 0 + ;; + esac + + $split && return 0 + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--help --version --verbose --wait --host + --port --file --passwd' -- "$cur" ) ) + return 0 + fi + + _mac_addresses +} && +complete -F _wol wol + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/wtf bash-completion-1.2/contrib/wtf --- bash-completion-1.1/contrib/wtf 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/wtf 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,36 @@ +# wtf completion +# Raphael Droz, 25/09/2009 + +have wtf && +_wtf() +{ + local cur prev db + + COMPREPLY=() + _get_comp_words_by_ref cur prev + + [ "$prev" = -f ] && _filedir && return 0 + [[ "$cur" == -* ]] && COMPREPLY=( -f ) && return 0 + + set -- "${COMP_WORDS[@]}" + while [ $# -gt 0 ]; do + if [ "$1" = -f ]; then + shift ; db=$1 ; break + fi + shift + done + [ -z $db ] && db=${ACRONYMDB:-/usr/share/misc/acronyms*} + + [ ${BASH_VERSINFO[0]} -ge 4 ] && cur="${cur^^}" + + COMPREPLY=( $( compgen -W "$( cut -f 1 -s $db ) -f" -- "${cur}" ) ) +} && +complete -F _wtf -o filenames wtf + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/wvdial bash-completion-1.2/contrib/wvdial --- bash-completion-1.1/contrib/wvdial 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/wvdial 2010-06-13 11:21:19.000000000 +0100 @@ -6,8 +6,7 @@ local cur prev config i IFS=$'\t\n' COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev case $prev in --config) @@ -35,7 +34,7 @@ # parse config files for sections and # remove default section COMPREPLY=( $( sed -ne "s|^\[Dialer \($cur.*\)\]$|\1|p" $config \ - 2>/dev/null |grep -v '^Defaults$')) + 2>/dev/null | command grep -v '^Defaults$')) # escape spaces COMPREPLY=${COMPREPLY// /\\ } ;; diff -Nru bash-completion-1.1/contrib/xhost bash-completion-1.2/contrib/xhost --- bash-completion-1.1/contrib/xhost 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/xhost 2010-06-13 11:21:19.000000000 +0100 @@ -3,16 +3,17 @@ have xhost && _xhost () { - local cur=`_get_cword` + local cur + _get_comp_words_by_ref cur - case "$cur" in + case $cur in +*) _known_hosts_real -p+ "${cur:1}" ;; -*) _known_hosts_real -p- "${cur:1}" ;; *) _known_hosts_real "$cur" ;; esac return 0 -} +} && complete -F _xhost xhost # Local variables: diff -Nru bash-completion-1.1/contrib/xm bash-completion-1.2/contrib/xm --- bash-completion-1.1/contrib/xm 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/xm 2010-06-13 11:21:19.000000000 +0100 @@ -20,7 +20,7 @@ local cur prev command options COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur prev commands='console create new delete destroy domid domname dump-core \ list mem-max mem-set migrate pause reboot rename restore \ @@ -35,7 +35,6 @@ if [[ $COMP_CWORD -eq 1 ]] ; then COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) else - prev=${COMP_WORDS[COMP_CWORD-1]} if [[ "$cur" == *=* ]]; then prev=${cur/=*/} cur=${cur/*=/} @@ -63,7 +62,7 @@ sched-credit) options='-d -w -c' ;; - @(block|network|vtpm|vnet)-list) + block-list|network-list|vtpm-list|vnet-list) options='-l --long' ;; getpolicy) @@ -81,7 +80,9 @@ COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) else case $command in - @(console|destroy|domname|domid|list|mem-@(set|max)|pause|reboot|rename|shutdown|unpause|vcpu-@(list|pin|set)|block-list|network-list|vtpm-list)) + console|destroy|domname|domid|list|mem-set|mem-max| \ + pause|reboot|rename|shutdown|unpause|vcpu-list|vcpu-pin| \ + vcpu-set|block-list|network-list|vtpm-list) _count_args case $args in 2) @@ -100,7 +101,7 @@ ;; esac ;; - @(restore|dry-run|vnet-create)) + restore|dry-run|vnet-create) _filedir ;; save) @@ -196,7 +197,7 @@ ;; new) case $prev in - -@(f|F|-defconfig|-config)) + -f|-F|--defconfig|--config) _filedir return 0 ;; diff -Nru bash-completion-1.1/contrib/xmllint bash-completion-1.2/contrib/xmllint --- bash-completion-1.1/contrib/xmllint 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/xmllint 2010-06-13 11:21:19.000000000 +0100 @@ -6,10 +6,9 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -o|--output) _filedir return 0 @@ -45,7 +44,7 @@ _filedir '@(*ml|htm|svg)' } && -complete -F _xmllint $filenames xmllint +complete -F _xmllint -o filenames xmllint # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/xmlwf bash-completion-1.2/contrib/xmlwf --- bash-completion-1.1/contrib/xmlwf 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/xmlwf 2010-06-13 11:21:19.000000000 +0100 @@ -6,10 +6,9 @@ local cur prev COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in -d) _filedir -d return 0 @@ -29,7 +28,7 @@ _filedir '@(*ml|htm|svg)' } && -complete -F _xmlwf $filenames xmlwf +complete -F _xmlwf -o filenames xmlwf # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/xmms bash-completion-1.2/contrib/xmms --- bash-completion-1.1/contrib/xmms 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/xmms 2010-06-13 11:21:19.000000000 +0100 @@ -6,7 +6,7 @@ local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '-h --help -r --rew -p --play \ @@ -19,7 +19,7 @@ fi } && -complete -F _xmms $filenames xmms +complete -F _xmms -o filenames xmms # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/xrandr bash-completion-1.2/contrib/xrandr --- bash-completion-1.1/contrib/xrandr 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/xrandr 2010-06-13 11:21:19.000000000 +0100 @@ -5,12 +5,11 @@ { local cur prev output modes COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} + _get_comp_words_by_ref cur prev - case "$prev" in + case $prev in --output) - local outputs=$(xrandr|grep 'connected'|awk '{print $1}') + local outputs=$(xrandr|awk '/connected/ {print $1}') COMPREPLY=( $(compgen -W "$outputs" -- "$cur")) return 0 ;; @@ -28,17 +27,14 @@ ;; esac - case "$cur" in + case $cur in *) - COMPREPLY=( $(compgen -W '-d -display -help -o \ - --orientation -q --query -s --size\ - -r --rate -v --version -x -y --screen \ - --verbose --dryrun --prop --fb \ - --fbmm --dpi --output --auto --mode \ - --preferred --pos --reflect --rotate \ - --left-of --right-of --above --below \ - --same-as --set --off --crtc --newmode \ - --rmmode --addmode --delmode' -- "$cur")) + COMPREPLY=( $(compgen -W '-display -help --orientation --query \ + --size --rate --version -x -y --screen --verbose --dryrun \ + --prop --fb --fbmm --dpi --output --auto --mode --preferred \ + --pos --reflect --rotate --left-of --right-of --above --below \ + --same-as --set --off --crtc --newmode --rmmode --addmode \ + --delmode' -- "$cur") ) return 0 ;; esac diff -Nru bash-completion-1.1/contrib/xsltproc bash-completion-1.2/contrib/xsltproc --- bash-completion-1.1/contrib/xsltproc 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/xsltproc 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,56 @@ +# xsltproc(1) completion + +have xsltproc && +_xsltproc() +{ + local cur prev + COMPREPLY=() + _get_comp_words_by_ref cur prev + + case $prev in + --output|-o) + _filedir + return 0 + ;; + # TODO : number only + --maxdepth) + return 0 + ;; + --encoding) + # some aliases removed + COMPREPLY=( $( compgen -W "$( iconv -l | sed -e '/^UTF[1378]/d' \ + -e '/^ISO[0-9_]/d' -e '/^8859/d' -e 's/\/.*//')" -- "$cur" ) ) + return 0 + ;; + --param|--stringparam) + return 0 + ;; + # not really like --writesubtree + --path) + _filedir -d + return 0 + ;; + --writesubtree) + _filedir -d + return 0 + ;; + esac + + [[ $COMP_CWORD -gt 2 && `_get_cword '' 2` == --?(string)param ]] && \ + return 0 + + if [[ "$cur" == -* ]]; then + _longopt xsltproc + else + _filedir '@(xsl|xslt|xml)' + fi +} && +complete -F _xsltproc -o filenames xsltproc + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/contrib/xz bash-completion-1.2/contrib/xz --- bash-completion-1.1/contrib/xz 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/xz 2010-06-13 11:21:19.000000000 +0100 @@ -4,27 +4,26 @@ _xz() { COMPREPLY=() - local cur=`_get_cword` - local prev=${COMP_WORDS[COMP_CWORD-1]} + local cur prev + _get_comp_words_by_ref cur prev if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-z --compress -d --decompress \ - -t --test -l --list -k --keep -f --force -c --stdout \ - -S --suffix --files --files0 -F --format -C --check \ - -0 -1 -2 -3 -4 -5 -6 -7 -8 -9 -M --memory --lzma1 \ - --lzma2 --x86 --powerpc --ia64 --arm --armthumb \ - --sparc --delta -q --quiet -v --verbose -h --help \ - -H --long-help -V --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--compress --decompress --test --list \ + --keep --force --stdout --suffix --files --files0 --format --check \ + -0 -1 -2 -3 -4 -5 -6 -7 -8 -9 --fast --best --extreme --memory \ + --lzma1 --lzma2 --x86 --powerpc --ia64 --arm --armthumb --sparc \ + --delta --quiet --verbose --no-warn --help --long-help --version' \ + -- "$cur" ) ) return 0 fi local split=false _split_longopt && split=true - local xspec="*.@(xz|lzma)" + local xspec="*.@(xz|lzma|txz|tlz)" - case "$prev" in - -@(!(-*)[dlt]*|-decompress|-list|-test)) + case $prev in + --decompress|--list|--test|-!(-*)[dlt]*) xspec="!"$xspec ;; --files|--files0) @@ -57,7 +56,7 @@ COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ $( compgen -d -- "$cur" ) ) } && -complete -F _xz $filenames xz +complete -F _xz -o filenames xz # xzdec(1) completion # @@ -65,19 +64,18 @@ _xzdec() { COMPREPLY=() - local cur=`_get_cword` - local prev=${COMP_WORDS[COMP_CWORD-1]} + local cur prev + _get_comp_words_by_ref cur prev if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-M --memory -h --help -V --version' \ - -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--memory --help --version' -- "$cur" ) ) return 0 fi local split=false _split_longopt && split=true - case "$prev" in + case $prev in -M|--memory) # argument required but no completions available return 0 @@ -92,7 +90,7 @@ _filedir xz # no lzma support here as of xz 4.999.8beta } && -complete -F _xzdec $filenames xzdec +complete -F _xzdec -o filenames xzdec # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/yp-tools bash-completion-1.2/contrib/yp-tools --- bash-completion-1.1/contrib/yp-tools 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/yp-tools 2010-06-13 11:21:19.000000000 +0100 @@ -1,25 +1,26 @@ # bash completion for yp-tools -have ypmatch && +have ypcat && _ypmatch() { - local cur map + local cur map cmd COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur + cmd=${1##*/} - [ $1 = ypcat ] && [ $COMP_CWORD -gt 1 ] && return 0 - [ $1 = ypmatch ] && [ $COMP_CWORD -gt 2 ] && return 0 + [[ $cmd == ypcat && $COMP_CWORD -gt 1 ]] && return 0 + [[ $cmd == ypmatch && $COMP_CWORD -gt 2 ]] && return 0 - if [ $1 = ypmatch ] && [ $COMP_CWORD -eq 1 ] && \ - [ ${#COMP_WORDS[@]} -eq 3 ]; then + if [[ $cmd == ypmatch && $COMP_CWORD -eq 1 && \ + ${#COMP_WORDS[@]} -eq 3 ]]; then map=${COMP_WORDS[2]} COMPREPLY=( $( compgen -W '$( ypcat $map | \ cut -d':' -f 1 )' -- "$cur") ) else - [ $1 = ypmatch ] && [ $COMP_CWORD -ne 2 ] && return 0 + [[ $cmd == ypmatch && $COMP_CWORD -ne 2 ]] && return 0 COMPREPLY=( $( compgen -W \ - '$( echo $(ypcat -x | cut -d"\"" -f 2))' -- "$cur")) + '$( printf "%s\n" $(ypcat -x | cut -d"\"" -f 2) )' -- "$cur")) fi return 0 diff -Nru bash-completion-1.1/contrib/_yum bash-completion-1.2/contrib/_yum --- bash-completion-1.1/contrib/_yum 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/_yum 2010-06-13 11:21:19.000000000 +0100 @@ -1,175 +1,152 @@ +# Use of this file is deprecated. Upstream completion is available in +# yum > 3.2.25, use that instead. + # yum(8) completion have yum && { _yum_list() { - if [[ "$1" == all ]] ; then - # Try to strip in between headings like "Available Packages" - # This will obviously only work for English :P - COMPREPLY=( $( yum -d 0 -C list $1 "$cur*" 2>/dev/null | \ - sed -ne '/^\(Available\|Installed\|Updated\) /d' \ - -e 's/[[:space:]].*//p' ) ) - else - # Drop first line (e.g. "Updated Packages") - COMPREPLY=( $( yum -d 0 -C list $1 "$cur*" 2>/dev/null | \ - sed -ne 1d -e 's/[[:space:]].*//p' ) ) - fi + if [[ "$1" == all ]] ; then + # Try to strip in between headings like "Available Packages" + # This will obviously only work for English :P + COMPREPLY=( $( yum -d 0 -C list $1 "$cur*" 2>/dev/null | \ + sed -ne '/^Available /d' -e '/^Installed /d' -e '/^Updated /d' \ + -e 's/[[:space:]].*//p' ) ) + else + # Drop first line (e.g. "Updated Packages") + COMPREPLY=( $( yum -d 0 -C list $1 "$cur*" 2>/dev/null | \ + sed -ne 1d -e 's/[[:space:]].*//p' ) ) + fi } _yum_repolist() { - # -d 0 causes repolist to output nothing as of yum 3.2.22: - # http://yum.baseurl.org/ticket/83 - # Drop first ("repo id repo name") and last ("repolist: ...") rows - yum --noplugins -C repolist $1 2>/dev/null | \ - sed -ne '/^repo\(\s\+id\|list:\)/d' -e 's/[[:space:]].*//p' + # -d 0 causes repolist to output nothing as of yum 3.2.22: + # http://yum.baseurl.org/ticket/83 + # Drop first ("repo id repo name") and last ("repolist: ...") rows + yum --noplugins -C repolist $1 2>/dev/null | \ + sed -ne '/^repo\s\s*id/d' -e '/^repolist:/d' -e 's/[[:space:]].*//p' } _yum_plugins() { - command ls /usr/lib/yum-plugins/*.py{,c,o} 2>/dev/null \ - | sed -ne 's|.*/\([^./]*\)\.py[co]\?$|\1|p' | sort -u + command ls /usr/lib/yum-plugins/*.py{,c,o} 2>/dev/null \ + | sed -ne 's|.*/\([^./]*\)\.py[co]\{0,1\}$|\1|p' | sort -u } _yum() { - local cur prev special split=false - - COMPREPLY=() - cur=`_get_cword` - prev=${COMP_WORDS[COMP_CWORD-1]} - - for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do - if [[ ${COMP_WORDS[i]} == @(install|update|upgrade|remove|erase|deplist|info) ]]; then - special=${COMP_WORDS[i]} - fi - done - - if [ -n "$special" ]; then - # TODO: install|update|upgrade should not match *src.rpm - if [[ "$cur" == */* && "$special" == @(deplist|install|update|upgrade) ]]; then - _filedir rpm - return 0 - fi - case $special in - install) - _yum_list available - return 0 - ;; - deplist|info) - _yum_list all - return 0 - ;; - upgrade|update) - _yum_list updates - return 0 - ;; - remove|erase) - # _rpm_installed_packages is not arch-qualified - _yum_list installed - return 0 - ;; - esac - fi - - _split_longopt && split=true - - case $prev in - list) - COMPREPLY=( $( compgen -W 'all available updates \ - installed extras obsoletes recent' -- $cur ) ) - ;; - clean) - COMPREPLY=( $( compgen -W 'packages headers metadata \ - cache dbcache all' -- $cur ) ) - ;; - repolist) - COMPREPLY=( $( compgen -W 'all enabled disabled' -- $cur ) ) - ;; - localinstall|localupdate) - # TODO: should not match *src.rpm - _filedir rpm - ;; - -d|-e) - COMPREPLY=( $( compgen -W '0 1 2 3 4 5 6 7 8 9 10' -- $cur ) ) - ;; - -c) - _filedir - ;; - --installroot) - _filedir -d - ;; - --enablerepo) - COMPREPLY=( $( compgen -W '$( _yum_repolist disabled )' -- $cur ) ) - ;; - --disablerepo) - COMPREPLY=( $( compgen -W '$( _yum_repolist enabled )' -- $cur ) ) - ;; - --disableexcludes) - COMPREPLY=( $( compgen -W '$( _yum_repolist all ) \ - all main' -- $cur ) ) - ;; - --enableplugin|--disableplugin) - COMPREPLY=( $( compgen -W '$( _yum_plugins )' -- $cur )) - ;; - --color) - COMPREPLY=( $( compgen -W 'always auto never' -- $cur )) - ;; - -R|-x|--exclude) - # argument required but no completions available - return 0 - ;; - -h|--help|--version) - # no other options useful with these - return 0 - ;; - *) - COMPREPLY=( $( compgen -W 'install update \ - check-update upgrade remove erase list info \ - provides whatprovides clean makecache \ - groupinstall groupupdate grouplist \ - groupremove groupinfo search shell resolvedep \ - localinstall localupdate deplist repolist \ - help' -- $cur ) ) - ;; - esac - - $split && return 0 - - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-h --help -t --tolerant -C -c -R \ - -d --showduplicates -e -q --quiet -v --verbose -y \ - --version --installroot --enablerepo --disablerepo -x \ - --exclude --disableexcludes --obsoletes --noplugins \ - --nogpgcheck --disableplugin --enableplugin \ - --skip-broken --color' -- $cur ) ) - return 0 - fi -} -} && -complete -F _yum $filenames yum + local cur prev special i split=false -# yum-arch(8) completion -# -have yum-arch && -_yum_arch() -{ - local cur - COMPREPLY=() - cur=`_get_cword` - - case "$cur" in - -*) - COMPREPLY=( $( compgen -W '-d -v -vv -n -c -z -s -l -q' -- $cur ) ) - ;; - *) - _filedir -d - ;; - esac + COMPREPLY=() + _get_comp_words_by_ref cur prev - return 0 + for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do + if [[ ${COMP_WORDS[i]} == @(install|update|upgrade|remove|erase|deplist|info) ]]; then + special=${COMP_WORDS[i]} + fi + done + + if [ -n "$special" ]; then + # TODO: install|update|upgrade should not match *src.rpm + if [[ "$cur" == */* && "$special" == @(deplist|install|update|upgrade) ]]; then + _filedir rpm + return 0 + fi + case $special in + install) + _yum_list available + return 0 + ;; + deplist|info) + _yum_list all + return 0 + ;; + upgrade|update) + _yum_list updates + return 0 + ;; + remove|erase) + # _rpm_installed_packages is not arch-qualified + _yum_list installed + return 0 + ;; + esac + fi + + _split_longopt && split=true + + case $prev in + list) + COMPREPLY=( $( compgen -W 'all available updates \ + installed extras obsoletes recent' -- $cur ) ) + ;; + clean) + COMPREPLY=( $( compgen -W 'packages headers metadata \ + cache dbcache all' -- $cur ) ) + ;; + repolist) + COMPREPLY=( $( compgen -W 'all enabled disabled' -- $cur ) ) + ;; + localinstall|localupdate) + # TODO: should not match *src.rpm + _filedir rpm + ;; + -d|-e) + COMPREPLY=( $( compgen -W '0 1 2 3 4 5 6 7 8 9 10' -- $cur ) ) + ;; + -c) + _filedir + ;; + --installroot) + _filedir -d + ;; + --enablerepo) + COMPREPLY=( $( compgen -W '$( _yum_repolist disabled )' -- $cur ) ) + ;; + --disablerepo) + COMPREPLY=( $( compgen -W '$( _yum_repolist enabled )' -- $cur ) ) + ;; + --disableexcludes) + COMPREPLY=( $( compgen -W '$( _yum_repolist all ) all main' \ + -- $cur ) ) + ;; + --enableplugin|--disableplugin) + COMPREPLY=( $( compgen -W '$( _yum_plugins )' -- $cur )) + ;; + --color) + COMPREPLY=( $( compgen -W 'always auto never' -- $cur )) + ;; + -R|-x|--exclude) + # argument required but no completions available + return 0 + ;; + -h|--help|--version) + # no other options useful with these + return 0 + ;; + *) + COMPREPLY=( $( compgen -W 'install update check-update upgrade \ + remove erase list info provides whatprovides clean makecache \ + groupinstall groupupdate grouplist groupremove groupinfo \ + search shell resolvedep localinstall localupdate deplist \ + repolist help' -- $cur ) ) + ;; + esac + + $split && return 0 + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--help --tolerant -C -c -R -d \ + --showduplicates -e --quiet --verbose -y --version --installroot \ + --enablerepo --disablerepo --exclude --disableexcludes --obsoletes \ + --noplugins --nogpgcheck --disableplugin --enableplugin \ + --skip-broken --color' -- $cur ) ) + return 0 + fi +} } && -complete -F _yum_arch $filenames yum-arch +complete -F _yum -o filenames yum # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/yum-arch bash-completion-1.2/contrib/yum-arch --- bash-completion-1.1/contrib/yum-arch 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/contrib/yum-arch 2010-06-13 11:21:19.000000000 +0100 @@ -5,21 +5,15 @@ { local cur COMPREPLY=() - cur=`_get_cword` + _get_comp_words_by_ref cur - case "$cur" in - -*) - COMPREPLY=( $( compgen -W '-d -v -vv -n -c -z -s -l \ - -q' -- "$cur" ) ) - ;; - *) - _filedir -d - ;; - esac - - return 0 + if [[ "$cur" == -* ]] ; then + COMPREPLY=( $( compgen -W '-d -v -vv -n -c -z -s -l -q' -- "$cur" ) ) + else + _filedir -d + fi } && -complete -F _yum_arch $filenames yum-arch +complete -F _yum_arch -o filenames yum-arch # Local variables: # mode: shell-script diff -Nru bash-completion-1.1/contrib/_yum-utils bash-completion-1.2/contrib/_yum-utils --- bash-completion-1.1/contrib/_yum-utils 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/contrib/_yum-utils 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,31 @@ +# Use of this file is deprecated. Upstream completion is available in +# yum-utils >= 1.1.24, use that instead. + +# bash completion for repomanage + +have repomanage && +_repomanage() +{ + local cur prev + + COMPREPLY=() + _get_comp_words_by_ref cur prev + + [[ "$prev" == -@(h|-help|k|-keep) ]] && return 0 + + if [[ "$cur" == -* ]] ; then + COMPREPLY=( $( compgen -W '--old --new --space \ + --keep --nocheck --help' -- "$cur" ) ) + else + _filedir -d + fi +} && +complete -F _repomanage -o filenames repomanage + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/debian/changelog bash-completion-1.2/debian/changelog --- bash-completion-1.1/debian/changelog 2010-08-03 08:27:43.000000000 +0100 +++ bash-completion-1.2/debian/changelog 2010-08-03 08:13:07.000000000 +0100 @@ -1,3 +1,55 @@ +bash-completion (1:1.2-2ubuntu1) maverick; urgency=low + + * Merge from Debian (LP: #612862). Remaining changes: + * debian/patches/disable-avahi-browse.diff: + Disable avahi-browse since it scales poorly in the current + form. (LP: #510591) + + -- Mikhail Turov Mon, 02 Aug 2010 14:25:57 +0100 + +bash-completion (1:1.2-2) unstable; urgency=low + + * debian/patches/: + - 00-fix_586210.patch added, fixes a weird error while loading + service(8) completions. Thanks to John Hedges (Closes: #586210) + * debian/control: + - added Replaces: cryptsetup (Closes: #586161) + + -- David Paleino Sun, 20 Jun 2010 09:57:35 +0200 + +bash-completion (1:1.2-1) unstable; urgency=low + + * New upstream release + - contrib/munin-node fixed (Closes: #550943) + - contrib/dpkg fixed -W and --show completing on .?(u)deb's + (Closes: #552109) + - added munindoc completion to contrib/munin-node, thanks to Tom + Feiner (Closes: #553371) + - contrib/cpio: added missing completions for -?, --help, --license, + --usage, --version and (-p) --to-stdout (Closes: #557436) + - added .okular completion to okular (Closes: #545530) + - refreshed reportbug completion, added --from-buildd (Closes: #579471) + - special-case "apt-get source" (Closes: #572000) + - added lintian completion (Closes: #547361) + - protect various completions from unusual user input by not embedding the + input in external command arguments (Closes: #552631) + - awk and sed usage portability fixes (Closes: #501479) + - fix completion of usernames (Closes: #511788) + - fix mount handling of escapes (LP: #219971, Closes: #511149) + - update find completion (LP: #570113) + * debian/patches/* removed, merged upstream + * debian/control: + - add Conflicts/Replaces on xen-tools (<= 4.1-1) (Closes: #550590) + - Standards-Version bumped to 3.8.4, no changes needed + * debian/links: remove dangling symlink in /usr/share/doc/bash + (Closes: #565447) + * debian/watch: fix regex to avoid old timestamp-based releases + * debian/preinst: definitely remove anything in /usr/share/doc/bash/ + * debian/source/format: using 3.0 (quilt) + * debin/rules made minimal + + -- David Paleino Wed, 16 Jun 2010 19:03:06 +0200 + bash-completion (1:1.1-3ubuntu4) maverick; urgency=low * Revert the patch for LP: #546794 due to an unforseen side effect. diff -Nru bash-completion-1.1/debian/control bash-completion-1.2/debian/control --- bash-completion-1.1/debian/control 2010-08-03 08:27:43.000000000 +0100 +++ bash-completion-1.2/debian/control 2010-08-03 08:13:07.000000000 +0100 @@ -4,18 +4,24 @@ Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Bash Completion Maintainers Uploaders: David Paleino -Build-Depends: debhelper (>= 7.0.50), quilt (>= 0.46-7~) +Build-Depends: + debhelper (>= 7.0.50) Build-Depends-Indep: perl -Standards-Version: 3.8.3 +Standards-Version: 3.8.4 Vcs-Git: git://git.debian.org/git/bash-completion/debian.git Vcs-Browser: http://git.debian.org/?p=bash-completion/debian.git Homepage: http://bash-completion.alioth.debian.org Package: bash-completion Architecture: all -Depends: bash (>= 3.1dfsg-9), - ${misc:Depends} -Replaces: bash (<< 3.1dfsg-9) +Depends: + bash (>= 3.2) + , ${misc:Depends} +Conflicts: xen-tools (<= 4.1-1) +Replaces: + bash (<< 3.1dfsg-9) + , xen-tools (<= 4.1-1) + , cryptsetup (<< 2:1.1.2-2) Description: programmable completion for the bash shell bash completion extends bash's standard completion behavior to achieve complex command lines with just a few keystrokes. This project was diff -Nru bash-completion-1.1/debian/links bash-completion-1.2/debian/links --- bash-completion-1.1/debian/links 2010-08-03 08:27:43.000000000 +0100 +++ bash-completion-1.2/debian/links 2010-08-03 08:13:07.000000000 +0100 @@ -1,2 +1 @@ -usr/share/doc/bash-completion/contrib usr/share/doc/bash/completion-contrib usr/share/doc/bash-completion/README.gz usr/share/doc/bash/README.bash_completion.gz diff -Nru bash-completion-1.1/debian/patches/00-fix_586210.patch bash-completion-1.2/debian/patches/00-fix_586210.patch --- bash-completion-1.1/debian/patches/00-fix_586210.patch 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/debian/patches/00-fix_586210.patch 2010-08-03 08:13:07.000000000 +0100 @@ -0,0 +1,31 @@ +commit 1f8b55a92aba6d03bb4c43dade1f8b2e2b847b61 +Author: David Paleino +Date: Thu Jun 17 17:43:18 2010 +0200 +Subject: fixed "service" completion, thanks to John Hedges (Debian: #586210) + The patch makes it safe even when every file in /etc/init.d/* + has a proper completion (unlikely, but seems like it happened). + . + Thanks to John Hedges for the patch, slightly + modified to make it more compact. +Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=586210 + +--- + contrib/service | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +--- bash-completion.orig/contrib/service ++++ bash-completion/contrib/service +@@ -32,9 +32,10 @@ _service() + return 0 + } && + complete -F _service service +-[ -d /etc/init.d/ ] && complete -F _service -o default \ +- $(for i in /etc/init.d/*; do +- complete -p ${i##*/} &>/dev/null || printf '%s\n' ${i##*/}; done) ++[ -d /etc/init.d/ ] && ( ++ services=$(for i in /etc/init.d/*; do ++ complete -p ${i##*/} &>/dev/null || printf '%s\n' ${i##*/}; done) ++ [ -n "$services" ] && complete -F _service -o default $services;) + + # Local variables: + # mode: shell-script diff -Nru bash-completion-1.1/debian/patches/01-fix_550943.patch bash-completion-1.2/debian/patches/01-fix_550943.patch --- bash-completion-1.1/debian/patches/01-fix_550943.patch 2010-08-03 08:27:43.000000000 +0100 +++ bash-completion-1.2/debian/patches/01-fix_550943.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -Patch already applied upstream ---- - contrib/munin-node | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - ---- bash-completion-debian.orig/contrib/munin-node -+++ bash-completion-debian/contrib/munin-node -@@ -1,7 +1,7 @@ - # bash completion for munin node - - have munin-run && --_munin-run() -+_munin_run() - { - local cur prev - -@@ -28,10 +28,10 @@ _munin-run() - -- "$cur" ) ) - fi - } && --complete -F _munin-run munin-run -+complete -F _munin_run munin-run - - have munin-update && --_munin-update() -+_munin_update() - { - local cur prev - -@@ -56,10 +56,10 @@ _munin-update() - --fork --nofork --stdout --nostdout --timeout' -- "$cur" ) ) - fi - } && --complete -F _munin-update munin-update -+complete -F _munin_update munin-update - - have munin-node-configure && --_munin-node-configure() -+_munin_node_configure() - { - local cur prev - -@@ -92,7 +92,7 @@ _munin-node-configure() - --remove-also --snmp --snmpversion --snmpcommunity' -- "$cur" ) ) - fi - } && --complete -F _munin-node-configure munin-node-configure -+complete -F _munin_node_configure munin-node-configure - - # Local variables: - # mode: shell-script diff -Nru bash-completion-1.1/debian/patches/02-fix_552109.patch bash-completion-1.2/debian/patches/02-fix_552109.patch --- bash-completion-1.1/debian/patches/02-fix_552109.patch 2010-08-03 08:27:43.000000000 +0100 +++ bash-completion-1.2/debian/patches/02-fix_552109.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,16 +0,0 @@ -Upstream's 4b289de ---- - contrib/dpkg | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- bash-completion-debian.orig/contrib/dpkg -+++ bash-completion-debian/contrib/dpkg -@@ -40,7 +40,7 @@ _dpkg() - fi - - case "$prev" in -- -@(c|i|A|I|f|e|x|X|-@(install|unpack|record-avail|contents|info|fsys-tarfile|field|control|extract))) -+ -@(c|i|A|I|f|e|x|X|W|-@(install|unpack|record-avail|contents|info|fsys-tarfile|field|control|extract|show))) - _filedir '?(u)deb' - return 0 - ;; diff -Nru bash-completion-1.1/debian/patches/03-fix_552631.patch bash-completion-1.2/debian/patches/03-fix_552631.patch --- bash-completion-1.1/debian/patches/03-fix_552631.patch 2010-08-03 08:27:43.000000000 +0100 +++ bash-completion-1.2/debian/patches/03-fix_552631.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,206 +0,0 @@ -From: David Paleino -Description: backports for #552631 -Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=552631 - -commit ac644578e07720281452d5ed8c22181365a27d87 -Author: Ville Skyttä -Date: Sun Nov 1 21:01:18 2009 +0200 - - More compgen -W instead of embedding user input in sed/awk/grep fixes. - -commit 1d74adc296c7f5d744c29481536cbd8948768ae5 -Author: Ville Skyttä -Date: Thu Oct 29 19:15:53 2009 +0200 - - Fix sed error in qdbus completions containing slashes (Debian: 552631). - ---- - bash_completion | 55 +++++++++++++++++++++++++++--------------------------- - contrib/configure | 14 +++++++------ - contrib/getent | 8 +++---- - contrib/qdbus | 10 ++------- - 4 files changed, 43 insertions(+), 44 deletions(-) - ---- bash-completion-debian.orig/bash_completion -+++ bash-completion-debian/bash_completion -@@ -470,23 +470,23 @@ _configured_interfaces() - { - if [ -f /etc/debian_version ]; then - # Debian system -- COMPREPLY=( $( sed -ne 's|^iface \([^ ]\+\).*$|\1|p' \ -- /etc/network/interfaces ) ) -+ COMPREPLY=( $( compgen -W "$( sed -ne 's|^iface \([^ ]\+\).*$|\1|p' \ -+ /etc/network/interfaces )" -- "$cur" ) ) - elif [ -f /etc/SuSE-release ]; then - # SuSE system -- COMPREPLY=( $( command ls \ -- /etc/sysconfig/network/ifcfg-* | \ -- sed -ne 's|.*ifcfg-\('"$cur"'.*\)|\1|p' ) ) -+ COMPREPLY=( $( compgen -W "$( command ls \ -+ /etc/sysconfig/network/ifcfg-* | \ -+ sed -ne 's|.*ifcfg-\(.*\)|\1|p' )" -- "$cur" ) ) - elif [ -f /etc/pld-release ]; then - # PLD Linux -- COMPREPLY=( $( command ls -B \ -- /etc/sysconfig/interfaces | \ -- sed -ne 's|.*ifcfg-\('"$cur"'.*\)|\1|p' ) ) -+ COMPREPLY=( $( compgen -W "$( command ls -B \ -+ /etc/sysconfig/interfaces | \ -+ sed -ne 's|.*ifcfg-\(.*\)|\1|p' )" -- "$cur" ) ) - else - # Assume Red Hat -- COMPREPLY=( $( command ls \ -- /etc/sysconfig/network-scripts/ifcfg-* | \ -- sed -ne 's|.*ifcfg-\('"$cur"'.*\)|\1|p' ) ) -+ COMPREPLY=( $( compgen -W "$( command ls \ -+ /etc/sysconfig/network-scripts/ifcfg-* | \ -+ sed -ne 's|.*ifcfg-\(.*\)|\1|p' )" -- "$cur" ) ) - fi - } - -@@ -514,7 +514,8 @@ _available_interfaces() - fi - - COMPREPLY=( $( eval $cmd 2>/dev/null | \ -- sed -ne 's|^\('"$cur"'[^[:space:][:punct:]]\{1,\}\).*$|\1|p') ) -+ awk '/^[^[:space:]]/ { print $1 }' ) ) -+ COMPREPLY=( $( compgen -W '${COMPREPLY[@]/%[[:punct:]]/}' -- "$cur" ) ) - } - - # This function expands tildes in pathnames -@@ -608,14 +609,13 @@ _uids() - _gids() - { - if type getent &>/dev/null; then -- COMPREPLY=( $( getent group | \ -- awk -F: '{if ($3 ~ /^'"$cur"'/) print $3}' ) ) -+ COMPREPLY=( $( compgen -W '$( getent group | cut -d: -f3 )' \ -+ -- "$cur" ) ) - elif type perl &>/dev/null; then - COMPREPLY=( $( compgen -W '$( perl -e '"'"'while (($gid) = (getgrent)[2]) { print $gid . "\n" }'"'"' )' -- "$cur" ) ) - else - # make do with /etc/group -- COMPREPLY=( $( awk 'BEGIN {FS=":"} {if ($3 ~ /^'"$cur"'/) print $3}'\ -- /etc/group ) ) -+ COMPREPLY=( $( compgen -W '$( cut -d: -f3 /etc/group )' -- "$cur" ) ) - fi - } - -@@ -641,8 +641,8 @@ _modules() - { - local modpath - modpath=/lib/modules/$1 -- COMPREPLY=( $( command ls -R $modpath | \ -- sed -ne 's/^\('"$cur"'.*\)\.k\?o\(\|.gz\)$/\1/p') ) -+ COMPREPLY=( $( compgen -W "$( command ls -R $modpath | \ -+ sed -ne 's/^\(.*\)\.k\?o\(\|.gz\)$/\1/p' )" -- "$cur" ) ) - } - - # This function completes on installed modules -@@ -650,7 +650,7 @@ _modules() - _installed_modules() - { - COMPREPLY=( $( compgen -W "$( PATH="$PATH:/sbin" lsmod | \ -- awk '{if (NR != 1) print $1}' )" -- $1 ) ) -+ awk '{if (NR != 1) print $1}' )" -- "$1" ) ) - } - - # This function completes on user:group format -@@ -885,15 +885,17 @@ deinstall clean clean-depends kernel bui - for i in {,/usr}/{,s}bin/showmount; do [ -x $i ] && sm=$i && break; done - - if [ -n "$sm" ] && [[ "$cur" == *:* ]]; then -- COMPREPLY=( $( $sm -e ${cur%%:*} | sed 1d | \ -- grep ^${cur#*:} | awk '{print $1}' ) ) -+ COMPREPLY=( $( compgen -W "$( $sm -e ${cur%%:*} | sed 1d | \ -+ awk '{print $1}' )" -- "$cur" ) ) - elif [[ "$cur" == //* ]]; then - host=${cur#//} - host=${host%%/*} - if [ -n "$host" ]; then -- COMPREPLY=( $( compgen -W "$( echo $( smbclient -d 0 -NL $host 2>/dev/null| -- sed -ne '/^['"$'\t '"']*Sharename/,/^$/p' | -- sed -ne '3,$s|^[^A-Za-z]*\([^'"$'\t '"']*\).*$|//'$host'/\1|p' ) )" -- "$cur" ) ) -+ COMPREPLY=( $( compgen -P "//$host" -W \ -+ "$( smbclient -d 0 -NL $host 2>/dev/null | -+ sed -ne '/^['"$'\t '"']*Sharename/,/^$/p' | -+ sed -ne '3,$s|^[^A-Za-z]*\([^'"$'\t '"']*\).*$|/\1|p' )" \ -+ -- "${cur#//$host}" ) ) - fi - elif [ -r /etc/vfstab ]; then - # Solaris -@@ -960,9 +962,8 @@ deinstall clean clean-depends kernel bui - if [ $COMP_CWORD -gt 1 ] && - [[ "${COMP_WORDS[COMP_CWORD-1]}" != -* ]]; then - # do module parameter completion -- COMPREPLY=( $( /sbin/modinfo -p ${COMP_WORDS[1]} 2>/dev/null | \ -- awk '{if ($1 ~ /^parm:/ && $2 ~ /^'"$cur"'/) { print $2 } \ -- else if ($1 !~ /:/ && $1 ~ /^'"$cur"'/) { print $1 }}' ) ) -+ COMPREPLY=( $( compgen -W "$( /sbin/modinfo -p ${COMP_WORDS[1]} | \ -+ cut -d: -f1 )" -- "$cur" ) ) - else - _modules $(uname -r) - fi ---- bash-completion-debian.orig/contrib/configure -+++ bash-completion-debian/contrib/configure -@@ -12,13 +12,15 @@ _configure() - [[ "$cur" != -* ]] && return 0 - - if [ -n "$COMP_CONFIGURE_HINTS" ]; then -- COMPREPLY=( $( $1 --help 2>&1 | awk '/^ --[A-Za-z]/ { print $1; \ -- if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,].*//g' | \ -- grep ^$cur ) ) -+ COMPREPLY=( $( compgen -W "$( $1 --help 2>&1 | \ -+ awk '/^ --[A-Za-z]/ { print $1; \ -+ if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,].*//g' )" \ -+ -- "$cur" ) ) - else -- COMPREPLY=( $( $1 --help 2>&1 | awk '/^ --[A-Za-z]/ { print $1; \ -- if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,=].*//g' | \ -- grep ^$cur ) ) -+ COMPREPLY=( $( compgen -W "$( $1 --help 2>&1 | \ -+ awk '/^ --[A-Za-z]/ { print $1; \ -+ if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,=].*//g' )" \ -+ -- "$cur" ) ) - fi - } - complete -F _configure $default configure ---- bash-completion-debian.orig/contrib/getent -+++ bash-completion-debian/contrib/getent -@@ -27,13 +27,13 @@ _getent() - return 0 - ;; - protocols|networks|ahosts|ahostsv4|ahostsv6|rpc) -- COMPREPLY=( $( getent "$prev" | \ -- sed -ne 's|^\('"$cur"'[^[:space:]]*\).*|\1|p' ) ) -+ COMPREPLY=( $( compgen -W "$( getent "$prev" | \ -+ awk '{ print $1 }' )" -- "$cur" ) ) - return 0 - ;; - aliases|shadow) -- COMPREPLY=( $( getent "$prev" | \ -- sed -ne 's|^\('"$cur"'[^:]*\).*|\1|p' ) ) -+ COMPREPLY=( $( compgen -W "$( getent "$prev" | cut -d: -f1 )" \ -+ -- "$cur" ) ) - return 0 - ;; - esac ---- bash-completion-debian.orig/contrib/qdbus -+++ bash-completion-debian/contrib/qdbus -@@ -7,13 +7,9 @@ _qdbus() - - COMPREPLY=() - cur=`_get_cword` -- if [ -z "$cur" ]; then -- compstr=${COMP_WORDS[*]} -- else -- compstr=$( command echo ${COMP_WORDS[*]} | sed "s/ ${cur/\//\\/}$//" ) -- fi -- COMPREPLY=( $( compgen -W '$( command $compstr | sed s/\(.*\)// )' \ -- -- "$cur" ) ) -+ [ -n "$cur" ] && unset COMP_WORDS[${#COMP_WORDS[@]}-1] -+ COMPREPLY=( $( compgen -W '$( command ${COMP_WORDS[@]} | sed s/\(.*\)// )' \ -+ -- "$cur" ) ) - } && - complete -F _qdbus qdbus - diff -Nru bash-completion-1.1/debian/patches/disable-avahi-browse.diff bash-completion-1.2/debian/patches/disable-avahi-browse.diff --- bash-completion-1.1/debian/patches/disable-avahi-browse.diff 2010-08-03 08:27:43.000000000 +0100 +++ bash-completion-1.2/debian/patches/disable-avahi-browse.diff 2010-08-03 08:13:07.000000000 +0100 @@ -1,29 +1,27 @@ === modified file 'bash_completion' ---- bash-completion-1.1.orig/bash_completion 2009-11-14 23:42:55 +0000 -+++ bash-completion-1.1/bash_completion 2010-04-14 09:39:48 +0000 -@@ -1305,13 +1305,17 @@ - # of the service, and if it contains ";", it may mistify - # the result. But on Gentoo (at least), -k isn't available - # (even if mentioned in the manpage), so... -- if type avahi-browse >&/dev/null; then -- if [ -n "$(pidof avahi-daemon)" ]; then -- COMPREPLY=( "${COMPREPLY[@]}" $( -- compgen -W "$( avahi-browse -cpr _workstation._tcp | \ -- grep ^= | cut -d\; -f7 | sort -u )" -- "$cur" ) ) -- fi -- fi +--- import/bash_completion 2010-08-02 13:36:23 +0000 ++++ merge/bash_completion 2010-08-03 06:38:36 +0000 +@@ -1315,12 +1315,17 @@ + # avahi's services DB. We don't need the name of the service, and if it + # contains ";", it may mistify the result. But on Gentoo (at least), + # -k isn't available (even if mentioned in the manpage), so... +- if type avahi-browse >&/dev/null; then +- COMPREPLY=( "${COMPREPLY[@]}" $( \ +- compgen -P "$prefix$user" -S "$suffix" -W \ +- "$( avahi-browse -cpr _workstation._tcp 2>/dev/null | \ +- awk -F';' '/^=/ { print $7 }' | sort -u )" -- "$cur" ) ) +- fi + -+ # This feature is disabled because it does not scale to -+ # larger networks. See: -+ # https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/510591 -+ #if type avahi-browse >&/dev/null; then -+ # if [ -n "$(pidof avahi-daemon)" ]; then -+ # COMPREPLY=( "${COMPREPLY[@]}" $( -+ # compgen -W "$( avahi-browse -cpr _workstation._tcp | \ -+ # grep ^= | cut -d\; -f7 | sort -u )" -- "$cur" ) ) -+ # fi -+ #fi ++ # This feature is disabled because it does not scale to ++ # larger networks. See: ++ # https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/510591 ++ ++ #if type avahi-browse >&/dev/null; then ++ # COMPREPLY=( "${COMPREPLY[@]}" $( \ ++ # compgen -P "$prefix$user" -S "$suffix" -W \ ++ # "$( avahi-browse -cpr _workstation._tcp 2>/dev/null | \ ++ # awk -F';' '/^=/ { print $7 }' | sort -u )" -- "$cur" ) ) ++ #fi - # apply suffix and prefix - for (( i=0; i < ${#COMPREPLY[@]}; i++ )); do - + # Add results of normal hostname completion, unless + # `COMP_KNOWN_HOSTS_WITH_HOSTFILE' is set to an empty value. diff -Nru bash-completion-1.1/debian/patches/series bash-completion-1.2/debian/patches/series --- bash-completion-1.1/debian/patches/series 2010-08-03 08:27:43.000000000 +0100 +++ bash-completion-1.2/debian/patches/series 2010-08-03 08:13:07.000000000 +0100 @@ -1,6 +1,2 @@ -01-fix_550943.patch -02-fix_552109.patch -03-fix_552631.patch -bash-completion-wget-o-fix -fix-multiple-known_hosts +00-fix_586210.patch disable-avahi-browse.diff diff -Nru bash-completion-1.1/debian/preinst bash-completion-1.2/debian/preinst --- bash-completion-1.1/debian/preinst 2010-08-03 08:27:43.000000000 +0100 +++ bash-completion-1.2/debian/preinst 2010-08-03 08:13:07.000000000 +0100 @@ -4,7 +4,7 @@ case "$1" in install|upgrade) - if [ -d /usr/share/doc/bash/completion-contrib ] && [ ! -h /usr/share/doc/bash/completion-contrib ]; then + if [ -e /usr/share/doc/bash/completion-contrib ]; then rm -rf /usr/share/doc/bash/completion-contrib fi ;; diff -Nru bash-completion-1.1/debian/README.source bash-completion-1.2/debian/README.source --- bash-completion-1.1/debian/README.source 2010-08-03 08:27:43.000000000 +0100 +++ bash-completion-1.2/debian/README.source 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -bash-completion for Debian --------------------------- - -This package uses quilt to manage all modifications to the upstream -source. Changes are stored in the source package as diffs in -debian/patches and applied during the build. - -Please read how to use quilt in the provided documentation: - - /usr/share/doc/quilt/README.source - - -- David Paleino Sat, 14 Nov 2009 18:07:48 +0100 diff -Nru bash-completion-1.1/debian/rules bash-completion-1.2/debian/rules --- bash-completion-1.1/debian/rules 2010-08-03 08:27:43.000000000 +0100 +++ bash-completion-1.2/debian/rules 2010-08-03 08:13:07.000000000 +0100 @@ -5,7 +5,13 @@ #export DH_VERBOSE=1 VERSION=$(shell parsechangelog | grep ^Version | awk -F": " '{print $$2}' | cut -d"-" -f1) -d = debian/bash-completion + +override_dh_auto_configure: + dh_auto_configure + + # needed by the testsuite + [ -d test/log ] || mkdir -p test/log + [ -d test/tmp ] || mkdir -p test/tmp override_dh_compress: dh_compress -Xcontrib @@ -19,28 +25,14 @@ --release $(VERSION) \ $< > debian/extra/$@ -build: build-stamp -build-stamp: - dh --with quilt build - touch $@ - -clean: - dh --with quilt $@ - -install: install-stamp -install-stamp: build - dh install +override_dh_install: + dh_install for i in mtx; do \ rm -vf debian/bash-completion/etc/bash_completion.d/$$i; \ done - touch $@ - -binary-indep: build install - dh $@ +override_dh_auto_test: + # nothing -binary-arch: - -binary: binary-indep binary-arch - -.PHONY: build clean binary-indep binary-arch binary install +%: + dh $@ diff -Nru bash-completion-1.1/debian/source/format bash-completion-1.2/debian/source/format --- bash-completion-1.1/debian/source/format 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/debian/source/format 2010-08-03 08:27:44.061148182 +0100 @@ -0,0 +1 @@ +3.0 (quilt) diff -Nru bash-completion-1.1/debian/watch bash-completion-1.2/debian/watch --- bash-completion-1.1/debian/watch 2010-08-03 08:27:43.000000000 +0100 +++ bash-completion-1.2/debian/watch 2010-08-03 08:13:07.000000000 +0100 @@ -1,2 +1,3 @@ version=3 +opts=uversionmangle=s/^(200.*)/0.\1/ \ http://bash-completion.alioth.debian.org/files/bash-completion-(\d+.*)\.tar\.gz diff -Nru bash-completion-1.1/Makefile.am bash-completion-1.2/Makefile.am --- bash-completion-1.1/Makefile.am 2009-10-09 13:49:31.000000000 +0100 +++ bash-completion-1.2/Makefile.am 2010-06-13 11:21:19.000000000 +0100 @@ -1,8 +1,10 @@ +SUBDIRS = test sysconf_DATA = bash_completion bashcompdir = $(sysconfdir)/bash_completion.d -bashcomp_DATA = contrib/ant \ +bashcomp_DATA = contrib/abook \ + contrib/ant \ contrib/apache2ctl \ contrib/apt \ contrib/apt-build \ @@ -13,7 +15,7 @@ contrib/bind-utils \ contrib/bitkeeper \ contrib/bittorrent \ - contrib/bluez-utils \ + contrib/bluez \ contrib/brctl \ contrib/bzip2 \ contrib/cardctl \ @@ -23,12 +25,14 @@ contrib/cksfv \ contrib/clisp \ contrib/configure \ + contrib/coreutils \ contrib/cowsay \ contrib/cpan2dist \ contrib/cpio \ contrib/cups \ + contrib/cryptsetup \ contrib/cvs \ - contrib/dcop \ + contrib/cvsps \ contrib/dd \ contrib/dhclient \ contrib/dict \ @@ -37,6 +41,7 @@ contrib/dsniff \ contrib/findutils \ contrib/freeciv \ + contrib/fuse \ contrib/gcc \ contrib/gcl \ contrib/gdb \ @@ -48,20 +53,26 @@ contrib/gpg2 \ contrib/gzip \ contrib/heimdal \ + contrib/hping2 \ contrib/iconv \ + contrib/ifupdown \ contrib/imagemagick \ contrib/info \ contrib/iptables \ contrib/ipmitool \ + contrib/ipsec \ + contrib/ipv6calc \ contrib/isql \ contrib/jar \ contrib/java \ + contrib/k3b \ contrib/kldload \ contrib/larch \ contrib/ldapvi \ contrib/lftp \ contrib/lilo \ contrib/links \ + contrib/lintian \ contrib/lisp \ contrib/lvm \ contrib/lzma \ @@ -72,11 +83,12 @@ contrib/mc \ contrib/mcrypt \ contrib/mdadm \ + contrib/medusa \ contrib/minicom \ contrib/mkinitrd \ - contrib/mock \ - contrib/modules \ + contrib/module-init-tools \ contrib/monodevelop \ + contrib/mount \ contrib/mplayer \ contrib/msynctool \ contrib/mtx \ @@ -85,6 +97,7 @@ contrib/mysqladmin \ contrib/ncftp \ contrib/net-tools \ + contrib/nmap \ contrib/ntpdate \ contrib/openldap \ contrib/openssl \ @@ -94,17 +107,18 @@ contrib/pkg-config \ contrib/pkg_install \ contrib/pkgtools \ + contrib/pm-utils \ contrib/portupgrade \ contrib/postfix \ contrib/postgresql \ contrib/povray \ + contrib/procps \ contrib/python \ contrib/qdbus \ contrib/qemu \ contrib/quota-tools \ contrib/rcs \ contrib/rdesktop \ - contrib/repomanage \ contrib/reportbug \ contrib/resolvconf \ contrib/rfkill \ @@ -114,14 +128,17 @@ contrib/rpmcheck \ contrib/rrdtool \ contrib/rsync \ + contrib/rtcwake \ contrib/samba \ contrib/sbcl \ contrib/screen \ + contrib/service \ contrib/shadow \ contrib/sitecopy \ contrib/smartctl \ contrib/snownews \ contrib/ssh \ + contrib/sshfs \ contrib/strace \ contrib/svk \ contrib/sysctl \ @@ -131,10 +148,13 @@ contrib/unace \ contrib/unrar \ contrib/update-alternatives \ + contrib/util-linux \ contrib/vncviewer \ contrib/vpnc \ contrib/wireless-tools \ contrib/wodim \ + contrib/wol \ + contrib/wtf \ contrib/wvdial \ contrib/xhost \ contrib/xm \ @@ -142,8 +162,19 @@ contrib/xmlwf \ contrib/xmms \ contrib/xrandr \ + contrib/xsltproc \ contrib/xz \ contrib/yp-tools \ contrib/yum-arch -EXTRA_DIST = $(sysconf_DATA) $(bashcomp_DATA) contrib/_subversion contrib/_yum +profiledir = $(sysconfdir)/profile.d +profile_DATA = bash_completion.sh + +bash_completion.sh: bash_completion.sh.in Makefile + sed -e 's|@sysconfdir[@]|$(sysconfdir)|' <$(srcdir)/$@.in >$@ + +CLEANFILES = bash_completion.sh + +EXTRA_DIST = CHANGES $(sysconf_DATA) $(bashcomp_DATA) bash_completion.sh.in \ + contrib/_mock contrib/_modules contrib/_subversion contrib/_yum \ + contrib/_yum-utils diff -Nru bash-completion-1.1/Makefile.in bash-completion-1.2/Makefile.in --- bash-completion-1.1/Makefile.in 2009-10-10 15:24:38.000000000 +0100 +++ bash-completion-1.2/Makefile.in 2010-06-16 16:45:23.000000000 +0100 @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -47,6 +47,13 @@ CONFIG_CLEAN_VPATH_FILES = SOURCES = DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -68,8 +75,21 @@ am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__installdirs = "$(DESTDIR)$(bashcompdir)" "$(DESTDIR)$(sysconfdir)" -DATA = $(bashcomp_DATA) $(sysconf_DATA) +am__installdirs = "$(DESTDIR)$(bashcompdir)" "$(DESTDIR)$(profiledir)" \ + "$(DESTDIR)$(sysconfdir)" +DATA = $(bashcomp_DATA) $(profile_DATA) $(sysconf_DATA) +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ + $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ + distdir dist dist-all distcheck +ETAGS = etags +CTAGS = ctags +DEJATOOL = $(PACKAGE) +RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir +EXPECT = expect +RUNTEST = runtest +DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -77,7 +97,32 @@ { test ! -d "$(distdir)" \ || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr "$(distdir)"; }; } -DIST_ARCHIVES = $(distdir).tar.gz +am__relativize = \ + dir0=`pwd`; \ + sed_first='s,^\([^/]*\)/.*$$,\1,'; \ + sed_rest='s,^[^/]*/*,,'; \ + sed_last='s,^.*/\([^/]*\)$$,\1,'; \ + sed_butlast='s,/*[^/]*$$,,'; \ + while test -n "$$dir1"; do \ + first=`echo "$$dir1" | sed -e "$$sed_first"`; \ + if test "$$first" != "."; then \ + if test "$$first" = ".."; then \ + dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ + dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ + else \ + first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ + if test "$$first2" = "$$first"; then \ + dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ + else \ + dir2="../$$dir2"; \ + fi; \ + dir0="$$dir0"/"$$first"; \ + fi; \ + fi; \ + dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ + done; \ + reldir="$$dir2" +DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print @@ -153,9 +198,11 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +SUBDIRS = test sysconf_DATA = bash_completion bashcompdir = $(sysconfdir)/bash_completion.d -bashcomp_DATA = contrib/ant \ +bashcomp_DATA = contrib/abook \ + contrib/ant \ contrib/apache2ctl \ contrib/apt \ contrib/apt-build \ @@ -166,7 +213,7 @@ contrib/bind-utils \ contrib/bitkeeper \ contrib/bittorrent \ - contrib/bluez-utils \ + contrib/bluez \ contrib/brctl \ contrib/bzip2 \ contrib/cardctl \ @@ -176,12 +223,14 @@ contrib/cksfv \ contrib/clisp \ contrib/configure \ + contrib/coreutils \ contrib/cowsay \ contrib/cpan2dist \ contrib/cpio \ contrib/cups \ + contrib/cryptsetup \ contrib/cvs \ - contrib/dcop \ + contrib/cvsps \ contrib/dd \ contrib/dhclient \ contrib/dict \ @@ -190,6 +239,7 @@ contrib/dsniff \ contrib/findutils \ contrib/freeciv \ + contrib/fuse \ contrib/gcc \ contrib/gcl \ contrib/gdb \ @@ -201,20 +251,26 @@ contrib/gpg2 \ contrib/gzip \ contrib/heimdal \ + contrib/hping2 \ contrib/iconv \ + contrib/ifupdown \ contrib/imagemagick \ contrib/info \ contrib/iptables \ contrib/ipmitool \ + contrib/ipsec \ + contrib/ipv6calc \ contrib/isql \ contrib/jar \ contrib/java \ + contrib/k3b \ contrib/kldload \ contrib/larch \ contrib/ldapvi \ contrib/lftp \ contrib/lilo \ contrib/links \ + contrib/lintian \ contrib/lisp \ contrib/lvm \ contrib/lzma \ @@ -225,11 +281,12 @@ contrib/mc \ contrib/mcrypt \ contrib/mdadm \ + contrib/medusa \ contrib/minicom \ contrib/mkinitrd \ - contrib/mock \ - contrib/modules \ + contrib/module-init-tools \ contrib/monodevelop \ + contrib/mount \ contrib/mplayer \ contrib/msynctool \ contrib/mtx \ @@ -238,6 +295,7 @@ contrib/mysqladmin \ contrib/ncftp \ contrib/net-tools \ + contrib/nmap \ contrib/ntpdate \ contrib/openldap \ contrib/openssl \ @@ -247,17 +305,18 @@ contrib/pkg-config \ contrib/pkg_install \ contrib/pkgtools \ + contrib/pm-utils \ contrib/portupgrade \ contrib/postfix \ contrib/postgresql \ contrib/povray \ + contrib/procps \ contrib/python \ contrib/qdbus \ contrib/qemu \ contrib/quota-tools \ contrib/rcs \ contrib/rdesktop \ - contrib/repomanage \ contrib/reportbug \ contrib/resolvconf \ contrib/rfkill \ @@ -267,14 +326,17 @@ contrib/rpmcheck \ contrib/rrdtool \ contrib/rsync \ + contrib/rtcwake \ contrib/samba \ contrib/sbcl \ contrib/screen \ + contrib/service \ contrib/shadow \ contrib/sitecopy \ contrib/smartctl \ contrib/snownews \ contrib/ssh \ + contrib/sshfs \ contrib/strace \ contrib/svk \ contrib/sysctl \ @@ -284,10 +346,13 @@ contrib/unace \ contrib/unrar \ contrib/update-alternatives \ + contrib/util-linux \ contrib/vncviewer \ contrib/vpnc \ contrib/wireless-tools \ contrib/wodim \ + contrib/wol \ + contrib/wtf \ contrib/wvdial \ contrib/xhost \ contrib/xm \ @@ -295,12 +360,19 @@ contrib/xmlwf \ contrib/xmms \ contrib/xrandr \ + contrib/xsltproc \ contrib/xz \ contrib/yp-tools \ contrib/yum-arch -EXTRA_DIST = $(sysconf_DATA) $(bashcomp_DATA) contrib/_subversion contrib/_yum -all: all-am +profiledir = $(sysconfdir)/profile.d +profile_DATA = bash_completion.sh +CLEANFILES = bash_completion.sh +EXTRA_DIST = CHANGES $(sysconf_DATA) $(bashcomp_DATA) bash_completion.sh.in \ + contrib/_mock contrib/_modules contrib/_subversion contrib/_yum \ + contrib/_yum-utils + +all: all-recursive .SUFFIXES: am--refresh: @@ -357,6 +429,26 @@ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(bashcompdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bashcompdir)" && rm -f $$files +install-profileDATA: $(profile_DATA) + @$(NORMAL_INSTALL) + test -z "$(profiledir)" || $(MKDIR_P) "$(DESTDIR)$(profiledir)" + @list='$(profile_DATA)'; test -n "$(profiledir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(profiledir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(profiledir)" || exit $$?; \ + done + +uninstall-profileDATA: + @$(NORMAL_UNINSTALL) + @list='$(profile_DATA)'; test -n "$(profiledir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(profiledir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(profiledir)" && rm -f $$files install-sysconfDATA: $(sysconf_DATA) @$(NORMAL_INSTALL) test -z "$(sysconfdir)" || $(MKDIR_P) "$(DESTDIR)$(sysconfdir)" @@ -377,12 +469,173 @@ test -n "$$files" || exit 0; \ echo " ( cd '$(DESTDIR)$(sysconfdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sysconfdir)" && rm -f $$files + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @fail= failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique tags: TAGS -TAGS: +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi ctags: CTAGS -CTAGS: - +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-DEJAGNU: site.exp + srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \ + EXPECT=$(EXPECT); export EXPECT; \ + runtest=$(RUNTEST); \ + if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ + exit_status=0; l='$(DEJATOOL)'; for tool in $$l; do \ + if $$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \ + then :; else exit_status=1; fi; \ + done; \ + else echo "WARNING: could not find \`runtest'" 1>&2; :;\ + fi; \ + exit $$exit_status +site.exp: Makefile + @echo 'Making a new site.exp file...' + @echo '## these variables are automatically generated by make ##' >site.tmp + @echo '# Do not edit here. If you wish to override these values' >>site.tmp + @echo '# edit the last section' >>site.tmp + @echo 'set srcdir $(srcdir)' >>site.tmp + @echo "set objdir `pwd`" >>site.tmp + @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp + @test ! -f site.exp || \ + sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp + @-rm -f site.bak + @test ! -f site.exp || mv site.exp site.bak + @mv site.tmp site.exp + +distclean-DEJAGNU: + -rm -f site.exp site.bak + -l='$(DEJATOOL)'; for tool in $$l; do \ + rm -f $$tool.sum $$tool.log; \ + done distdir: $(DISTFILES) $(am__remove_distdir) @@ -416,8 +669,37 @@ || exit 1; \ fi; \ done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + fi; \ + done + @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ + $(am__relativize); \ + new_distdir=$$reldir; \ + dir1=$$subdir; dir2="$(top_distdir)"; \ + $(am__relativize); \ + new_top_distdir=$$reldir; \ + echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ + echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ + ($(am__cd) $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$new_top_distdir" \ + distdir="$$new_distdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + am__skip_mode_fix=: \ + distdir) \ + || exit 1; \ + fi; \ + done -test -n "$(am__skip_mode_fix)" \ - || find "$(distdir)" -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ @@ -425,7 +707,6 @@ dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) - dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) @@ -453,6 +734,7 @@ dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then @@ -461,17 +743,17 @@ distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ - bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ - unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac @@ -531,21 +813,23 @@ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am -check: check-am + $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU +check: check-recursive all-am: Makefile $(DATA) -installdirs: - for dir in "$(DESTDIR)$(bashcompdir)" "$(DESTDIR)$(sysconfdir)"; do \ +installdirs: installdirs-recursive +installdirs-am: + for dir in "$(DESTDIR)$(bashcompdir)" "$(DESTDIR)$(profiledir)" "$(DESTDIR)$(sysconfdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -installcheck: installcheck-am +installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ @@ -554,6 +838,7 @@ mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -562,91 +847,101 @@ maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -clean: clean-am +clean: clean-recursive clean-am: clean-generic mostlyclean-am -distclean: distclean-am +distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile -distclean-am: clean-am distclean-generic +distclean-am: clean-am distclean-DEJAGNU distclean-generic \ + distclean-tags -dvi: dvi-am +dvi: dvi-recursive dvi-am: -html: html-am +html: html-recursive html-am: -info: info-am +info: info-recursive info-am: -install-data-am: install-bashcompDATA +install-data-am: install-bashcompDATA install-profileDATA -install-dvi: install-dvi-am +install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-sysconfDATA -install-html: install-html-am +install-html: install-html-recursive install-html-am: -install-info: install-info-am +install-info: install-info-recursive install-info-am: install-man: -install-pdf: install-pdf-am +install-pdf: install-pdf-recursive install-pdf-am: -install-ps: install-ps-am +install-ps: install-ps-recursive install-ps-am: installcheck-am: -maintainer-clean: maintainer-clean-am +maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic -mostlyclean: mostlyclean-am +mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic -pdf: pdf-am +pdf: pdf-recursive pdf-am: -ps: ps-am +ps: ps-recursive ps-am: -uninstall-am: uninstall-bashcompDATA uninstall-sysconfDATA +uninstall-am: uninstall-bashcompDATA uninstall-profileDATA \ + uninstall-sysconfDATA + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) check-am \ + ctags-recursive install-am install-strip tags-recursive -.MAKE: install-am install-strip +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-DEJAGNU check-am clean \ + clean-generic ctags ctags-recursive dist dist-all dist-bzip2 \ + dist-gzip dist-lzma dist-shar dist-tarZ dist-xz dist-zip \ + distcheck distclean distclean-DEJAGNU distclean-generic \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-bashcompDATA install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-profileDATA install-ps \ + install-ps-am install-strip install-sysconfDATA installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-bashcompDATA uninstall-profileDATA \ + uninstall-sysconfDATA -.PHONY: all all-am am--refresh check check-am clean clean-generic dist \ - dist-all dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ \ - dist-xz dist-zip distcheck distclean distclean-generic \ - distcleancheck distdir distuninstallcheck dvi dvi-am html \ - html-am info info-am install install-am install-bashcompDATA \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - install-sysconfDATA installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \ - uninstall-bashcompDATA uninstall-sysconfDATA +bash_completion.sh: bash_completion.sh.in Makefile + sed -e 's|@sysconfdir[@]|$(sysconfdir)|' <$(srcdir)/$@.in >$@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru bash-completion-1.1/README bash-completion-1.2/README --- bash-completion-1.1/README 2009-10-03 14:25:36.000000000 +0100 +++ bash-completion-1.2/README 2010-06-13 11:21:19.000000000 +0100 @@ -1,59 +1,31 @@ INSTALLATION ------------ -The easiest way to install this software is to use a package, such as -the RPM that I maintain for Red Hat Linux, the .deb package for -Debian/GNU Linux or Ubuntu, etc. You still need to source it from either -/etc/bashrc or ~/.bashrc (or any other file sourcing those). You can do -this by simply using: +The easiest way to install this software is to use a package; it is available +in many operating system distributions. The package's name is usually +bash-completion. Depending on the package, you may still need to source it +from either /etc/bashrc or ~/.bashrc (or any other file sourcing those). You +can do this by simply using: # Use bash-completion, if available if [ -f /etc/bash_completion ]; then . /etc/bash_completion fi -(if you happen to have *only* bash >= 2.04, see further if not) +(if you happen to have *only* bash >= 3.2 installed, see further if not) If you don't have the package readily available for your distribution, or you simply don't want to do this, put the bash_completion file somewhere on your system and source it from either /etc/bashrc or ~/.bashrc, as explained above. -Here's another possible way of doing that from /etc/bashrc: - -# Check for interactive shell. -if [ -n "$PS1" ]; then - if [ $bmajor -eq 2 -a $bminor '>' 04 ] || [ $bmajor -gt 2 ]; then - if [ -r /etc/bash_completion ]; then - # Source completion code. - . /etc/bash_completion - fi - fi -fi -unset bash bminor bmajor - -This code checks that the version of bash that is parsing the code is -later than 2.04 and, if so, sources the bash completion code. - -While this code may, at first, seem overly complex, the advantage of -using it is that it will also parse correctly when interpreted by bash -1.x. If you have bash 1.x and bash 2/3.x users on your system, you -must avoid using constructs that were not valid under 1.x syntax. - -If your system has an /etc/profile.d directory, you might instead want -to add a script called bash_completion.sh to that directory. Add the -above code, preceded by the following: - -# Check for bash. -[ -z "$BASH_VERSION" ] && return - -In this case, all *.sh scripts in /etc/profile.d are sourced from -/etc/bashrc by Bourne-like shells, so you need the extra check for bash -in order to avoid sourcing the rest of the script if a shell other than -bash is running. - -For your convenience, a sample bash_completion.sh file is included in -the package. +A more elaborate way that takes care of not loading on old, unsupported +bash versions as well as some other conditions is included in the bash +completion package as bash_completion.sh. If your system has the +/etc/profile.d directory and loads all files from it automatically, +you may place the file in it. If not, place the file somewhere on your +system and source it from /etc/bashrc or ~/.bashrc, or copy its contents +to one of those files. If you're using MacOS X, /etc/bashrc is apparently not sourced at all. In that case, you should put the bash_completion file in /sw/etc and add @@ -72,35 +44,10 @@ TROUBLESHOOTING --------------- -If you get errors about 'complete' or 'compgen' not accepting the -g -flag, you are probably running bash 2.05 and should either apply the -group completion patch, download a prepatched bash binary of 2.05, or -upgrade to 2.05a or later. - -If you find that some commands, such as 'cd /usr', end with a -trailing space instead of appending a /, you are probably running the -base version of bash 2.05, which suffers from a bug that causes the -'-o filenames' option to the complete built-in to be ignored. You can -fix this by applying the following official patch from the bash -maintainer: - - ftp://ftp.gnu.org/gnu/bash/bash-2.05b-patches/bash205b-006 - -If you get errors about 'complete' not accepting the -o flag, you are -probably running bash 2.04. In this case, you should upgrade to bash -2.05a or later. However, I have endeavoured to make the code detect -this version of bash and work around this issue, so please inform me -if you still encounter this error. - -Copies of the patches and prepatched versions of bash are available -from: - - http://www.caliban.org/bash/ - If you find that a given function is producing errors under certain circumstances when you attempt completion, try running 'set -v' or 'set -x' prior to attempting the completion again. This will produce -useful debugging output that will aid me in fixing the problem if you +useful debugging output that will aid us in fixing the problem if you are unable to do so yourself. Turn off the trace output by running either 'set +v' or 'set +x'. @@ -142,7 +89,7 @@ somewhere in your start-up files. This causes bash to flag the use of any uninitialised shell variables as an error. -Whilst I try to avoid references to uninitialised variables in the +Whilst we try to avoid references to uninitialised variables in the code, there seem to be at least some cases where bash issues this warning even though the variable in question has been initialised. @@ -151,36 +98,6 @@ recursively. This seems to confuse bash and it issues spurious warnings if 'nounset' is set. -V. - -After upgrading to bash 3.1, you may notice that completing on certain -commands now fails with a message something like this: - - sed: -e expression #1, char 20: unterminated `s' command - -The reason for this is that bash 3.1 contains the following, -innocent-looking bug fix (from bash's CHANGES file): - - t. Fixed a bug that caused the expanded value of a $'...' string - to be incorrectly re-quoted if it occurred within a - double-quoted ${...} parameter expansion. - -Unfortunately, this also had the side effect of causing single quotes -to be stripped from $'...' strings inside double-quoted command -substitutions. Confused? - -Efforts have been made to work around this issue in the bash -completion code as of the 20060301 release. All previous versions are -vulnerable to the problem. However, it's possible that, even in the -20060301 release and later, affected code remains. - -The issue has now been officially recognised as a regression in the -bash 3.1 release and is fixed by official patch 11. If you encounter -problems of this nature, please apply the patch below to your copy of -bash: - - ftp://ftp.gnu.org/gnu/bash/bash-3.1-patches/bash31-011 - FAQ --- @@ -241,7 +158,7 @@ correctly. The slashes are removed and everything looks like it's in a single directory. Why is this? -A. It's a choice I had to make. bash's programmable completion is +A. It's a choice we had to make. bash's programmable completion is limited in how it handles the list of possible completions it returns. @@ -263,13 +180,13 @@ the trailing / and I have to hit again. I don't like this. A. This has nothing to do with bash_completion. It's the default for - completing symlinks to directories in bash 2.05a, and was added + completing symlinks to directories since bash 2.05a, and was added because sometimes you want to operate on the symlink itself, rather than what it points to. - In bash 2.05b and later, you can get the pre-2.05a behaviour back - by putting 'set mark-symlinked-directories on' in your /etc/inputrc - or ~/.inputrc file. + You can get the pre-2.05a behaviour back by putting + 'set mark-symlinked-directories on' in your /etc/inputrc or ~/.inputrc + file. Q. Completion goes awry when I try to complete on something that contains a colon. @@ -295,14 +212,6 @@ Unfortunately, there's no way to turn this off. The only thing you can do is escape the colons with a backslash. -Q. Where did urpmi completion go? - -A. Guillaume Rousse now maintains it separately as - part of the urpmi RPM package. - - CVS: http://cvs.mandrakesoft.com/cgi-bin/cvsweb.cgi/soft/urpmi/ - Web: http://urpmi.org/ - Q. Why is rpm completion so slow with -q? A. Probably because the database is being queried every time and this uses a @@ -335,7 +244,7 @@ set show-all-if-ambiguous on This will allow single tab completion as opposed to requiring a - double tab. This makes things much more pleasant, in my opinion. + double tab. This makes things much more pleasant, in our opinion. set visible-stats on @@ -343,28 +252,10 @@ denoting its type, in a similar way to ls(1) with -F or --classify. set page-completions off - + This turns off the use of the internal pager when returning long completion lists. -Q. This code is rubbish/not bad/pretty good/the best thing since - sliced bread. How can I show my appreciation? - -A. If you're a registered Freshmeat user, take a moment to rate the - project at: - - http://freshmeat.net/rate/19041/ - - Of course, writing to me and letting me know how you feel also works. - Patches and new completion routines are most welcome, too. - -Q. How can I stay abreast of new releases? - -A. If you're a registered Freshmeat user, you can subscribe to new release - announcements at: - - http://freshmeat.net/subscribe/19041/ - Q. Is bash the be-all-and-end-all of completion as far as shells go? A. Absolutely not. zsh has an extremely sophisticated completion system @@ -397,23 +288,16 @@ start interpreters. Use lightweight programs such as grep(1), awk(1) and sed(1). -- Use the full power of bash 2.x. Programmable completion has only - been available since bash 2.04, so you may as well use all the - features of that version of bash to optimise your code. However, be - careful when using features added since 2.04, since not everyone - will be able to use them. Be ESPECIALLY careful of using features - exclusive to 3.x, as many people are still using 2.x. - - For example, here strings (<<<) were not added until 2.05b, so don't - use them for the time being. - - Similarly, 3.0 added the use of the regex operator '=~', commonly - found in Perl and Ruby. Whilst this is very useful, it's not yet - safe to assume its ubiquity. - - On the other hand, extended globs were added in bash 2.02 and often - enable you to avoid the use of external programs, which are - expensive to fork and execute, so do make full use of those: +- Use the full power of bash >= 3.2. We no longer support earlier bash + versions, so you may as well use all the features of that version of + bash to optimise your code. However, be careful when using features + added since bash 3.2, since not everyone will be able to use them. Be + ESPECIALLY careful of using features exclusive to 4.x, as many people + are still using 3.x. + + For example, extended globs often enable you to avoid the use of + external programs, which are expensive to fork and execute, so do + make full use of those: ?(pattern-list) - match zero or one occurrences of patterns *(pattern-list) - match zero or more occurrences of patterns @@ -460,15 +344,37 @@ difference in speed), but all embedding cases should be documented with rationale in comments in the code. +- When completing available options, offer only the most descriptive + ones as completion results if there are multiple options that do the + same thing. Usually this means that long options should be preferred + over the corresponding short ones. This way the user is more likely + to find what she's looking for and there's not too much noise to + choose from, and there are less situations where user choice would be + needed in the first place. Note that this concerns only display of + available completions; argument processing/completion for options that + take an argument should be made to work with all known variants for + the functionality at hand. For example if -s, -S, and --something do + the same thing and require an argument, offer only --something as a + completion when completing option names starting with a dash, but do + implement required argument processing for all -s, -S, and --something. + Note that GNU versions of various standard commands tend to have long + options while other userland implementations of the same commands may + not have them, and it would be good to have the completions work for + as many userlands as possible so things aren't always that simple. + - Do not write to the file-system under any circumstances. This can create race conditions, is inefficient, violates the principle of least surprise and lacks robustness. -- Send your patches as unified diffs. You can make these with - 'diff -u'. +- Send small, incremental diffs that do one thing. Don't cram unrelated + changes into a single diff. -- Send small, incremental diffs that affect a single function. Don't - cram massive, unrelated patches into a single diff. +- Generate patches preferably against the git repository, with "git + format-patch origin/master" (assuming the diff was against the + origin/master branch), and don't forget the entry for the CHANGES file + if you feel that the change deserves one. If you don't have git + available or can't access the repository for some reason, generate + patches as unified diffs ('diff -u'). - If your code was written for a particular platform, try to make it portable to other platforms, so that everyone may enjoy it. If your @@ -477,20 +383,32 @@ have a command with the same name. In particular, do not use GNU extensions to commands like sed and - awk if you can write your code another way. If you really must use - them, however, do feel free to do so. + awk if you can write your code another way. If you really, REALLY must + use them, do so if there's no other sane way to do what you're doing. + The "Shell and Utilities" volume of the POSIX specification is a good + starting reference for portable use of various utilities, see + http://www.opengroup.org/onlinepubs/9699919799/ - Read the existing source code for examples of how to solve particular problems. Read the bash man page for details of all the programming tools available to you within the shell. -- Please test your code thoroughly before sending it to me. I don't - have access to all the commands for which I am sent completion - functions, so I am unable to test them all personally. If your code +- Please test your code thoroughly before sending it to us. We don't + have access to all the commands for which we are sent completion + functions, so we are unable to test them all personally. If your code is accepted into the distribution, a lot of people will try it out, so try to do a thorough job of eradicating all the bugs before you - send it to me. - + send it to us. + +- File bugs, enhancement requests (preferably with patches attached) at + the project tracker at https://alioth.debian.org/projects/bash-completion/ + Sending them to the developers list usually works too, but bits are more + likely to fall through the cracks that way compared to the tracker. + +- Use printf(1) instead of echo(1) for portability reasons, and be sure to + invoke commands that are often found aliased (such as ls or grep etc) + using the "command" (or "builtin") command as appropriate. + -- -Ian Macdonald -ian@caliban.org +bash-completion developers +bash-completion-devel@lists.alioth.debian.org diff -Nru bash-completion-1.1/test/completion/a2ps.exp bash-completion-1.2/test/completion/a2ps.exp --- bash-completion-1.1/test/completion/a2ps.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/a2ps.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions a2ps diff -Nru bash-completion-1.1/test/completion/abook.exp bash-completion-1.2/test/completion/abook.exp --- bash-completion-1.1/test/completion/abook.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/abook.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions abook diff -Nru bash-completion-1.1/test/completion/acroread.exp bash-completion-1.2/test/completion/acroread.exp --- bash-completion-1.1/test/completion/acroread.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/acroread.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,12 @@ +set test "Completion via _filedir_xspec() should be installed" +set cmd "complete -p acroread" +send "$cmd\r" + +set expected "^$cmd\r\ncomplete -o filenames -F _filedir_xspec acroread\r\n/@$" +expect { + -re $expected { pass "$test" } + -re /@ { fail "$test at prompt" } +}; # expect + + +source "lib/completions/acroread.exp" diff -Nru bash-completion-1.1/test/completion/add_members.exp bash-completion-1.2/test/completion/add_members.exp --- bash-completion-1.1/test/completion/add_members.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/add_members.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions add_members diff -Nru bash-completion-1.1/test/completion/alias.exp bash-completion-1.2/test/completion/alias.exp --- bash-completion-1.1/test/completion/alias.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/alias.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions alias diff -Nru bash-completion-1.1/test/completion/animate.exp bash-completion-1.2/test/completion/animate.exp --- bash-completion-1.1/test/completion/animate.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/animate.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions animate diff -Nru bash-completion-1.1/test/completion/ant.exp bash-completion-1.2/test/completion/ant.exp --- bash-completion-1.1/test/completion/ant.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/ant.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions ant diff -Nru bash-completion-1.1/test/completion/apache2ctl.exp bash-completion-1.2/test/completion/apache2ctl.exp --- bash-completion-1.1/test/completion/apache2ctl.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/apache2ctl.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions apache2ctl diff -Nru bash-completion-1.1/test/completion/apt-build.exp bash-completion-1.2/test/completion/apt-build.exp --- bash-completion-1.1/test/completion/apt-build.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/apt-build.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions apt-build diff -Nru bash-completion-1.1/test/completion/apt-cache.exp bash-completion-1.2/test/completion/apt-cache.exp --- bash-completion-1.1/test/completion/apt-cache.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/apt-cache.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions apt-cache diff -Nru bash-completion-1.1/test/completion/apt-get.exp bash-completion-1.2/test/completion/apt-get.exp --- bash-completion-1.1/test/completion/apt-get.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/apt-get.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions apt-get diff -Nru bash-completion-1.1/test/completion/aptitude.exp bash-completion-1.2/test/completion/aptitude.exp --- bash-completion-1.1/test/completion/aptitude.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/aptitude.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions aptitude diff -Nru bash-completion-1.1/test/completion/arch.exp bash-completion-1.2/test/completion/arch.exp --- bash-completion-1.1/test/completion/arch.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/arch.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions arch diff -Nru bash-completion-1.1/test/completion/arpspoof.exp bash-completion-1.2/test/completion/arpspoof.exp --- bash-completion-1.1/test/completion/arpspoof.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/arpspoof.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions arpspoof diff -Nru bash-completion-1.1/test/completion/aspell.exp bash-completion-1.2/test/completion/aspell.exp --- bash-completion-1.1/test/completion/aspell.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/aspell.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions aspell diff -Nru bash-completion-1.1/test/completion/autoconf.exp bash-completion-1.2/test/completion/autoconf.exp --- bash-completion-1.1/test/completion/autoconf.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/autoconf.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions autoconf diff -Nru bash-completion-1.1/test/completion/automake.exp bash-completion-1.2/test/completion/automake.exp --- bash-completion-1.1/test/completion/automake.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/automake.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions automake diff -Nru bash-completion-1.1/test/completion/autorpm.exp bash-completion-1.2/test/completion/autorpm.exp --- bash-completion-1.1/test/completion/autorpm.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/autorpm.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions autorpm diff -Nru bash-completion-1.1/test/completion/awk.exp bash-completion-1.2/test/completion/awk.exp --- bash-completion-1.1/test/completion/awk.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/awk.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions awk diff -Nru bash-completion-1.1/test/completion/bash.exp bash-completion-1.2/test/completion/bash.exp --- bash-completion-1.1/test/completion/bash.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/bash.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions bash diff -Nru bash-completion-1.1/test/completion/bc.exp bash-completion-1.2/test/completion/bc.exp --- bash-completion-1.1/test/completion/bc.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/bc.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions bc diff -Nru bash-completion-1.1/test/completion/bison.exp bash-completion-1.2/test/completion/bison.exp --- bash-completion-1.1/test/completion/bison.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/bison.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions bison diff -Nru bash-completion-1.1/test/completion/bk.exp bash-completion-1.2/test/completion/bk.exp --- bash-completion-1.1/test/completion/bk.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/bk.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions bk diff -Nru bash-completion-1.1/test/completion/brctl.exp bash-completion-1.2/test/completion/brctl.exp --- bash-completion-1.1/test/completion/brctl.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/brctl.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions brctl diff -Nru bash-completion-1.1/test/completion/btdownloadcurses.py.exp bash-completion-1.2/test/completion/btdownloadcurses.py.exp --- bash-completion-1.1/test/completion/btdownloadcurses.py.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/btdownloadcurses.py.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions btdownloadcurses.py diff -Nru bash-completion-1.1/test/completion/btdownloadgui.py.exp bash-completion-1.2/test/completion/btdownloadgui.py.exp --- bash-completion-1.1/test/completion/btdownloadgui.py.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/btdownloadgui.py.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions btdownloadgui.py diff -Nru bash-completion-1.1/test/completion/btdownloadheadless.py.exp bash-completion-1.2/test/completion/btdownloadheadless.py.exp --- bash-completion-1.1/test/completion/btdownloadheadless.py.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/btdownloadheadless.py.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions btdownloadheadless.py diff -Nru bash-completion-1.1/test/completion/bzip2.exp bash-completion-1.2/test/completion/bzip2.exp --- bash-completion-1.1/test/completion/bzip2.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/bzip2.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions bzip2 diff -Nru bash-completion-1.1/test/completion/cancel.exp bash-completion-1.2/test/completion/cancel.exp --- bash-completion-1.1/test/completion/cancel.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/cancel.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions cancel diff -Nru bash-completion-1.1/test/completion/cardctl.exp bash-completion-1.2/test/completion/cardctl.exp --- bash-completion-1.1/test/completion/cardctl.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/cardctl.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions cardctl diff -Nru bash-completion-1.1/test/completion/cat.exp bash-completion-1.2/test/completion/cat.exp --- bash-completion-1.1/test/completion/cat.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/cat.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions cat diff -Nru bash-completion-1.1/test/completion/cc.exp bash-completion-1.2/test/completion/cc.exp --- bash-completion-1.1/test/completion/cc.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/cc.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions cc diff -Nru bash-completion-1.1/test/completion/cd.exp bash-completion-1.2/test/completion/cd.exp --- bash-completion-1.1/test/completion/cd.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/cd.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions cd diff -Nru bash-completion-1.1/test/completion/cdrecord.exp bash-completion-1.2/test/completion/cdrecord.exp --- bash-completion-1.1/test/completion/cdrecord.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/cdrecord.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions cdrecord diff -Nru bash-completion-1.1/test/completion/c++.exp bash-completion-1.2/test/completion/c++.exp --- bash-completion-1.1/test/completion/c++.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/c++.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions c++ diff -Nru bash-completion-1.1/test/completion/change_pw.exp bash-completion-1.2/test/completion/change_pw.exp --- bash-completion-1.1/test/completion/change_pw.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/change_pw.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions change_pw diff -Nru bash-completion-1.1/test/completion/check_db.exp bash-completion-1.2/test/completion/check_db.exp --- bash-completion-1.1/test/completion/check_db.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/check_db.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions check_db diff -Nru bash-completion-1.1/test/completion/check_perms.exp bash-completion-1.2/test/completion/check_perms.exp --- bash-completion-1.1/test/completion/check_perms.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/check_perms.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions check_perms diff -Nru bash-completion-1.1/test/completion/chgrp.exp bash-completion-1.2/test/completion/chgrp.exp --- bash-completion-1.1/test/completion/chgrp.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/chgrp.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions chgrp diff -Nru bash-completion-1.1/test/completion/chkconfig.exp bash-completion-1.2/test/completion/chkconfig.exp --- bash-completion-1.1/test/completion/chkconfig.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/chkconfig.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions chkconfig diff -Nru bash-completion-1.1/test/completion/chown.exp bash-completion-1.2/test/completion/chown.exp --- bash-completion-1.1/test/completion/chown.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/chown.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions chown diff -Nru bash-completion-1.1/test/completion/chsh.exp bash-completion-1.2/test/completion/chsh.exp --- bash-completion-1.1/test/completion/chsh.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/chsh.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions chsh diff -Nru bash-completion-1.1/test/completion/ci.exp bash-completion-1.2/test/completion/ci.exp --- bash-completion-1.1/test/completion/ci.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/ci.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions ci diff -Nru bash-completion-1.1/test/completion/civclient.exp bash-completion-1.2/test/completion/civclient.exp --- bash-completion-1.1/test/completion/civclient.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/civclient.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions civclient diff -Nru bash-completion-1.1/test/completion/civserver.exp bash-completion-1.2/test/completion/civserver.exp --- bash-completion-1.1/test/completion/civserver.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/civserver.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions civserver diff -Nru bash-completion-1.1/test/completion/cksfv.exp bash-completion-1.2/test/completion/cksfv.exp --- bash-completion-1.1/test/completion/cksfv.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/cksfv.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions cksfv diff -Nru bash-completion-1.1/test/completion/cleanarch.exp bash-completion-1.2/test/completion/cleanarch.exp --- bash-completion-1.1/test/completion/cleanarch.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/cleanarch.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions cleanarch diff -Nru bash-completion-1.1/test/completion/clisp.exp bash-completion-1.2/test/completion/clisp.exp --- bash-completion-1.1/test/completion/clisp.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/clisp.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions clisp diff -Nru bash-completion-1.1/test/completion/clone_member.exp bash-completion-1.2/test/completion/clone_member.exp --- bash-completion-1.1/test/completion/clone_member.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/clone_member.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions clone_member diff -Nru bash-completion-1.1/test/completion/co.exp bash-completion-1.2/test/completion/co.exp --- bash-completion-1.1/test/completion/co.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/co.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions co diff -Nru bash-completion-1.1/test/completion/composite.exp bash-completion-1.2/test/completion/composite.exp --- bash-completion-1.1/test/completion/composite.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/composite.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions composite diff -Nru bash-completion-1.1/test/completion/config_list.exp bash-completion-1.2/test/completion/config_list.exp --- bash-completion-1.1/test/completion/config_list.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/config_list.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions config_list diff -Nru bash-completion-1.1/test/completion/configure.exp bash-completion-1.2/test/completion/configure.exp --- bash-completion-1.1/test/completion/configure.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/configure.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions configure diff -Nru bash-completion-1.1/test/completion/convert.exp bash-completion-1.2/test/completion/convert.exp --- bash-completion-1.1/test/completion/convert.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/convert.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions convert diff -Nru bash-completion-1.1/test/completion/cowsay.exp bash-completion-1.2/test/completion/cowsay.exp --- bash-completion-1.1/test/completion/cowsay.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/cowsay.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions cowsay diff -Nru bash-completion-1.1/test/completion/cp.exp bash-completion-1.2/test/completion/cp.exp --- bash-completion-1.1/test/completion/cp.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/cp.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions cp diff -Nru bash-completion-1.1/test/completion/cpio.exp bash-completion-1.2/test/completion/cpio.exp --- bash-completion-1.1/test/completion/cpio.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/cpio.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions cpio diff -Nru bash-completion-1.1/test/completion/createdb.exp bash-completion-1.2/test/completion/createdb.exp --- bash-completion-1.1/test/completion/createdb.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/createdb.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions createdb diff -Nru bash-completion-1.1/test/completion/cryptsetup.exp bash-completion-1.2/test/completion/cryptsetup.exp --- bash-completion-1.1/test/completion/cryptsetup.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/cryptsetup.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions cryptsetup diff -Nru bash-completion-1.1/test/completion/csplit.exp bash-completion-1.2/test/completion/csplit.exp --- bash-completion-1.1/test/completion/csplit.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/csplit.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions csplit diff -Nru bash-completion-1.1/test/completion/cut.exp bash-completion-1.2/test/completion/cut.exp --- bash-completion-1.1/test/completion/cut.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/cut.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions cut diff -Nru bash-completion-1.1/test/completion/cvs.exp bash-completion-1.2/test/completion/cvs.exp --- bash-completion-1.1/test/completion/cvs.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/cvs.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions cvs diff -Nru bash-completion-1.1/test/completion/cvsps.exp bash-completion-1.2/test/completion/cvsps.exp --- bash-completion-1.1/test/completion/cvsps.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/cvsps.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions cvsps diff -Nru bash-completion-1.1/test/completion/date.exp bash-completion-1.2/test/completion/date.exp --- bash-completion-1.1/test/completion/date.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/date.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions date diff -Nru bash-completion-1.1/test/completion/dcop.exp bash-completion-1.2/test/completion/dcop.exp --- bash-completion-1.1/test/completion/dcop.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/dcop.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions dcop diff -Nru bash-completion-1.1/test/completion/dd.exp bash-completion-1.2/test/completion/dd.exp --- bash-completion-1.1/test/completion/dd.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/dd.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions dd diff -Nru bash-completion-1.1/test/completion/df.exp bash-completion-1.2/test/completion/df.exp --- bash-completion-1.1/test/completion/df.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/df.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions df diff -Nru bash-completion-1.1/test/completion/dhclient.exp bash-completion-1.2/test/completion/dhclient.exp --- bash-completion-1.1/test/completion/dhclient.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/dhclient.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions dhclient diff -Nru bash-completion-1.1/test/completion/dict.exp bash-completion-1.2/test/completion/dict.exp --- bash-completion-1.1/test/completion/dict.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/dict.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions dict diff -Nru bash-completion-1.1/test/completion/diff.exp bash-completion-1.2/test/completion/diff.exp --- bash-completion-1.1/test/completion/diff.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/diff.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions diff diff -Nru bash-completion-1.1/test/completion/dir.exp bash-completion-1.2/test/completion/dir.exp --- bash-completion-1.1/test/completion/dir.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/dir.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions dir diff -Nru bash-completion-1.1/test/completion/display.exp bash-completion-1.2/test/completion/display.exp --- bash-completion-1.1/test/completion/display.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/display.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions display diff -Nru bash-completion-1.1/test/completion/dnsspoof.exp bash-completion-1.2/test/completion/dnsspoof.exp --- bash-completion-1.1/test/completion/dnsspoof.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/dnsspoof.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions dnsspoof diff -Nru bash-completion-1.1/test/completion/dpkg-deb.exp bash-completion-1.2/test/completion/dpkg-deb.exp --- bash-completion-1.1/test/completion/dpkg-deb.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/dpkg-deb.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions dpkg-deb diff -Nru bash-completion-1.1/test/completion/dpkg.exp bash-completion-1.2/test/completion/dpkg.exp --- bash-completion-1.1/test/completion/dpkg.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/dpkg.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions dpkg diff -Nru bash-completion-1.1/test/completion/dpkg-reconfigure.exp bash-completion-1.2/test/completion/dpkg-reconfigure.exp --- bash-completion-1.1/test/completion/dpkg-reconfigure.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/dpkg-reconfigure.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions dpkg-reconfigure diff -Nru bash-completion-1.1/test/completion/dpkg-source.exp bash-completion-1.2/test/completion/dpkg-source.exp --- bash-completion-1.1/test/completion/dpkg-source.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/dpkg-source.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions dpkg-source diff -Nru bash-completion-1.1/test/completion/dropdb.exp bash-completion-1.2/test/completion/dropdb.exp --- bash-completion-1.1/test/completion/dropdb.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/dropdb.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions dropdb diff -Nru bash-completion-1.1/test/completion/dselect.exp bash-completion-1.2/test/completion/dselect.exp --- bash-completion-1.1/test/completion/dselect.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/dselect.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions dselect diff -Nru bash-completion-1.1/test/completion/dsniff.exp bash-completion-1.2/test/completion/dsniff.exp --- bash-completion-1.1/test/completion/dsniff.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/dsniff.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions dsniff diff -Nru bash-completion-1.1/test/completion/du.exp bash-completion-1.2/test/completion/du.exp --- bash-completion-1.1/test/completion/du.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/du.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions du diff -Nru bash-completion-1.1/test/completion/dumpdb.exp bash-completion-1.2/test/completion/dumpdb.exp --- bash-completion-1.1/test/completion/dumpdb.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/dumpdb.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions dumpdb diff -Nru bash-completion-1.1/test/completion/enscript.exp bash-completion-1.2/test/completion/enscript.exp --- bash-completion-1.1/test/completion/enscript.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/enscript.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions enscript diff -Nru bash-completion-1.1/test/completion/env.exp bash-completion-1.2/test/completion/env.exp --- bash-completion-1.1/test/completion/env.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/env.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions env diff -Nru bash-completion-1.1/test/completion/evince.exp bash-completion-1.2/test/completion/evince.exp --- bash-completion-1.1/test/completion/evince.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/evince.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions evince diff -Nru bash-completion-1.1/test/completion/expand.exp bash-completion-1.2/test/completion/expand.exp --- bash-completion-1.1/test/completion/expand.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/expand.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions expand diff -Nru bash-completion-1.1/test/completion/filesnarf.exp bash-completion-1.2/test/completion/filesnarf.exp --- bash-completion-1.1/test/completion/filesnarf.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/filesnarf.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions filesnarf diff -Nru bash-completion-1.1/test/completion/find.exp bash-completion-1.2/test/completion/find.exp --- bash-completion-1.1/test/completion/find.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/find.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions find diff -Nru bash-completion-1.1/test/completion/find_member.exp bash-completion-1.2/test/completion/find_member.exp --- bash-completion-1.1/test/completion/find_member.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/find_member.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions find_member diff -Nru bash-completion-1.1/test/completion/finger.exp bash-completion-1.2/test/completion/finger.exp --- bash-completion-1.1/test/completion/finger.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/finger.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,6 @@ +source "lib/completions/finger.exp" + +# TODO: Dynamic loading of completions. After the tests have run a first time +# and real completion is installed, the tests can be run a second time. +# +# source "lib/completions/finger.exp" diff -Nru bash-completion-1.1/test/completion/fmt.exp bash-completion-1.2/test/completion/fmt.exp --- bash-completion-1.1/test/completion/fmt.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/fmt.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions fmt diff -Nru bash-completion-1.1/test/completion/fold.exp bash-completion-1.2/test/completion/fold.exp --- bash-completion-1.1/test/completion/fold.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/fold.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions fold diff -Nru bash-completion-1.1/test/completion/g4.exp bash-completion-1.2/test/completion/g4.exp --- bash-completion-1.1/test/completion/g4.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/g4.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions g4 diff -Nru bash-completion-1.1/test/completion/g77.exp bash-completion-1.2/test/completion/g77.exp --- bash-completion-1.1/test/completion/g77.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/g77.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions g77 diff -Nru bash-completion-1.1/test/completion/gcc.exp bash-completion-1.2/test/completion/gcc.exp --- bash-completion-1.1/test/completion/gcc.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/gcc.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions gcc diff -Nru bash-completion-1.1/test/completion/gcj.exp bash-completion-1.2/test/completion/gcj.exp --- bash-completion-1.1/test/completion/gcj.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/gcj.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions gcj diff -Nru bash-completion-1.1/test/completion/gcl.exp bash-completion-1.2/test/completion/gcl.exp --- bash-completion-1.1/test/completion/gcl.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/gcl.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions gcl diff -Nru bash-completion-1.1/test/completion/gdb.exp bash-completion-1.2/test/completion/gdb.exp --- bash-completion-1.1/test/completion/gdb.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/gdb.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions gdb diff -Nru bash-completion-1.1/test/completion/genaliases.exp bash-completion-1.2/test/completion/genaliases.exp --- bash-completion-1.1/test/completion/genaliases.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/genaliases.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions genaliases diff -Nru bash-completion-1.1/test/completion/getent.exp bash-completion-1.2/test/completion/getent.exp --- bash-completion-1.1/test/completion/getent.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/getent.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions getent diff -Nru bash-completion-1.1/test/completion/g++.exp bash-completion-1.2/test/completion/g++.exp --- bash-completion-1.1/test/completion/g++.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/g++.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions g++ diff -Nru bash-completion-1.1/test/completion/gkrellm.exp bash-completion-1.2/test/completion/gkrellm.exp --- bash-completion-1.1/test/completion/gkrellm.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/gkrellm.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions gkrellm diff -Nru bash-completion-1.1/test/completion/gmplayer.exp bash-completion-1.2/test/completion/gmplayer.exp --- bash-completion-1.1/test/completion/gmplayer.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/gmplayer.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions gmplayer diff -Nru bash-completion-1.1/test/completion/gnatmake.exp bash-completion-1.2/test/completion/gnatmake.exp --- bash-completion-1.1/test/completion/gnatmake.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/gnatmake.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions gnatmake diff -Nru bash-completion-1.1/test/completion/gpc.exp bash-completion-1.2/test/completion/gpc.exp --- bash-completion-1.1/test/completion/gpc.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/gpc.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions gpc diff -Nru bash-completion-1.1/test/completion/gperf.exp bash-completion-1.2/test/completion/gperf.exp --- bash-completion-1.1/test/completion/gperf.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/gperf.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions gperf diff -Nru bash-completion-1.1/test/completion/gpg.exp bash-completion-1.2/test/completion/gpg.exp --- bash-completion-1.1/test/completion/gpg.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/gpg.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions gpg diff -Nru bash-completion-1.1/test/completion/gprof.exp bash-completion-1.2/test/completion/gprof.exp --- bash-completion-1.1/test/completion/gprof.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/gprof.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions gprof diff -Nru bash-completion-1.1/test/completion/grep.exp bash-completion-1.2/test/completion/grep.exp --- bash-completion-1.1/test/completion/grep.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/grep.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions grep diff -Nru bash-completion-1.1/test/completion/grub.exp bash-completion-1.2/test/completion/grub.exp --- bash-completion-1.1/test/completion/grub.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/grub.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions grub diff -Nru bash-completion-1.1/test/completion/gzip.exp bash-completion-1.2/test/completion/gzip.exp --- bash-completion-1.1/test/completion/gzip.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/gzip.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions gzip diff -Nru bash-completion-1.1/test/completion/hcitool.exp bash-completion-1.2/test/completion/hcitool.exp --- bash-completion-1.1/test/completion/hcitool.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/hcitool.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions hcitool diff -Nru bash-completion-1.1/test/completion/head.exp bash-completion-1.2/test/completion/head.exp --- bash-completion-1.1/test/completion/head.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/head.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions head diff -Nru bash-completion-1.1/test/completion/iconv.exp bash-completion-1.2/test/completion/iconv.exp --- bash-completion-1.1/test/completion/iconv.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/iconv.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions iconv diff -Nru bash-completion-1.1/test/completion/identify.exp bash-completion-1.2/test/completion/identify.exp --- bash-completion-1.1/test/completion/identify.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/identify.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions identify diff -Nru bash-completion-1.1/test/completion/id.exp bash-completion-1.2/test/completion/id.exp --- bash-completion-1.1/test/completion/id.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/id.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions id diff -Nru bash-completion-1.1/test/completion/ifdown.exp bash-completion-1.2/test/completion/ifdown.exp --- bash-completion-1.1/test/completion/ifdown.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/ifdown.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions ifdown diff -Nru bash-completion-1.1/test/completion/ifup.exp bash-completion-1.2/test/completion/ifup.exp --- bash-completion-1.1/test/completion/ifup.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/ifup.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions ifup diff -Nru bash-completion-1.1/test/completion/indent.exp bash-completion-1.2/test/completion/indent.exp --- bash-completion-1.1/test/completion/indent.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/indent.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions indent diff -Nru bash-completion-1.1/test/completion/info.exp bash-completion-1.2/test/completion/info.exp --- bash-completion-1.1/test/completion/info.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/info.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions info diff -Nru bash-completion-1.1/test/completion/inject.exp bash-completion-1.2/test/completion/inject.exp --- bash-completion-1.1/test/completion/inject.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/inject.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions inject diff -Nru bash-completion-1.1/test/completion/insmod.exp bash-completion-1.2/test/completion/insmod.exp --- bash-completion-1.1/test/completion/insmod.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/insmod.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions insmod diff -Nru bash-completion-1.1/test/completion/invoke-rc.d.exp bash-completion-1.2/test/completion/invoke-rc.d.exp --- bash-completion-1.1/test/completion/invoke-rc.d.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/invoke-rc.d.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions invoke-rc.d diff -Nru bash-completion-1.1/test/completion/ipsec.exp bash-completion-1.2/test/completion/ipsec.exp --- bash-completion-1.1/test/completion/ipsec.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/ipsec.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions ipsec diff -Nru bash-completion-1.1/test/completion/ipv6calc.exp bash-completion-1.2/test/completion/ipv6calc.exp --- bash-completion-1.1/test/completion/ipv6calc.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/ipv6calc.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions ipv6calc diff -Nru bash-completion-1.1/test/completion/irb.exp bash-completion-1.2/test/completion/irb.exp --- bash-completion-1.1/test/completion/irb.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/irb.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions irb diff -Nru bash-completion-1.1/test/completion/isql.exp bash-completion-1.2/test/completion/isql.exp --- bash-completion-1.1/test/completion/isql.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/isql.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions isql diff -Nru bash-completion-1.1/test/completion/iwconfig.exp bash-completion-1.2/test/completion/iwconfig.exp --- bash-completion-1.1/test/completion/iwconfig.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/iwconfig.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions iwconfig diff -Nru bash-completion-1.1/test/completion/iwlist.exp bash-completion-1.2/test/completion/iwlist.exp --- bash-completion-1.1/test/completion/iwlist.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/iwlist.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions iwlist diff -Nru bash-completion-1.1/test/completion/iwpriv.exp bash-completion-1.2/test/completion/iwpriv.exp --- bash-completion-1.1/test/completion/iwpriv.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/iwpriv.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions iwpriv diff -Nru bash-completion-1.1/test/completion/iwspy.exp bash-completion-1.2/test/completion/iwspy.exp --- bash-completion-1.1/test/completion/iwspy.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/iwspy.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions iwspy diff -Nru bash-completion-1.1/test/completion/jar.exp bash-completion-1.2/test/completion/jar.exp --- bash-completion-1.1/test/completion/jar.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/jar.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions jar diff -Nru bash-completion-1.1/test/completion/jarsigner.exp bash-completion-1.2/test/completion/jarsigner.exp --- bash-completion-1.1/test/completion/jarsigner.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/jarsigner.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions jarsigner diff -Nru bash-completion-1.1/test/completion/javac.exp bash-completion-1.2/test/completion/javac.exp --- bash-completion-1.1/test/completion/javac.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/javac.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions javac diff -Nru bash-completion-1.1/test/completion/javadoc.exp bash-completion-1.2/test/completion/javadoc.exp --- bash-completion-1.1/test/completion/javadoc.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/javadoc.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions javadoc diff -Nru bash-completion-1.1/test/completion/java.exp bash-completion-1.2/test/completion/java.exp --- bash-completion-1.1/test/completion/java.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/java.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions java diff -Nru bash-completion-1.1/test/completion/k3b.exp bash-completion-1.2/test/completion/k3b.exp --- bash-completion-1.1/test/completion/k3b.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/k3b.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions k3b diff -Nru bash-completion-1.1/test/completion/kdvi.exp bash-completion-1.2/test/completion/kdvi.exp --- bash-completion-1.1/test/completion/kdvi.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/kdvi.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions kdvi diff -Nru bash-completion-1.1/test/completion/killall.exp bash-completion-1.2/test/completion/killall.exp --- bash-completion-1.1/test/completion/killall.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/killall.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions killall diff -Nru bash-completion-1.1/test/completion/kill.exp bash-completion-1.2/test/completion/kill.exp --- bash-completion-1.1/test/completion/kill.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/kill.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions kill diff -Nru bash-completion-1.1/test/completion/kldload.exp bash-completion-1.2/test/completion/kldload.exp --- bash-completion-1.1/test/completion/kldload.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/kldload.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions kldload diff -Nru bash-completion-1.1/test/completion/kldunload.exp bash-completion-1.2/test/completion/kldunload.exp --- bash-completion-1.1/test/completion/kldunload.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/kldunload.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions kldunload diff -Nru bash-completion-1.1/test/completion/kpdf.exp bash-completion-1.2/test/completion/kpdf.exp --- bash-completion-1.1/test/completion/kpdf.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/kpdf.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions kpdf diff -Nru bash-completion-1.1/test/completion/kplayer.exp bash-completion-1.2/test/completion/kplayer.exp --- bash-completion-1.1/test/completion/kplayer.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/kplayer.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions kplayer diff -Nru bash-completion-1.1/test/completion/larch.exp bash-completion-1.2/test/completion/larch.exp --- bash-completion-1.1/test/completion/larch.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/larch.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions larch diff -Nru bash-completion-1.1/test/completion/ldd.exp bash-completion-1.2/test/completion/ldd.exp --- bash-completion-1.1/test/completion/ldd.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/ldd.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions ldd diff -Nru bash-completion-1.1/test/completion/ld.exp bash-completion-1.2/test/completion/ld.exp --- bash-completion-1.1/test/completion/ld.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/ld.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions ld diff -Nru bash-completion-1.1/test/completion/less.exp bash-completion-1.2/test/completion/less.exp --- bash-completion-1.1/test/completion/less.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/less.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions less diff -Nru bash-completion-1.1/test/completion/lftp.exp bash-completion-1.2/test/completion/lftp.exp --- bash-completion-1.1/test/completion/lftp.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/lftp.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions lftp diff -Nru bash-completion-1.1/test/completion/lftpget.exp bash-completion-1.2/test/completion/lftpget.exp --- bash-completion-1.1/test/completion/lftpget.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/lftpget.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions lftpget diff -Nru bash-completion-1.1/test/completion/lilo.exp bash-completion-1.2/test/completion/lilo.exp --- bash-completion-1.1/test/completion/lilo.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/lilo.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions lilo diff -Nru bash-completion-1.1/test/completion/links.exp bash-completion-1.2/test/completion/links.exp --- bash-completion-1.1/test/completion/links.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/links.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions links diff -Nru bash-completion-1.1/test/completion/lisp.exp bash-completion-1.2/test/completion/lisp.exp --- bash-completion-1.1/test/completion/lisp.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/lisp.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions lisp diff -Nru bash-completion-1.1/test/completion/list_admins.exp bash-completion-1.2/test/completion/list_admins.exp --- bash-completion-1.1/test/completion/list_admins.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/list_admins.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions list_admins diff -Nru bash-completion-1.1/test/completion/list_lists.exp bash-completion-1.2/test/completion/list_lists.exp --- bash-completion-1.1/test/completion/list_lists.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/list_lists.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions list_lists diff -Nru bash-completion-1.1/test/completion/list_members.exp bash-completion-1.2/test/completion/list_members.exp --- bash-completion-1.1/test/completion/list_members.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/list_members.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions list_members diff -Nru bash-completion-1.1/test/completion/list_owners.exp bash-completion-1.2/test/completion/list_owners.exp --- bash-completion-1.1/test/completion/list_owners.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/list_owners.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions list_owners diff -Nru bash-completion-1.1/test/completion/ln.exp bash-completion-1.2/test/completion/ln.exp --- bash-completion-1.1/test/completion/ln.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/ln.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions ln diff -Nru bash-completion-1.1/test/completion/look.exp bash-completion-1.2/test/completion/look.exp --- bash-completion-1.1/test/completion/look.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/look.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions look diff -Nru bash-completion-1.1/test/completion/ls.exp bash-completion-1.2/test/completion/ls.exp --- bash-completion-1.1/test/completion/ls.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/ls.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions ls diff -Nru bash-completion-1.1/test/completion/lvchange.exp bash-completion-1.2/test/completion/lvchange.exp --- bash-completion-1.1/test/completion/lvchange.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/lvchange.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions lvchange diff -Nru bash-completion-1.1/test/completion/lvcreate.exp bash-completion-1.2/test/completion/lvcreate.exp --- bash-completion-1.1/test/completion/lvcreate.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/lvcreate.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions lvcreate diff -Nru bash-completion-1.1/test/completion/lvdisplay.exp bash-completion-1.2/test/completion/lvdisplay.exp --- bash-completion-1.1/test/completion/lvdisplay.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/lvdisplay.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions lvdisplay diff -Nru bash-completion-1.1/test/completion/lvextend.exp bash-completion-1.2/test/completion/lvextend.exp --- bash-completion-1.1/test/completion/lvextend.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/lvextend.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions lvextend diff -Nru bash-completion-1.1/test/completion/lvmdiskscan.exp bash-completion-1.2/test/completion/lvmdiskscan.exp --- bash-completion-1.1/test/completion/lvmdiskscan.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/lvmdiskscan.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions lvmdiskscan diff -Nru bash-completion-1.1/test/completion/lvm.exp bash-completion-1.2/test/completion/lvm.exp --- bash-completion-1.1/test/completion/lvm.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/lvm.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions lvm diff -Nru bash-completion-1.1/test/completion/lvreduce.exp bash-completion-1.2/test/completion/lvreduce.exp --- bash-completion-1.1/test/completion/lvreduce.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/lvreduce.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions lvreduce diff -Nru bash-completion-1.1/test/completion/lvremove.exp bash-completion-1.2/test/completion/lvremove.exp --- bash-completion-1.1/test/completion/lvremove.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/lvremove.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions lvremove diff -Nru bash-completion-1.1/test/completion/lvrename.exp bash-completion-1.2/test/completion/lvrename.exp --- bash-completion-1.1/test/completion/lvrename.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/lvrename.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions lvrename diff -Nru bash-completion-1.1/test/completion/lvresize.exp bash-completion-1.2/test/completion/lvresize.exp --- bash-completion-1.1/test/completion/lvresize.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/lvresize.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions lvresize diff -Nru bash-completion-1.1/test/completion/lvscan.exp bash-completion-1.2/test/completion/lvscan.exp --- bash-completion-1.1/test/completion/lvscan.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/lvscan.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions lvscan diff -Nru bash-completion-1.1/test/completion/lvs.exp bash-completion-1.2/test/completion/lvs.exp --- bash-completion-1.1/test/completion/lvs.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/lvs.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions lvs diff -Nru bash-completion-1.1/test/completion/lzma.exp bash-completion-1.2/test/completion/lzma.exp --- bash-completion-1.1/test/completion/lzma.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/lzma.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions lzma diff -Nru bash-completion-1.1/test/completion/lzop.exp bash-completion-1.2/test/completion/lzop.exp --- bash-completion-1.1/test/completion/lzop.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/lzop.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions lzop diff -Nru bash-completion-1.1/test/completion/m4.exp bash-completion-1.2/test/completion/m4.exp --- bash-completion-1.1/test/completion/m4.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/m4.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions m4 diff -Nru bash-completion-1.1/test/completion/macof.exp bash-completion-1.2/test/completion/macof.exp --- bash-completion-1.1/test/completion/macof.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/macof.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions macof diff -Nru bash-completion-1.1/test/completion/mailmanctl.exp bash-completion-1.2/test/completion/mailmanctl.exp --- bash-completion-1.1/test/completion/mailmanctl.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/mailmanctl.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions mailmanctl diff -Nru bash-completion-1.1/test/completion/mailsnarf.exp bash-completion-1.2/test/completion/mailsnarf.exp --- bash-completion-1.1/test/completion/mailsnarf.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/mailsnarf.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions mailsnarf diff -Nru bash-completion-1.1/test/completion/make.exp bash-completion-1.2/test/completion/make.exp --- bash-completion-1.1/test/completion/make.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/make.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions make diff -Nru bash-completion-1.1/test/completion/man.exp bash-completion-1.2/test/completion/man.exp --- bash-completion-1.1/test/completion/man.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/man.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions man diff -Nru bash-completion-1.1/test/completion/mc.exp bash-completion-1.2/test/completion/mc.exp --- bash-completion-1.1/test/completion/mc.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/mc.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions mc diff -Nru bash-completion-1.1/test/completion/mcrypt.exp bash-completion-1.2/test/completion/mcrypt.exp --- bash-completion-1.1/test/completion/mcrypt.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/mcrypt.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions mcrypt diff -Nru bash-completion-1.1/test/completion/md5sum.exp bash-completion-1.2/test/completion/md5sum.exp --- bash-completion-1.1/test/completion/md5sum.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/md5sum.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions md5sum diff -Nru bash-completion-1.1/test/completion/mdecrypt.exp bash-completion-1.2/test/completion/mdecrypt.exp --- bash-completion-1.1/test/completion/mdecrypt.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/mdecrypt.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions mdecrypt diff -Nru bash-completion-1.1/test/completion/mencoder.exp bash-completion-1.2/test/completion/mencoder.exp --- bash-completion-1.1/test/completion/mencoder.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/mencoder.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions mencoder diff -Nru bash-completion-1.1/test/completion/minicom.exp bash-completion-1.2/test/completion/minicom.exp --- bash-completion-1.1/test/completion/minicom.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/minicom.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions minicom diff -Nru bash-completion-1.1/test/completion/mkdir.exp bash-completion-1.2/test/completion/mkdir.exp --- bash-completion-1.1/test/completion/mkdir.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/mkdir.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions mkdir diff -Nru bash-completion-1.1/test/completion/mkfifo.exp bash-completion-1.2/test/completion/mkfifo.exp --- bash-completion-1.1/test/completion/mkfifo.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/mkfifo.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions mkfifo diff -Nru bash-completion-1.1/test/completion/mkinitrd.exp bash-completion-1.2/test/completion/mkinitrd.exp --- bash-completion-1.1/test/completion/mkinitrd.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/mkinitrd.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions mkinitrd diff -Nru bash-completion-1.1/test/completion/mkisofs.exp bash-completion-1.2/test/completion/mkisofs.exp --- bash-completion-1.1/test/completion/mkisofs.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/mkisofs.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions mkisofs diff -Nru bash-completion-1.1/test/completion/mknod.exp bash-completion-1.2/test/completion/mknod.exp --- bash-completion-1.1/test/completion/mknod.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/mknod.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions mknod diff -Nru bash-completion-1.1/test/completion/mmsitepass.exp bash-completion-1.2/test/completion/mmsitepass.exp --- bash-completion-1.1/test/completion/mmsitepass.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/mmsitepass.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions mmsitepass diff -Nru bash-completion-1.1/test/completion/module.exp bash-completion-1.2/test/completion/module.exp --- bash-completion-1.1/test/completion/module.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/module.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions module diff -Nru bash-completion-1.1/test/completion/mogrify.exp bash-completion-1.2/test/completion/mogrify.exp --- bash-completion-1.1/test/completion/mogrify.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/mogrify.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions mogrify diff -Nru bash-completion-1.1/test/completion/montage.exp bash-completion-1.2/test/completion/montage.exp --- bash-completion-1.1/test/completion/montage.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/montage.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions montage diff -Nru bash-completion-1.1/test/completion/mount.exp bash-completion-1.2/test/completion/mount.exp --- bash-completion-1.1/test/completion/mount.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/mount.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions mount diff -Nru bash-completion-1.1/test/completion/mplayer.exp bash-completion-1.2/test/completion/mplayer.exp --- bash-completion-1.1/test/completion/mplayer.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/mplayer.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions mplayer diff -Nru bash-completion-1.1/test/completion/msgsnarf.exp bash-completion-1.2/test/completion/msgsnarf.exp --- bash-completion-1.1/test/completion/msgsnarf.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/msgsnarf.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions msgsnarf diff -Nru bash-completion-1.1/test/completion/mtx.exp bash-completion-1.2/test/completion/mtx.exp --- bash-completion-1.1/test/completion/mtx.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/mtx.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions mtx diff -Nru bash-completion-1.1/test/completion/mutt.exp bash-completion-1.2/test/completion/mutt.exp --- bash-completion-1.1/test/completion/mutt.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/mutt.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions mutt diff -Nru bash-completion-1.1/test/completion/muttng.exp bash-completion-1.2/test/completion/muttng.exp --- bash-completion-1.1/test/completion/muttng.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/muttng.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions muttng diff -Nru bash-completion-1.1/test/completion/mv.exp bash-completion-1.2/test/completion/mv.exp --- bash-completion-1.1/test/completion/mv.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/mv.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions mv diff -Nru bash-completion-1.1/test/completion/mysqladmin.exp bash-completion-1.2/test/completion/mysqladmin.exp --- bash-completion-1.1/test/completion/mysqladmin.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/mysqladmin.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions mysqladmin diff -Nru bash-completion-1.1/test/completion/ncftp.exp bash-completion-1.2/test/completion/ncftp.exp --- bash-completion-1.1/test/completion/ncftp.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/ncftp.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions ncftp diff -Nru bash-completion-1.1/test/completion/netstat.exp bash-completion-1.2/test/completion/netstat.exp --- bash-completion-1.1/test/completion/netstat.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/netstat.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions netstat diff -Nru bash-completion-1.1/test/completion/newlist.exp bash-completion-1.2/test/completion/newlist.exp --- bash-completion-1.1/test/completion/newlist.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/newlist.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions newlist diff -Nru bash-completion-1.1/test/completion/nl.exp bash-completion-1.2/test/completion/nl.exp --- bash-completion-1.1/test/completion/nl.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/nl.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions nl diff -Nru bash-completion-1.1/test/completion/nm.exp bash-completion-1.2/test/completion/nm.exp --- bash-completion-1.1/test/completion/nm.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/nm.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions nm diff -Nru bash-completion-1.1/test/completion/ntpdate.exp bash-completion-1.2/test/completion/ntpdate.exp --- bash-completion-1.1/test/completion/ntpdate.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/ntpdate.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions ntpdate diff -Nru bash-completion-1.1/test/completion/objcopy.exp bash-completion-1.2/test/completion/objcopy.exp --- bash-completion-1.1/test/completion/objcopy.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/objcopy.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions objcopy diff -Nru bash-completion-1.1/test/completion/objdump.exp bash-completion-1.2/test/completion/objdump.exp --- bash-completion-1.1/test/completion/objdump.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/objdump.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions objdump diff -Nru bash-completion-1.1/test/completion/od.exp bash-completion-1.2/test/completion/od.exp --- bash-completion-1.1/test/completion/od.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/od.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions od diff -Nru bash-completion-1.1/test/completion/openssl.exp bash-completion-1.2/test/completion/openssl.exp --- bash-completion-1.1/test/completion/openssl.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/openssl.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions openssl diff -Nru bash-completion-1.1/test/completion/p4.exp bash-completion-1.2/test/completion/p4.exp --- bash-completion-1.1/test/completion/p4.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/p4.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions p4 diff -Nru bash-completion-1.1/test/completion/pack200.exp bash-completion-1.2/test/completion/pack200.exp --- bash-completion-1.1/test/completion/pack200.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/pack200.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions pack200 diff -Nru bash-completion-1.1/test/completion/paste.exp bash-completion-1.2/test/completion/paste.exp --- bash-completion-1.1/test/completion/paste.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/paste.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions paste diff -Nru bash-completion-1.1/test/completion/patch.exp bash-completion-1.2/test/completion/patch.exp --- bash-completion-1.1/test/completion/patch.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/patch.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions patch diff -Nru bash-completion-1.1/test/completion/perldoc.exp bash-completion-1.2/test/completion/perldoc.exp --- bash-completion-1.1/test/completion/perldoc.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/perldoc.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions perldoc diff -Nru bash-completion-1.1/test/completion/perl.exp bash-completion-1.2/test/completion/perl.exp --- bash-completion-1.1/test/completion/perl.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/perl.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions perl diff -Nru bash-completion-1.1/test/completion/pgrep.exp bash-completion-1.2/test/completion/pgrep.exp --- bash-completion-1.1/test/completion/pgrep.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/pgrep.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions pgrep diff -Nru bash-completion-1.1/test/completion/pine.exp bash-completion-1.2/test/completion/pine.exp --- bash-completion-1.1/test/completion/pine.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/pine.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions pine diff -Nru bash-completion-1.1/test/completion/ping.exp bash-completion-1.2/test/completion/ping.exp --- bash-completion-1.1/test/completion/ping.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/ping.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions ping diff -Nru bash-completion-1.1/test/completion/pkg-config.exp bash-completion-1.2/test/completion/pkg-config.exp --- bash-completion-1.1/test/completion/pkg-config.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/pkg-config.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions pkg-config diff -Nru bash-completion-1.1/test/completion/pkg_deinstall.exp bash-completion-1.2/test/completion/pkg_deinstall.exp --- bash-completion-1.1/test/completion/pkg_deinstall.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/pkg_deinstall.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions pkg_deinstall diff -Nru bash-completion-1.1/test/completion/pkg_delete.exp bash-completion-1.2/test/completion/pkg_delete.exp --- bash-completion-1.1/test/completion/pkg_delete.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/pkg_delete.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions pkg_delete diff -Nru bash-completion-1.1/test/completion/pkg_info.exp bash-completion-1.2/test/completion/pkg_info.exp --- bash-completion-1.1/test/completion/pkg_info.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/pkg_info.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions pkg_info diff -Nru bash-completion-1.1/test/completion/pkill.exp bash-completion-1.2/test/completion/pkill.exp --- bash-completion-1.1/test/completion/pkill.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/pkill.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions pkill diff -Nru bash-completion-1.1/test/completion/portinstall.exp bash-completion-1.2/test/completion/portinstall.exp --- bash-completion-1.1/test/completion/portinstall.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/portinstall.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions portinstall diff -Nru bash-completion-1.1/test/completion/portupgrade.exp bash-completion-1.2/test/completion/portupgrade.exp --- bash-completion-1.1/test/completion/portupgrade.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/portupgrade.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions portupgrade diff -Nru bash-completion-1.1/test/completion/povray.exp bash-completion-1.2/test/completion/povray.exp --- bash-completion-1.1/test/completion/povray.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/povray.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions povray diff -Nru bash-completion-1.1/test/completion/pr.exp bash-completion-1.2/test/completion/pr.exp --- bash-completion-1.1/test/completion/pr.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/pr.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions pr diff -Nru bash-completion-1.1/test/completion/psql.exp bash-completion-1.2/test/completion/psql.exp --- bash-completion-1.1/test/completion/psql.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/psql.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions psql diff -Nru bash-completion-1.1/test/completion/ptx.exp bash-completion-1.2/test/completion/ptx.exp --- bash-completion-1.1/test/completion/ptx.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/ptx.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions ptx diff -Nru bash-completion-1.1/test/completion/pvchange.exp bash-completion-1.2/test/completion/pvchange.exp --- bash-completion-1.1/test/completion/pvchange.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/pvchange.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions pvchange diff -Nru bash-completion-1.1/test/completion/pvcreate.exp bash-completion-1.2/test/completion/pvcreate.exp --- bash-completion-1.1/test/completion/pvcreate.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/pvcreate.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions pvcreate diff -Nru bash-completion-1.1/test/completion/pvdisplay.exp bash-completion-1.2/test/completion/pvdisplay.exp --- bash-completion-1.1/test/completion/pvdisplay.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/pvdisplay.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions pvdisplay diff -Nru bash-completion-1.1/test/completion/pvmove.exp bash-completion-1.2/test/completion/pvmove.exp --- bash-completion-1.1/test/completion/pvmove.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/pvmove.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions pvmove diff -Nru bash-completion-1.1/test/completion/pvremove.exp bash-completion-1.2/test/completion/pvremove.exp --- bash-completion-1.1/test/completion/pvremove.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/pvremove.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions pvremove diff -Nru bash-completion-1.1/test/completion/pvscan.exp bash-completion-1.2/test/completion/pvscan.exp --- bash-completion-1.1/test/completion/pvscan.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/pvscan.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions pvscan diff -Nru bash-completion-1.1/test/completion/pvs.exp bash-completion-1.2/test/completion/pvs.exp --- bash-completion-1.1/test/completion/pvs.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/pvs.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions pvs diff -Nru bash-completion-1.1/test/completion/python.exp bash-completion-1.2/test/completion/python.exp --- bash-completion-1.1/test/completion/python.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/python.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions python diff -Nru bash-completion-1.1/test/completion/qrunner.exp bash-completion-1.2/test/completion/qrunner.exp --- bash-completion-1.1/test/completion/qrunner.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/qrunner.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions qrunner diff -Nru bash-completion-1.1/test/completion/querybts.exp bash-completion-1.2/test/completion/querybts.exp --- bash-completion-1.1/test/completion/querybts.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/querybts.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions querybts diff -Nru bash-completion-1.1/test/completion/rcsdiff.exp bash-completion-1.2/test/completion/rcsdiff.exp --- bash-completion-1.1/test/completion/rcsdiff.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/rcsdiff.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions rcsdiff diff -Nru bash-completion-1.1/test/completion/rcs.exp bash-completion-1.2/test/completion/rcs.exp --- bash-completion-1.1/test/completion/rcs.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/rcs.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions rcs diff -Nru bash-completion-1.1/test/completion/rdict.exp bash-completion-1.2/test/completion/rdict.exp --- bash-completion-1.1/test/completion/rdict.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/rdict.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions rdict diff -Nru bash-completion-1.1/test/completion/readelf.exp bash-completion-1.2/test/completion/readelf.exp --- bash-completion-1.1/test/completion/readelf.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/readelf.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions readelf diff -Nru bash-completion-1.1/test/completion/readonly.exp bash-completion-1.2/test/completion/readonly.exp --- bash-completion-1.1/test/completion/readonly.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/readonly.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions readonly diff -Nru bash-completion-1.1/test/completion/remove_members.exp bash-completion-1.2/test/completion/remove_members.exp --- bash-completion-1.1/test/completion/remove_members.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/remove_members.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions remove_members diff -Nru bash-completion-1.1/test/completion/removepkg.exp bash-completion-1.2/test/completion/removepkg.exp --- bash-completion-1.1/test/completion/removepkg.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/removepkg.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions removepkg diff -Nru bash-completion-1.1/test/completion/renice.exp bash-completion-1.2/test/completion/renice.exp --- bash-completion-1.1/test/completion/renice.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/renice.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions renice diff -Nru bash-completion-1.1/test/completion/reportbug.exp bash-completion-1.2/test/completion/reportbug.exp --- bash-completion-1.1/test/completion/reportbug.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/reportbug.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions reportbug diff -Nru bash-completion-1.1/test/completion/ri.exp bash-completion-1.2/test/completion/ri.exp --- bash-completion-1.1/test/completion/ri.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/ri.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions ri diff -Nru bash-completion-1.1/test/completion/rlog.exp bash-completion-1.2/test/completion/rlog.exp --- bash-completion-1.1/test/completion/rlog.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/rlog.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions rlog diff -Nru bash-completion-1.1/test/completion/rmdir.exp bash-completion-1.2/test/completion/rmdir.exp --- bash-completion-1.1/test/completion/rmdir.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/rmdir.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions rmdir diff -Nru bash-completion-1.1/test/completion/rm.exp bash-completion-1.2/test/completion/rm.exp --- bash-completion-1.1/test/completion/rm.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/rm.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions rm diff -Nru bash-completion-1.1/test/completion/rmlist.exp bash-completion-1.2/test/completion/rmlist.exp --- bash-completion-1.1/test/completion/rmlist.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/rmlist.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions rmlist diff -Nru bash-completion-1.1/test/completion/rpcdebug.exp bash-completion-1.2/test/completion/rpcdebug.exp --- bash-completion-1.1/test/completion/rpcdebug.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/rpcdebug.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions rpcdebug diff -Nru bash-completion-1.1/test/completion/rpm.exp bash-completion-1.2/test/completion/rpm.exp --- bash-completion-1.1/test/completion/rpm.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/rpm.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions rpm diff -Nru bash-completion-1.1/test/completion/rsync.exp bash-completion-1.2/test/completion/rsync.exp --- bash-completion-1.1/test/completion/rsync.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/rsync.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions rsync diff -Nru bash-completion-1.1/test/completion/rtcwake.exp bash-completion-1.2/test/completion/rtcwake.exp --- bash-completion-1.1/test/completion/rtcwake.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/rtcwake.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions rtcwake diff -Nru bash-completion-1.1/test/completion/sbcl.exp bash-completion-1.2/test/completion/sbcl.exp --- bash-completion-1.1/test/completion/sbcl.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/sbcl.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions sbcl diff -Nru bash-completion-1.1/test/completion/sbcl-mt.exp bash-completion-1.2/test/completion/sbcl-mt.exp --- bash-completion-1.1/test/completion/sbcl-mt.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/sbcl-mt.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions sbcl-mt diff -Nru bash-completion-1.1/test/completion/scp.exp bash-completion-1.2/test/completion/scp.exp --- bash-completion-1.1/test/completion/scp.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/scp.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions scp diff -Nru bash-completion-1.1/test/completion/screen.exp bash-completion-1.2/test/completion/screen.exp --- bash-completion-1.1/test/completion/screen.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/screen.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions screen diff -Nru bash-completion-1.1/test/completion/sed.exp bash-completion-1.2/test/completion/sed.exp --- bash-completion-1.1/test/completion/sed.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/sed.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions sed diff -Nru bash-completion-1.1/test/completion/seq.exp bash-completion-1.2/test/completion/seq.exp --- bash-completion-1.1/test/completion/seq.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/seq.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions seq diff -Nru bash-completion-1.1/test/completion/service.exp bash-completion-1.2/test/completion/service.exp --- bash-completion-1.1/test/completion/service.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/service.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions service diff -Nru bash-completion-1.1/test/completion/set.exp bash-completion-1.2/test/completion/set.exp --- bash-completion-1.1/test/completion/set.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/set.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions set diff -Nru bash-completion-1.1/test/completion/sftp.exp bash-completion-1.2/test/completion/sftp.exp --- bash-completion-1.1/test/completion/sftp.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/sftp.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions sftp diff -Nru bash-completion-1.1/test/completion/sha1sum.exp bash-completion-1.2/test/completion/sha1sum.exp --- bash-completion-1.1/test/completion/sha1sum.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/sha1sum.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions sha1sum diff -Nru bash-completion-1.1/test/completion/shar.exp bash-completion-1.2/test/completion/shar.exp --- bash-completion-1.1/test/completion/shar.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/shar.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions shar diff -Nru bash-completion-1.1/test/completion/sitecopy.exp bash-completion-1.2/test/completion/sitecopy.exp --- bash-completion-1.1/test/completion/sitecopy.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/sitecopy.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions sitecopy diff -Nru bash-completion-1.1/test/completion/smartctl.exp bash-completion-1.2/test/completion/smartctl.exp --- bash-completion-1.1/test/completion/smartctl.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/smartctl.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions smartctl diff -Nru bash-completion-1.1/test/completion/snownews.exp bash-completion-1.2/test/completion/snownews.exp --- bash-completion-1.1/test/completion/snownews.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/snownews.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions snownews diff -Nru bash-completion-1.1/test/completion/sort.exp bash-completion-1.2/test/completion/sort.exp --- bash-completion-1.1/test/completion/sort.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/sort.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions sort diff -Nru bash-completion-1.1/test/completion/split.exp bash-completion-1.2/test/completion/split.exp --- bash-completion-1.1/test/completion/split.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/split.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions split diff -Nru bash-completion-1.1/test/completion/spovray.exp bash-completion-1.2/test/completion/spovray.exp --- bash-completion-1.1/test/completion/spovray.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/spovray.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions spovray diff -Nru bash-completion-1.1/test/completion/ssh.exp bash-completion-1.2/test/completion/ssh.exp --- bash-completion-1.1/test/completion/ssh.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/ssh.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions ssh diff -Nru bash-completion-1.1/test/completion/sshmitm.exp bash-completion-1.2/test/completion/sshmitm.exp --- bash-completion-1.1/test/completion/sshmitm.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/sshmitm.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions sshmitm diff -Nru bash-completion-1.1/test/completion/sshow.exp bash-completion-1.2/test/completion/sshow.exp --- bash-completion-1.1/test/completion/sshow.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/sshow.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions sshow diff -Nru bash-completion-1.1/test/completion/strace.exp bash-completion-1.2/test/completion/strace.exp --- bash-completion-1.1/test/completion/strace.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/strace.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions strace diff -Nru bash-completion-1.1/test/completion/strip.exp bash-completion-1.2/test/completion/strip.exp --- bash-completion-1.1/test/completion/strip.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/strip.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions strip diff -Nru bash-completion-1.1/test/completion/sudo.exp bash-completion-1.2/test/completion/sudo.exp --- bash-completion-1.1/test/completion/sudo.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/sudo.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions sudo diff -Nru bash-completion-1.1/test/completion/svk.exp bash-completion-1.2/test/completion/svk.exp --- bash-completion-1.1/test/completion/svk.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/svk.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions svk diff -Nru bash-completion-1.1/test/completion/svnadmin.exp bash-completion-1.2/test/completion/svnadmin.exp --- bash-completion-1.1/test/completion/svnadmin.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/svnadmin.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions svnadmin diff -Nru bash-completion-1.1/test/completion/svn.exp bash-completion-1.2/test/completion/svn.exp --- bash-completion-1.1/test/completion/svn.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/svn.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions svn diff -Nru bash-completion-1.1/test/completion/svnlook.exp bash-completion-1.2/test/completion/svnlook.exp --- bash-completion-1.1/test/completion/svnlook.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/svnlook.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions svnlook diff -Nru bash-completion-1.1/test/completion/sync_members.exp bash-completion-1.2/test/completion/sync_members.exp --- bash-completion-1.1/test/completion/sync_members.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/sync_members.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions sync_members diff -Nru bash-completion-1.1/test/completion/sysctl.exp bash-completion-1.2/test/completion/sysctl.exp --- bash-completion-1.1/test/completion/sysctl.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/sysctl.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions sysctl diff -Nru bash-completion-1.1/test/completion/tac.exp bash-completion-1.2/test/completion/tac.exp --- bash-completion-1.1/test/completion/tac.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/tac.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions tac diff -Nru bash-completion-1.1/test/completion/tail.exp bash-completion-1.2/test/completion/tail.exp --- bash-completion-1.1/test/completion/tail.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/tail.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions tail diff -Nru bash-completion-1.1/test/completion/tar.exp bash-completion-1.2/test/completion/tar.exp --- bash-completion-1.1/test/completion/tar.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/tar.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions tar diff -Nru bash-completion-1.1/test/completion/tcpkill.exp bash-completion-1.2/test/completion/tcpkill.exp --- bash-completion-1.1/test/completion/tcpkill.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/tcpkill.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions tcpkill diff -Nru bash-completion-1.1/test/completion/tcpnice.exp bash-completion-1.2/test/completion/tcpnice.exp --- bash-completion-1.1/test/completion/tcpnice.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/tcpnice.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions tcpnice diff -Nru bash-completion-1.1/test/completion/tee.exp bash-completion-1.2/test/completion/tee.exp --- bash-completion-1.1/test/completion/tee.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/tee.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions tee diff -Nru bash-completion-1.1/test/completion/texindex.exp bash-completion-1.2/test/completion/texindex.exp --- bash-completion-1.1/test/completion/texindex.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/texindex.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions texindex diff -Nru bash-completion-1.1/test/completion/tightvncviewer.exp bash-completion-1.2/test/completion/tightvncviewer.exp --- bash-completion-1.1/test/completion/tightvncviewer.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/tightvncviewer.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions tightvncviewer diff -Nru bash-completion-1.1/test/completion/time.exp bash-completion-1.2/test/completion/time.exp --- bash-completion-1.1/test/completion/time.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/time.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions time diff -Nru bash-completion-1.1/test/completion/touch.exp bash-completion-1.2/test/completion/touch.exp --- bash-completion-1.1/test/completion/touch.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/touch.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions touch diff -Nru bash-completion-1.1/test/completion/tr.exp bash-completion-1.2/test/completion/tr.exp --- bash-completion-1.1/test/completion/tr.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/tr.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions tr diff -Nru bash-completion-1.1/test/completion/unace.exp bash-completion-1.2/test/completion/unace.exp --- bash-completion-1.1/test/completion/unace.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/unace.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions unace diff -Nru bash-completion-1.1/test/completion/uname.exp bash-completion-1.2/test/completion/uname.exp --- bash-completion-1.1/test/completion/uname.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/uname.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions uname diff -Nru bash-completion-1.1/test/completion/unexpand.exp bash-completion-1.2/test/completion/unexpand.exp --- bash-completion-1.1/test/completion/unexpand.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/unexpand.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions unexpand diff -Nru bash-completion-1.1/test/completion/uniq.exp bash-completion-1.2/test/completion/uniq.exp --- bash-completion-1.1/test/completion/uniq.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/uniq.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions uniq diff -Nru bash-completion-1.1/test/completion/units.exp bash-completion-1.2/test/completion/units.exp --- bash-completion-1.1/test/completion/units.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/units.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions units diff -Nru bash-completion-1.1/test/completion/unpack200.exp bash-completion-1.2/test/completion/unpack200.exp --- bash-completion-1.1/test/completion/unpack200.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/unpack200.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions unpack200 diff -Nru bash-completion-1.1/test/completion/unrar.exp bash-completion-1.2/test/completion/unrar.exp --- bash-completion-1.1/test/completion/unrar.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/unrar.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions unrar diff -Nru bash-completion-1.1/test/completion/unset.exp bash-completion-1.2/test/completion/unset.exp --- bash-completion-1.1/test/completion/unset.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/unset.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions unset diff -Nru bash-completion-1.1/test/completion/unshunt.exp bash-completion-1.2/test/completion/unshunt.exp --- bash-completion-1.1/test/completion/unshunt.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/unshunt.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions unshunt diff -Nru bash-completion-1.1/test/completion/update-alternatives.exp bash-completion-1.2/test/completion/update-alternatives.exp --- bash-completion-1.1/test/completion/update-alternatives.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/update-alternatives.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions update-alternatives diff -Nru bash-completion-1.1/test/completion/update-rc.d.exp bash-completion-1.2/test/completion/update-rc.d.exp --- bash-completion-1.1/test/completion/update-rc.d.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/update-rc.d.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions update-rc.d diff -Nru bash-completion-1.1/test/completion/urlsnarf.exp bash-completion-1.2/test/completion/urlsnarf.exp --- bash-completion-1.1/test/completion/urlsnarf.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/urlsnarf.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions urlsnarf diff -Nru bash-completion-1.1/test/completion/vdir.exp bash-completion-1.2/test/completion/vdir.exp --- bash-completion-1.1/test/completion/vdir.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/vdir.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions vdir diff -Nru bash-completion-1.1/test/completion/vgcfgbackup.exp bash-completion-1.2/test/completion/vgcfgbackup.exp --- bash-completion-1.1/test/completion/vgcfgbackup.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/vgcfgbackup.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions vgcfgbackup diff -Nru bash-completion-1.1/test/completion/vgcfgrestore.exp bash-completion-1.2/test/completion/vgcfgrestore.exp --- bash-completion-1.1/test/completion/vgcfgrestore.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/vgcfgrestore.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions vgcfgrestore diff -Nru bash-completion-1.1/test/completion/vgchange.exp bash-completion-1.2/test/completion/vgchange.exp --- bash-completion-1.1/test/completion/vgchange.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/vgchange.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions vgchange diff -Nru bash-completion-1.1/test/completion/vgck.exp bash-completion-1.2/test/completion/vgck.exp --- bash-completion-1.1/test/completion/vgck.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/vgck.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions vgck diff -Nru bash-completion-1.1/test/completion/vgconvert.exp bash-completion-1.2/test/completion/vgconvert.exp --- bash-completion-1.1/test/completion/vgconvert.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/vgconvert.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions vgconvert diff -Nru bash-completion-1.1/test/completion/vgcreate.exp bash-completion-1.2/test/completion/vgcreate.exp --- bash-completion-1.1/test/completion/vgcreate.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/vgcreate.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions vgcreate diff -Nru bash-completion-1.1/test/completion/vgdisplay.exp bash-completion-1.2/test/completion/vgdisplay.exp --- bash-completion-1.1/test/completion/vgdisplay.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/vgdisplay.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions vgdisplay diff -Nru bash-completion-1.1/test/completion/vgexport.exp bash-completion-1.2/test/completion/vgexport.exp --- bash-completion-1.1/test/completion/vgexport.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/vgexport.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions vgexport diff -Nru bash-completion-1.1/test/completion/vgextend.exp bash-completion-1.2/test/completion/vgextend.exp --- bash-completion-1.1/test/completion/vgextend.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/vgextend.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions vgextend diff -Nru bash-completion-1.1/test/completion/vgimport.exp bash-completion-1.2/test/completion/vgimport.exp --- bash-completion-1.1/test/completion/vgimport.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/vgimport.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions vgimport diff -Nru bash-completion-1.1/test/completion/vgmerge.exp bash-completion-1.2/test/completion/vgmerge.exp --- bash-completion-1.1/test/completion/vgmerge.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/vgmerge.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions vgmerge diff -Nru bash-completion-1.1/test/completion/vgmknodes.exp bash-completion-1.2/test/completion/vgmknodes.exp --- bash-completion-1.1/test/completion/vgmknodes.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/vgmknodes.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions vgmknodes diff -Nru bash-completion-1.1/test/completion/vgreduce.exp bash-completion-1.2/test/completion/vgreduce.exp --- bash-completion-1.1/test/completion/vgreduce.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/vgreduce.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions vgreduce diff -Nru bash-completion-1.1/test/completion/vgremove.exp bash-completion-1.2/test/completion/vgremove.exp --- bash-completion-1.1/test/completion/vgremove.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/vgremove.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions vgremove diff -Nru bash-completion-1.1/test/completion/vgrename.exp bash-completion-1.2/test/completion/vgrename.exp --- bash-completion-1.1/test/completion/vgrename.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/vgrename.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions vgrename diff -Nru bash-completion-1.1/test/completion/vgscan.exp bash-completion-1.2/test/completion/vgscan.exp --- bash-completion-1.1/test/completion/vgscan.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/vgscan.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions vgscan diff -Nru bash-completion-1.1/test/completion/vgs.exp bash-completion-1.2/test/completion/vgs.exp --- bash-completion-1.1/test/completion/vgs.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/vgs.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions vgs diff -Nru bash-completion-1.1/test/completion/vgsplit.exp bash-completion-1.2/test/completion/vgsplit.exp --- bash-completion-1.1/test/completion/vgsplit.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/vgsplit.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions vgsplit diff -Nru bash-completion-1.1/test/completion/vncviewer.exp bash-completion-1.2/test/completion/vncviewer.exp --- bash-completion-1.1/test/completion/vncviewer.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/vncviewer.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions vncviewer diff -Nru bash-completion-1.1/test/completion/wc.exp bash-completion-1.2/test/completion/wc.exp --- bash-completion-1.1/test/completion/wc.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/wc.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions wc diff -Nru bash-completion-1.1/test/completion/webmitm.exp bash-completion-1.2/test/completion/webmitm.exp --- bash-completion-1.1/test/completion/webmitm.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/webmitm.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions webmitm diff -Nru bash-completion-1.1/test/completion/wget.exp bash-completion-1.2/test/completion/wget.exp --- bash-completion-1.1/test/completion/wget.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/wget.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions wget diff -Nru bash-completion-1.1/test/completion/who.exp bash-completion-1.2/test/completion/who.exp --- bash-completion-1.1/test/completion/who.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/who.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions who diff -Nru bash-completion-1.1/test/completion/withlist.exp bash-completion-1.2/test/completion/withlist.exp --- bash-completion-1.1/test/completion/withlist.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/withlist.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions withlist diff -Nru bash-completion-1.1/test/completion/wol.exp bash-completion-1.2/test/completion/wol.exp --- bash-completion-1.1/test/completion/wol.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/wol.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions wol diff -Nru bash-completion-1.1/test/completion/wtf.exp bash-completion-1.2/test/completion/wtf.exp --- bash-completion-1.1/test/completion/wtf.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/wtf.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions wtf diff -Nru bash-completion-1.1/test/completion/wvdial.exp bash-completion-1.2/test/completion/wvdial.exp --- bash-completion-1.1/test/completion/wvdial.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/wvdial.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions wvdial diff -Nru bash-completion-1.1/test/completion/xhost.exp bash-completion-1.2/test/completion/xhost.exp --- bash-completion-1.1/test/completion/xhost.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/xhost.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions xhost diff -Nru bash-completion-1.1/test/completion/xmllint.exp bash-completion-1.2/test/completion/xmllint.exp --- bash-completion-1.1/test/completion/xmllint.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/xmllint.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions xmllint diff -Nru bash-completion-1.1/test/completion/xmlwf.exp bash-completion-1.2/test/completion/xmlwf.exp --- bash-completion-1.1/test/completion/xmlwf.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/xmlwf.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions xmlwf diff -Nru bash-completion-1.1/test/completion/xmms.exp bash-completion-1.2/test/completion/xmms.exp --- bash-completion-1.1/test/completion/xmms.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/xmms.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions xmms diff -Nru bash-completion-1.1/test/completion/xpovray.exp bash-completion-1.2/test/completion/xpovray.exp --- bash-completion-1.1/test/completion/xpovray.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/xpovray.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions xpovray diff -Nru bash-completion-1.1/test/completion/xrandr.exp bash-completion-1.2/test/completion/xrandr.exp --- bash-completion-1.1/test/completion/xrandr.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/xrandr.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions xrandr diff -Nru bash-completion-1.1/test/completion/xsltproc.exp bash-completion-1.2/test/completion/xsltproc.exp --- bash-completion-1.1/test/completion/xsltproc.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/xsltproc.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions xsltproc diff -Nru bash-completion-1.1/test/completion/xvnc4viewer.exp bash-completion-1.2/test/completion/xvnc4viewer.exp --- bash-completion-1.1/test/completion/xvnc4viewer.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/xvnc4viewer.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions xvnc4viewer diff -Nru bash-completion-1.1/test/completion/xz.exp bash-completion-1.2/test/completion/xz.exp --- bash-completion-1.1/test/completion/xz.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/xz.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions xz diff -Nru bash-completion-1.1/test/completion/ypcat.exp bash-completion-1.2/test/completion/ypcat.exp --- bash-completion-1.1/test/completion/ypcat.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/ypcat.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions ypcat diff -Nru bash-completion-1.1/test/completion/ypmatch.exp bash-completion-1.2/test/completion/ypmatch.exp --- bash-completion-1.1/test/completion/ypmatch.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/ypmatch.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions ypmatch diff -Nru bash-completion-1.1/test/completion/yum-arch.exp bash-completion-1.2/test/completion/yum-arch.exp --- bash-completion-1.1/test/completion/yum-arch.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/yum-arch.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions yum-arch diff -Nru bash-completion-1.1/test/completion/yum.exp bash-completion-1.2/test/completion/yum.exp --- bash-completion-1.1/test/completion/yum.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/completion/yum.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +assert_source_completions yum diff -Nru bash-completion-1.1/test/config/bashrc bash-completion-1.2/test/config/bashrc --- bash-completion-1.1/test/config/bashrc 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/config/bashrc 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,42 @@ +# bashrc file for DejaGnu testsuite + + # Use emacs key bindings +set -o emacs + # Use bash strict mode +set -o posix + # Unset `command_not_found_handle' as defined on Debian/Ubuntu, because this + # troubles and slows down testing +unset -f command_not_found_handle + # Set prompt to ignore current root directory; display path starting + # from here. E.g. prompt: /fixtures/@ +TESTDIR=$(pwd) +export PS1='$(wd=$(pwd); echo ${wd#$TESTDIR}/)@' +export PS2='> ' + # Configure readline +export INPUTRC=$TESTDIR/config/inputrc + # When not running via cron, avoid escape junk at beginning of line from + # readline, see e.g. http://bugs.gentoo.org/246091 +[ "$CRON" ] || export TERM=dummy + # Ensure enough columns so expect doesn't have to care about line breaks +stty columns 150 + # Also test completions of system administrator commands, which are + # installed via the same PATH expansion in `bash_completion.have()' +export PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin + + # Make sure default settings are in effect +unset -v \ + COMP_CONFIGURE_HINTS \ + COMP_CVS_REMOTE \ + COMP_KNOWN_HOSTS_WITH_HOSTFILE \ + COMP_TAR_INTERNAL_PATHS + + # Load bash testsuite helper functions +. lib/library.sh + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/test/config/default.exp bash-completion-1.2/test/config/default.exp --- bash-completion-1.1/test/config/default.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/config/default.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,23 @@ + # Set default expect fallback routines +expect_after { + eof { + if {[info exists test]} { + fail "$test at eof" + } else { + fail "[info level 1] at eof" + }; # if + }; # eof + timeout { + if {[info exists test]} { + fail "$test at timeout" + } else { + fail "[info level 1] at timeout" + }; # if + }; # timeout +}; # expect_after() + + + # Call tool_start(), if available +if { [info procs "${tool}_start"] != "" } { + ${tool}_start +}; # if diff -Nru bash-completion-1.1/test/config/inputrc bash-completion-1.2/test/config/inputrc --- bash-completion-1.1/test/config/inputrc 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/config/inputrc 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,21 @@ +# Readline init file for DejaGnu testsuite +# See: info readline + + # Press TAB once (instead of twice) to auto-complete +set show-all-if-ambiguous on + # No bell. No ^G in output +set bell-style none + # Don't query user about viewing the number of possible completions +set completion-query-items -1 + # Display completions sorted horizontally, not vertically +set print-completions-horizontally on + # Don't use pager when showing completions +set page-completions off + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/test/fixtures/compgen/t1.txt bash-completion-1.2/test/fixtures/compgen/t1.txt --- bash-completion-1.1/test/fixtures/compgen/t1.txt 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/compgen/t1.txt 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,121 @@ +BASH=/bin/bash +BASH_ARGC=() +BASH_ARGV=() +BASH_LINENO=() +BASH_SOURCE=() +BASH_VERSINFO=([0]="3" [1]="2" [2]="39" [3]="1" [4]="release" [5]="i486-pc-linux-gnu") +BASH_VERSION='3.2.39(1)-release' +CDPL_DIRS=([0]="/home/freddy/proj") +CDPM_DIRS= +CDP_DIRS=([0]="/home/freddy/proj" [1]="") +COLUMNS=130 +COMP_CACHE=/home/freddy/.bash_completion_lib.d/cache~ +COMP_DIR=/etc/bash_completion_lib +COMP_PATH=/home/freddy/.bash_completion_lib.d:/etc/bash_completion_lib +COMP_RESTRICT_BY_EXTENSION=0 +COMP_VERSION=bash_completion_lib-1.3.1 +DIRSTACK=() +EDITOR=/usr/bin/vim +EUID=1000 +GPGKEY=10A575C3 +GPG_AGENT_INFO=/tmp/gpg-Pg6JXR/S.gpg-agent:4129:1 +GPG_TTY=/dev/pts/0 +GREP_OPTIONS='--exclude '\''distrib/*'\'' --exclude tags' +GROUPS=() +HISTCONTROL=ignoreboth +HISTFILE=/home/freddy/.bash_history +HISTFILESIZE=500 +HISTIGNORE=exit +HISTSIZE=500 +HOME=/home/freddy +HOSTNAME=blondy +HOSTTYPE=i486 +IFS=$' \t\n' +LANG=en_US +LANGUAGE=en_NL:en_US:en_GB:en +LINES=49 +LOGNAME=freddy +MACHTYPE=i486-pc-linux-gnu +MAIL=/var/mail/freddy +MAILCHECK=60 +OLDPWD=/home/freddy/.bash_completion_lib.d +OPTERR=1 +OPTIND=1 +OSTYPE=linux-gnu +PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/home/freddy/proj/rc/bin +PIPESTATUS=([0]="0") +PPID=29352 +PS1=$'\\[\E[0;34m\\]\\!\\[\E[0m\\]\\[\E[1;32m\\]$(stoppedjobs)\\[\E[0m\\]:\\u@\\h:\\w> \\[\E[m\\]' +PS2='> ' +PS4='+ ' +PWD=/home/freddy/proj/bashCompletion/bash-completion.git/test/fixtures/compgen +SHELL=/bin/bash +SHELLOPTS=braceexpand:hashall:histexpand:interactive-comments:monitor:vi +SHLVL=1 +SSH_AUTH_SOCK=/tmp/ssh-xhQbo29352/agent.29352 +SSH_CLIENT='192.168.123.143 37670 4822' +SSH_CONNECTION='192.168.123.143 37670 192.168.123.8 4822' +SSH_TTY=/dev/pts/0 +TERM=xterm +UID=1000 +USER=freddy +VIM=/home/freddy/.vim +VIMRUNTIME=/usr/share/vim/vimcurrent +_=GPG_AGENT_INFO +bash205='3.2.39(1)-release' +bash205b='3.2.39(1)-release' +bash3='3.2.39(1)-release' +cdots () +{ + [ -d "$1$2" ] && cd "$1$2" || eval cd "$1$2" +} +comp_load () +{ + local cmd=${COMP_WORDS[0]} dir globs OLDIFS=$IFS; + IFS=:; + local -a aPaths=($COMP_PATH); + IFS=' +'; + globs=($( + for dir in "${aPaths[@]}"; do + echo \"$dir\"/complete\*/\*.$cmd + echo \"$dir\"/complete\*/$cmd\! + echo \"$dir\"/complete\*/$cmd + done + )); + IFS=$OLDIFS; + if ! declare -F comp_include >&/dev/null; then + for dir in "${aPaths[@]}"; + do + [ -r "$dir/include/comp_include" ] && . "$dir/include/comp_include" && break; + done; + fi; + comp_include comp_load_init; + comp_load_init; + local script="$(eval find "${globs[@]}" 2> /dev/null | head -1)"; + local link comp=${script##*/}; + [[ ${comp: -1:1} == ! ]] || { + link=${comp#*.}; + comp=${comp%.$link} + }; + local path=${script%/*}; + [ "$script" -a -r "$path/$comp" ] && . "$path/$comp" && declare -F _$comp >&/dev/null && { + [ ${COMP_INSTALL:-1} -eq 0 ] || _comp_install $comp "$path" + } && _$comp $link; + comp_load_deinit +} +nameTerminal () +{ + [ "${TERM:0:5}" = "xterm" ] && local ansiNrTab=0; + [ "$TERM" = "rxvt" ] && local ansiNrTab=61; + [ "$TERM" = "konsole" ] && local ansiNrTab=30 ansiNrWindow=0; + [ $ansiNrTab ] && echo -n ''"]$ansiNrTab;$1"''; + [ $ansiNrWindow -a "$2" ] && echo -n ''"]$ansiNrWindow;$2"'' +} +stoppedjobs () +{ + if [ "$(jobs -s)" ]; then + echo -n "%"; + jobs -s | wc -l; + fi +} diff -Nru bash-completion-1.1/test/fixtures/compgen/t2.txt bash-completion-1.2/test/fixtures/compgen/t2.txt --- bash-completion-1.1/test/fixtures/compgen/t2.txt 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/compgen/t2.txt 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,121 @@ +BASH=/bin/bash +BASH_ARGC=() +BASH_ARGV=() +BASH_LINENO=() +BASH_SOURCE=() +BASH_VERSINFO=([0]="3" [1]="2" [2]="39" [3]="1" [4]="release" [5]="i486-pc-linux-gnu") +BASH_VERSION='3.2.39(1)-release' +CDPL_DIRS=([0]="/home/freddy/proj") +CDPM_DIRS= +CDP_DIRS=([0]="/home/freddy/proj" [1]="") +COLUMNS=130 +COMP_CACHE=/home/freddy/.bash_completion_lib.d/cache~ +COMP_DIR=/etc/bash_completion_lib +COMP_PATH=/home/freddy/.bash_completion_lib.d:/etc/bash_completion_lib +COMP_RESTRICT_BY_EXTENSION=0 +COMP_VERSION=bash_completion_lib-1.3.1 +DIRSTACK=() +EDITOR=/usr/bin/vim +EUID=1000 +GPGKEY=10A575C3 +GPG_AGENT_INFO=/tmp/gpg-Pg6JXR/S.gpg-agent:4129:1 +GPG_TTY=/dev/pts/0 +GREP_OPTIONS='--exclude '\''distrib/*'\'' --exclude tags' +GROUPS=() +HISTCONTROL=ignoreboth +HISTFILE=/home/freddy/.bash_history +HISTFILESIZE=500 +HISTIGNORE=exit +HISTSIZE=500 +HOME=/home/freddy +HOSTNAME=blondy +HOSTTYPE=i486 +IFS=$' \t\n' +LANG=en_US +LANGUAGE=en_NL:en_US:en_GB:en +LINES=49 +LOGNAME=freddy +MACHTYPE=i486-pc-linux-gnu +MAIL=/var/mail/freddy +MAILCHECK=60 +OLDPWD=/home/freddy/.bash_completion_lib.d +OPTERR=1 +OPTIND=1 +OSTYPE=linux-gnu +PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/home/freddy/proj/rc/bin +PIPESTATUS=([0]="0") +PPID=29352 +PS1=$'\\[\E[0;34m\\]\\!\\[\E[0m\\]\\[\E[1;32m\\]$(stoppedjobs)\\[\E[0m\\]:\\u@\\h:\\w> \\[\E[m\\]' +PS2='> ' +PS4='+ ' +PWD=/home/freddy/proj/bashCompletion/bash-completion.git/test/fixtures/compgen +SHELL=/bin/bash +SHELLOPTS=braceexpand:hashall:histexpand:interactive-comments:monitor:vi +SHLVL=1 +SSH_AUTH_SOCK=/tmp/ssh-xhQbo29352/agent.29352 +SSH_CLIENT='192.168.123.143 37670 4822' +SSH_CONNECTION='192.168.123.143 37670 192.168.123.8 4822' +SSH_TTY=/dev/pts/0 +TERM=xterm +UID=1000 +USER=freddy +VIM=/home/freddy/.vim +VIMRUNTIME=/usr/share/vim/vimcurrent +_='a\\\'\''b/' +bash205='3.2.39(1)-release' +bash205b='3.2.39(1)-release' +bash3='3.2.39(1)-release' +cdots () +{ + [ -d "$1$2" ] && cd "$1$2" || eval cd "$1$2" +} +comp_load () +{ + local cmd=${COMP_WORDS[0]} dir globs OLDIFS=$IFS; + IFS=:; + local -a aPaths=($COMP_PATH); + IFS=' +'; + globs=($( + for dir in "${aPaths[@]}"; do + echo \"$dir\"/complete\*/\*.$cmd + echo \"$dir\"/complete\*/$cmd\! + echo \"$dir\"/complete\*/$cmd + done + )); + IFS=$OLDIFS; + if ! declare -F comp_include >&/dev/null; then + for dir in "${aPaths[@]}"; + do + [ -r "$dir/include/comp_include" ] && . "$dir/include/comp_include" && break; + done; + fi; + comp_include comp_load_init; + comp_load_init; + local script="$(eval find "${globs[@]}" 2> /dev/null | head -1)"; + local link comp=${script##*/}; + [[ ${comp: -1:1} == ! ]] || { + link=${comp#*.}; + comp=${comp%.$link} + }; + local path=${script%/*}; + [ "$script" -a -r "$path/$comp" ] && . "$path/$comp" && declare -F _$comp >&/dev/null && { + [ ${COMP_INSTALL:-1} -eq 0 ] || _comp_install $comp "$path" + } && _$comp $link; + comp_load_deinit +} +nameTerminal () +{ + [ "${TERM:0:5}" = "xterm" ] && local ansiNrTab=0; + [ "$TERM" = "rxvt" ] && local ansiNrTab=61; + [ "$TERM" = "konsole" ] && local ansiNrTab=30 ansiNrWindow=0; + [ $ansiNrTab ] && echo -n ''"]$ansiNrTab;$1"''; + [ $ansiNrWindow -a "$2" ] && echo -n ''"]$ansiNrWindow;$2"'' +} +stoppedjobs () +{ + if [ "$(jobs -s)" ]; then + echo -n "%"; + jobs -s | wc -l; + fi +} diff -Nru bash-completion-1.1/test/fixtures/compgen/t3.txt bash-completion-1.2/test/fixtures/compgen/t3.txt --- bash-completion-1.1/test/fixtures/compgen/t3.txt 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/compgen/t3.txt 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,121 @@ +BASH=/bin/bash +BASH_ARGC=() +BASH_ARGV=() +BASH_LINENO=() +BASH_SOURCE=() +BASH_VERSINFO=([0]="3" [1]="2" [2]="39" [3]="1" [4]="release" [5]="i486-pc-linux-gnu") +BASH_VERSION='3.2.39(1)-release' +CDPL_DIRS=([0]="/home/freddy/proj") +CDPM_DIRS= +CDP_DIRS=([0]="/home/freddy/proj" [1]="") +COLUMNS=130 +COMP_CACHE=/home/freddy/.bash_completion_lib.d/cache~ +COMP_DIR=/etc/bash_completion_lib +COMP_PATH=/home/freddy/.bash_completion_lib.d:/etc/bash_completion_lib +COMP_RESTRICT_BY_EXTENSION=0 +COMP_VERSION=bash_completion_lib-1.3.1 +DIRSTACK=() +EDITOR=/usr/bin/vim +EUID=1000 +GPGKEY=10A575C3 +GPG_AGENT_INFO=/tmp/gpg-Pg6JXR/S.gpg-agent:4129:1 +GPG_TTY=/dev/pts/0 +GREP_OPTIONS='--exclude '\''distrib/*'\'' --exclude tags' +GROUPS=() +HISTCONTROL=ignoreboth +HISTFILE=/home/freddy/.bash_history +HISTFILESIZE=500 +HISTIGNORE=exit +HISTSIZE=500 +HOME=/home/freddy +HOSTNAME=blondy +HOSTTYPE=i486 +IFS=$' \t\n' +LANG=en_US +LANGUAGE=en_NL:en_US:en_GB:en +LINES=49 +LOGNAME=freddy +MACHTYPE=i486-pc-linux-gnu +MAIL=/var/mail/freddy +MAILCHECK=60 +OLDPWD=/home/freddy/.bash_completion_lib.d +OPTERR=1 +OPTIND=1 +OSTYPE=linux-gnu +PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/home/freddy/proj/rc/bin +PIPESTATUS=([0]="0") +PPID=29352 +PS1=$'\\[\E[0;34m\\]\\!\\[\E[0m\\]\\[\E[1;32m\\]$(stoppedjobs)\\[\E[0m\\]:\\u@\\h:\\w> \\[\E[m\\]' +PS2='> ' +PS4='+ ' +PWD=/home/freddy/proj/bashCompletion/bash-completion.git/test/fixtures/compgen +SHELL=/bin/bash +SHELLOPTS=braceexpand:hashall:histexpand:interactive-comments:monitor:vi +SHLVL=1 +SSH_AUTH_SOCK=/tmp/ssh-xhQbo29352/agent.29352 +SSH_CLIENT='192.168.123.143 37670 4822' +SSH_CONNECTION='192.168.123.143 37670 192.168.123.8 4822' +SSH_TTY=/dev/pts/0 +TERM=xterm +UID=1000 +USER=freddy +VIM=/home/freddy/.vim +VIMRUNTIME=/usr/share/vim/vimcurrent +_='a\\\'\''b/' +bash205='3.2.39(1)-release' +bash205b='3.2.39(1)-release' +bash3='3.2.39(1)-release' +cdots () +{ + [ -d "$1$2" ] && cd "$1$2" || eval cd "$1$2" +} +comp_load () +{ + local cmd=${COMP_WORDS[0]} dir globs OLDIFS=$IFS; + IFS=:; + local -a aPaths=($COMP_PATH); + IFS=' +'; + globs=($( + for dir in "${aPaths[@]}"; do + echo \"$dir\"/complete\*/\*.$cmd + echo \"$dir\"/complete\*/$cmd\! + echo \"$dir\"/complete\*/$cmd + done + )); + IFS=$OLDIFS; + if ! declare -F comp_include >&/dev/null; then + for dir in "${aPaths[@]}"; + do + [ -r "$dir/include/comp_include" ] && . "$dir/include/comp_include" && break; + done; + fi; + comp_include comp_load_init; + comp_load_init; + local script="$(eval find "${globs[@]}" 2> /dev/null | head -1)"; + local link comp=${script##*/}; + [[ ${comp: -1:1} == ! ]] || { + link=${comp#*.}; + comp=${comp%.$link} + }; + local path=${script%/*}; + [ "$script" -a -r "$path/$comp" ] && . "$path/$comp" && declare -F _$comp >&/dev/null && { + [ ${COMP_INSTALL:-1} -eq 0 ] || _comp_install $comp "$path" + } && _$comp $link; + comp_load_deinit +} +nameTerminal () +{ + [ "${TERM:0:5}" = "xterm" ] && local ansiNrTab=0; + [ "$TERM" = "rxvt" ] && local ansiNrTab=61; + [ "$TERM" = "konsole" ] && local ansiNrTab=30 ansiNrWindow=0; + [ $ansiNrTab ] && echo -n ''"]$ansiNrTab;$1"''; + [ $ansiNrWindow -a "$2" ] && echo -n ''"]$ansiNrWindow;$2"'' +} +stoppedjobs () +{ + if [ "$(jobs -s)" ]; then + echo -n "%"; + jobs -s | wc -l; + fi +} diff -Nru bash-completion-1.1/test/fixtures/cvs/.cvspass bash-completion-1.2/test/fixtures/cvs/.cvspass --- bash-completion-1.1/test/fixtures/cvs/.cvspass 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/cvs/.cvspass 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,2 @@ +/1 :pserver:anonymous@cvs.savannah.nongnu.org:2401/sources/cvs A +/1 :pserver:anonymous@cvs.fedoraproject.org:2401/cvs/pkgs A diff -Nru bash-completion-1.1/test/fixtures/isql/odbc.ini bash-completion-1.2/test/fixtures/isql/odbc.ini --- bash-completion-1.1/test/fixtures/isql/odbc.ini 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/isql/odbc.ini 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,3 @@ +[foo] + +[bar] diff -Nru bash-completion-1.1/test/fixtures/java/a/c/README.txt bash-completion-1.2/test/fixtures/java/a/c/README.txt --- bash-completion-1.1/test/fixtures/java/a/c/README.txt 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/java/a/c/README.txt 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,2 @@ +When CLASSPATH is set to the fixtures/java/a dir, we do *not* expect +*.class in subdirs to be included in completions, see Debian bug #496828. Los archivos binarios /tmp/AjeXpRKp59/bash-completion-1.1/test/fixtures/java/bashcomp.jar y /tmp/9xw5BiS3vV/bash-completion-1.2/test/fixtures/java/bashcomp.jar son distintos diff -Nru bash-completion-1.1/test/fixtures/_known_hosts_real/config bash-completion-1.2/test/fixtures/_known_hosts_real/config --- bash-completion-1.1/test/fixtures/_known_hosts_real/config 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/_known_hosts_real/config 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,6 @@ + UserKnownHostsFile fixtures/_known_hosts_real/known_hosts + + # Unindented +Host gee jar + # Indented + Host hus # With comment diff -Nru bash-completion-1.1/test/fixtures/_known_hosts_real/config_tilde bash-completion-1.2/test/fixtures/_known_hosts_real/config_tilde --- bash-completion-1.1/test/fixtures/_known_hosts_real/config_tilde 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/_known_hosts_real/config_tilde 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,4 @@ +# With quotes and tilde +UserKnownHostsFile "~/fixtures/_known_hosts_real/known_hosts2" +# Without quotes, with tilde +UserKnownHostsFile ~/fixtures/_known_hosts_real/known_hosts3 diff -Nru bash-completion-1.1/test/fixtures/_known_hosts_real/known_hosts bash-completion-1.2/test/fixtures/_known_hosts_real/known_hosts --- bash-completion-1.1/test/fixtures/_known_hosts_real/known_hosts 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/_known_hosts_real/known_hosts 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,6 @@ +|1|abc +|1|def +doo +ike ssh-rsa qwerty1234/Qwerty+1234== +jub,10.0.0.1 +kyl,100.0.0.2 diff -Nru bash-completion-1.1/test/fixtures/_known_hosts_real/known_hosts2 bash-completion-1.2/test/fixtures/_known_hosts_real/known_hosts2 --- bash-completion-1.1/test/fixtures/_known_hosts_real/known_hosts2 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/_known_hosts_real/known_hosts2 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +two diff -Nru bash-completion-1.1/test/fixtures/_known_hosts_real/known_hosts3 bash-completion-1.2/test/fixtures/_known_hosts_real/known_hosts3 --- bash-completion-1.1/test/fixtures/_known_hosts_real/known_hosts3 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/_known_hosts_real/known_hosts3 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +three diff -Nru bash-completion-1.1/test/fixtures/_known_hosts_real/spaced conf bash-completion-1.2/test/fixtures/_known_hosts_real/spaced conf --- bash-completion-1.1/test/fixtures/_known_hosts_real/spaced conf 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/_known_hosts_real/spaced conf 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,9 @@ + + # Unindented +Host gee + UserKnownHostsFile "fixtures/_known_hosts_real/spaced known_hosts" + + # Indented + Host hus # With comment + UserKnownHostsFile "fixtures/_known_hosts_real/known_hosts2" + diff -Nru bash-completion-1.1/test/fixtures/_known_hosts_real/spaced known_hosts bash-completion-1.2/test/fixtures/_known_hosts_real/spaced known_hosts --- bash-completion-1.1/test/fixtures/_known_hosts_real/spaced known_hosts 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/_known_hosts_real/spaced known_hosts 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,4 @@ +|1|abc +|1|def +doo +ike ssh-rsa qwerty1234/Qwerty+1234== diff -Nru bash-completion-1.1/test/fixtures/lftp/.lftp/bookmarks bash-completion-1.2/test/fixtures/lftp/.lftp/bookmarks --- bash-completion-1.1/test/fixtures/lftp/.lftp/bookmarks 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/lftp/.lftp/bookmarks 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1 @@ +lftptest ftp://ftp.funet.fi/ diff -Nru bash-completion-1.1/test/fixtures/mount/bin/showmount bash-completion-1.2/test/fixtures/mount/bin/showmount --- bash-completion-1.1/test/fixtures/mount/bin/showmount 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/mount/bin/showmount 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,12 @@ +#!/bin/sh + +if [ "$1" = -e ] && [ "$2" = mocksrv ]; then + echo "Header line" + echo "/test/path" + echo "/test/path2" + echo "/second/path" + exit 0 +fi + +echo "Usage: 'showmount -e mocksrv'; nothing else works." +exit 1 diff -Nru bash-completion-1.1/test/fixtures/mount/test-fstab bash-completion-1.2/test/fixtures/mount/test-fstab --- bash-completion-1.1/test/fixtures/mount/test-fstab 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/mount/test-fstab 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,24 @@ +proc /proc proc defaults 0 0 +none /debug debugfs defaults,noauto 0 0 + +# Simple obvious test. +/mnt/nice-test-path /dev/null auto ro,noauto 0 0 + +# Test octal escapes +# Contains ' ' and '-' +/mnt/nice\040test\055path /dev/null auto ro,noauto 0 0 +# Contains '$' and '-' +/mnt/nice\044test\055path /dev/null auto ro,noauto 0 0 +# Contains ' ' and '\\' +/mnt/nice\040test\134path /dev/null auto ro,noauto 0 0 +# Contains '\n' and '\ ' +/mnt/nice\012test\040path /dev/null auto ro,noauto 0 0 + +# Test apostrophe +/mnt/nice'test-path /dev/null auto ro,noauto 0 0 +/mnt/other'test\040path /dev/null auto ro,noauto 0 0 + +# Test some labels +LABEL=Ubuntu\040Karmic /mnt/ubuntu auto no,noauto 0 0 +LABEL=Fedora /mnt/fedora auto ro,noauto 0 0 +LABEL=Debian-it's\040awesome /mnt/debian auto ro,noauto 0 0 diff -Nru bash-completion-1.1/test/fixtures/mutt/muttrc bash-completion-1.2/test/fixtures/mutt/muttrc --- bash-completion-1.1/test/fixtures/mutt/muttrc 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/mutt/muttrc 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,3 @@ +set folder=. +alias a1 a1@example.com +alias a2 a2@example.com diff -Nru bash-completion-1.1/test/fixtures/pkgtools/ports/.gitignore bash-completion-1.2/test/fixtures/pkgtools/ports/.gitignore --- bash-completion-1.1/test/fixtures/pkgtools/ports/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/pkgtools/ports/.gitignore 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,2 @@ +INDEX +INDEX-5 diff -Nru bash-completion-1.1/test/fixtures/pkgtools/ports/INDEX.dist bash-completion-1.2/test/fixtures/pkgtools/ports/INDEX.dist --- bash-completion-1.1/test/fixtures/pkgtools/ports/INDEX.dist 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/pkgtools/ports/INDEX.dist 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,3 @@ +bash-3.1.17|PORTSDIR/shells/bash|/usr/local|The GNU Project's Bourne Again SHell|PORTSDIR/shells/bash/pkg-descr|obrien@FreeBSD.org|shells|expat-2.0.0_1 gettext-0.14.5_2 ldconfig_compat-1.0_8 libiconv-1.9.2_2 rc_subr-1.31_1|expat-2.0.0_1 gettext-0.14.5_2 ldconfig_compat-1.0_8 libiconv-1.9.2_2 rc_subr-1.31_1|http://cnswww.cns.cwru.edu/~chet/bash/bashtop.html||| +bash-completion-20060301_2|PORTSDIR/shells/bash-completion|/usr/local|Programmable completion library for Bash 2.04 and up|PORTSDIR/shells/bash-completion/pkg-descr|kirk@strauser.com|shells||bash-3.1.17 expat-2.0.0_1 gettext-0.14.5_2 ldconfig_compat-1.0_8 libiconv-1.9.2_2 rc_subr-1.31_1|http://www.caliban.org/bash/index.shtml||| +bash-2.05b.007_6|PORTSDIR/shells/bash2|/usr/local|The GNU Bourne Again Shell|PORTSDIR/shells/bash2/pkg-descr|ports@FreeBSD.org|shells|||http://www.gnu.org/software/bash/||| diff -Nru bash-completion-1.1/test/fixtures/scp/config bash-completion-1.2/test/fixtures/scp/config --- bash-completion-1.1/test/fixtures/scp/config 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/scp/config 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,6 @@ +UserKnownHostsFile known_hosts + + # Unindented +Host gee + # Indented, multiple hosts + HostName hus ike diff -Nru bash-completion-1.1/test/fixtures/scp/known_hosts bash-completion-1.2/test/fixtures/scp/known_hosts --- bash-completion-1.1/test/fixtures/scp/known_hosts 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/scp/known_hosts 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,4 @@ +|1|abc +|1|def +doo +ike ssh-rsa qwerty1234/Qwerty+1234== diff -Nru bash-completion-1.1/test/fixtures/scp/spaced conf bash-completion-1.2/test/fixtures/scp/spaced conf --- bash-completion-1.1/test/fixtures/scp/spaced conf 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/scp/spaced conf 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,6 @@ + UserKnownHostsFile known_hosts + + # Unindented +Host gee jar + # Indented, multiple hosts + HostName hus diff -Nru bash-completion-1.1/test/fixtures/sftp/config bash-completion-1.2/test/fixtures/sftp/config --- bash-completion-1.1/test/fixtures/sftp/config 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/sftp/config 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,6 @@ +UserKnownHostsFile known_hosts + + # Unindented +Host gee + # Indented, multiple hosts + HostName hus ike diff -Nru bash-completion-1.1/test/fixtures/sftp/known_hosts bash-completion-1.2/test/fixtures/sftp/known_hosts --- bash-completion-1.1/test/fixtures/sftp/known_hosts 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/sftp/known_hosts 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,4 @@ +|1|abc +|1|def +doo +ike ssh-rsa qwerty1234/Qwerty+1234== diff -Nru bash-completion-1.1/test/fixtures/sftp/spaced conf bash-completion-1.2/test/fixtures/sftp/spaced conf --- bash-completion-1.1/test/fixtures/sftp/spaced conf 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/sftp/spaced conf 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,6 @@ + UserKnownHostsFile known_hosts + + # Unindented +Host gee jar + # Indented, multiple hosts + HostName hus diff -Nru bash-completion-1.1/test/fixtures/shared/bin/arp bash-completion-1.2/test/fixtures/shared/bin/arp --- bash-completion-1.1/test/fixtures/shared/bin/arp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/fixtures/shared/bin/arp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,16 @@ +#!/bin/sh + +# Dummy "arp -an" emulator + +# Linux +echo "? (0.0.0.0) at 00:00:00:00:00:00 [ether] on eth0" + +# FreeBSD +echo "? (0.0.0.0) at 11:11:11:11:11:11 on bge0 expires in 5 seconds [ethernet]" + +# Solaris +cat <" + #assert_complete_into "chown $prefix$partgroup" "chown $prefix$fullgroup " $test + assert_complete $prefix$fullgroup "chown $prefix$partgroup" $test + sync_after_int + } + + # Check that we give up in degenerate cases instead of spewing various junk. + + assert_no_complete "chown $fulluser\\\\:$partgroup" + sync_after_int + + assert_no_complete "chown $fulluser\\\\\\:$partgroup" + sync_after_int + + assert_no_complete "chown $fulluser\\\\\\\\:$partgroup" + sync_after_int + + # Colons in user/groupnames are not usually allowed. + assert_no_complete "chown foo:bar:$partgroup" + sync_after_int +} + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/chsh.exp bash-completion-1.2/test/lib/completions/chsh.exp --- bash-completion-1.1/test/lib/completions/chsh.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/chsh.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,26 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "chsh -s " + + +sync_after_int + + +assert_complete [exec bash -c "compgen -A user"] "chsh " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/ci.exp bash-completion-1.2/test/lib/completions/ci.exp --- bash-completion-1.1/test/lib/completions/ci.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/ci.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ci " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/civclient.exp bash-completion-1.2/test/lib/completions/civclient.exp --- bash-completion-1.1/test/lib/completions/civclient.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/civclient.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "civclient -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/civserver.exp bash-completion-1.2/test/lib/completions/civserver.exp --- bash-completion-1.1/test/lib/completions/civserver.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/civserver.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "civserver -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/cksfv.exp bash-completion-1.2/test/lib/completions/cksfv.exp --- bash-completion-1.1/test/lib/completions/cksfv.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/cksfv.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "cksfv -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/cleanarch.exp bash-completion-1.2/test/lib/completions/cleanarch.exp --- bash-completion-1.1/test/lib/completions/cleanarch.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/cleanarch.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "cleanarch -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/clisp.exp bash-completion-1.2/test/lib/completions/clisp.exp --- bash-completion-1.1/test/lib/completions/clisp.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/clisp.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "clisp " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/clone_member.exp bash-completion-1.2/test/lib/completions/clone_member.exp --- bash-completion-1.1/test/lib/completions/clone_member.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/clone_member.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "clone_member -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/co.exp bash-completion-1.2/test/lib/completions/co.exp --- bash-completion-1.1/test/lib/completions/co.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/co.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "co " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/composite.exp bash-completion-1.2/test/lib/completions/composite.exp --- bash-completion-1.1/test/lib/completions/composite.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/composite.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "composite " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/config_list.exp bash-completion-1.2/test/lib/completions/config_list.exp --- bash-completion-1.1/test/lib/completions/config_list.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/config_list.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "config_list -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/configure.exp bash-completion-1.2/test/lib/completions/configure.exp --- bash-completion-1.1/test/lib/completions/configure.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/configure.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "configure --prefix " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/convert.exp bash-completion-1.2/test/lib/completions/convert.exp --- bash-completion-1.1/test/lib/completions/convert.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/convert.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "convert " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/cowsay.exp bash-completion-1.2/test/lib/completions/cowsay.exp --- bash-completion-1.1/test/lib/completions/cowsay.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/cowsay.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "cowsay " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/cp.exp bash-completion-1.2/test/lib/completions/cp.exp --- bash-completion-1.1/test/lib/completions/cp.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/cp.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "cp " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/cpio.exp bash-completion-1.2/test/lib/completions/cpio.exp --- bash-completion-1.1/test/lib/completions/cpio.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/cpio.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,26 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "cpio --" + + +sync_after_int + + +assert_complete [exec bash -c "compgen -A user"] "cpio -R " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/createdb.exp bash-completion-1.2/test/lib/completions/createdb.exp --- bash-completion-1.1/test/lib/completions/createdb.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/createdb.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "createdb " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/cryptsetup.exp bash-completion-1.2/test/lib/completions/cryptsetup.exp --- bash-completion-1.1/test/lib/completions/cryptsetup.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/cryptsetup.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "cryptsetup " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/csplit.exp bash-completion-1.2/test/lib/completions/csplit.exp --- bash-completion-1.1/test/lib/completions/csplit.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/csplit.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "csplit " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/cut.exp bash-completion-1.2/test/lib/completions/cut.exp --- bash-completion-1.1/test/lib/completions/cut.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/cut.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "cut " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/cvs.exp bash-completion-1.2/test/lib/completions/cvs.exp --- bash-completion-1.1/test/lib/completions/cvs.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/cvs.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,36 @@ +proc setup {} { + save_env + assert_bash_exec {OLDHOME=$HOME ; HOME=$TESTDIR/fixtures/cvs} +}; # setup() + + +proc teardown {} { + assert_bash_exec {HOME=$OLDHOME} + assert_env_unmodified { + /OLDHOME=/d + } +}; # teardown() + + +setup + + +assert_complete_any "cvs " + + +sync_after_int + + +set test "-d should complete CVS roots" +set cmd "cvs -d " +send "$cmd\t" +expect { + -re "^$cmd\r\n.*:pserver:.*\r\n/@$cmd:pserver:.*$" { pass "$test" } + default { fail "$test" } +}; # expect + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/cvsps.exp bash-completion-1.2/test/lib/completions/cvsps.exp --- bash-completion-1.1/test/lib/completions/cvsps.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/cvsps.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,36 @@ +proc setup {} { + save_env + assert_bash_exec {OLDHOME=$HOME ; HOME=$TESTDIR/fixtures/cvs} +}; # setup() + + +proc teardown {} { + assert_bash_exec {HOME=$OLDHOME} + assert_env_unmodified { + /OLDHOME=/d + } +}; # teardown() + + +setup + + +assert_complete_any "cvsps -" + + +sync_after_int + + +set test "No arguments should complete CVS roots" +set cmd "cvsps " +send "$cmd\t" +expect { + -re "^$cmd\r\n.*:pserver:.*\r\n/@$cmd:pserver:.*$" { pass "$test" } + default { fail "$test" } +}; # expect + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/date.exp bash-completion-1.2/test/lib/completions/date.exp --- bash-completion-1.1/test/lib/completions/date.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/date.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "date " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/dcop.exp bash-completion-1.2/test/lib/completions/dcop.exp --- bash-completion-1.1/test/lib/completions/dcop.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/dcop.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +if {[assert_exec {dcop} words]} { + assert_complete $words "dcop " +}; # if + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/dd.exp bash-completion-1.2/test/lib/completions/dd.exp --- bash-completion-1.1/test/lib/completions/dd.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/dd.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,33 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "dd --" + + +sync_after_int + + +set test "option should be suffixed with =" +set cmd "dd if" +send "$cmd\t" +expect -ex "$cmd" +expect { + -re "^=$" { pass $test } + -re {^\\=$} { xfail $test } +}; # expect + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/df.exp bash-completion-1.2/test/lib/completions/df.exp --- bash-completion-1.1/test/lib/completions/df.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/df.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "df " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/dhclient.exp bash-completion-1.2/test/lib/completions/dhclient.exp --- bash-completion-1.1/test/lib/completions/dhclient.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/dhclient.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "dhclient -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/dict.exp bash-completion-1.2/test/lib/completions/dict.exp --- bash-completion-1.1/test/lib/completions/dict.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/dict.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "dict -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/diff.exp bash-completion-1.2/test/lib/completions/diff.exp --- bash-completion-1.1/test/lib/completions/diff.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/diff.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "diff --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/dir.exp bash-completion-1.2/test/lib/completions/dir.exp --- bash-completion-1.1/test/lib/completions/dir.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/dir.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "dir " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/display.exp bash-completion-1.2/test/lib/completions/display.exp --- bash-completion-1.1/test/lib/completions/display.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/display.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,41 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "display " + + +sync_after_int + + +set test "- should complete options" +set options { + -alpha -antialias -authenticate -auto-orient -backdrop -background -border + -bordercolor -borderwidth -channel -clip -clip-path -coalesce -colormap + -colors -colorspace -comment -compress -contrast -crop -debug -decipher + -define -delay -density -depth -despeckle -display -dispose -dither -edge + -endian -enhance -extract -filter -flatten -flip -flop -font -foreground + -format -frame -gamma -geometry -help -iconGeometry -iconic -identify + -immutable -interlace -interpolate -label -limit -list -log -loop -map + -mattecolor -monitor -monochrome -name -negate -page -profile -quality + -quantize -quiet -raise -regard-warnings -remote -repage -resample -resize + -respect-parenthesis -roll -rotate -sample -sampling-factor -scenes -seed + -segment -set -shared-memory -sharpen -size -strip -texture -title + -transparent-color -treedepth -trim -update -usePixmap -verbose -version + -virtual-pixel -visual -window -window-group -write } +assert_complete $options "display -" $test + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/dnsspoof.exp bash-completion-1.2/test/lib/completions/dnsspoof.exp --- bash-completion-1.1/test/lib/completions/dnsspoof.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/dnsspoof.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "dnsspoof -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/dpkg-deb.exp bash-completion-1.2/test/lib/completions/dpkg-deb.exp --- bash-completion-1.1/test/lib/completions/dpkg-deb.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/dpkg-deb.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "dpkg-deb --c" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/dpkg.exp bash-completion-1.2/test/lib/completions/dpkg.exp --- bash-completion-1.1/test/lib/completions/dpkg.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/dpkg.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,29 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "dpkg --c" + + +sync_after_int + + + # Build list of installed packages +if {[assert_exec {dpkg --get-selections | command grep \[\[:space:\]\]install$ | cut -f1} packages]} { + assert_complete $packages "dpkg -L " +}; # if + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/dpkg-reconfigure.exp bash-completion-1.2/test/lib/completions/dpkg-reconfigure.exp --- bash-completion-1.1/test/lib/completions/dpkg-reconfigure.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/dpkg-reconfigure.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "dpkg-reconfigure --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/dpkg-source.exp bash-completion-1.2/test/lib/completions/dpkg-source.exp --- bash-completion-1.1/test/lib/completions/dpkg-source.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/dpkg-source.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "dpkg-source -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/dropdb.exp bash-completion-1.2/test/lib/completions/dropdb.exp --- bash-completion-1.1/test/lib/completions/dropdb.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/dropdb.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "dropdb " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/dselect.exp bash-completion-1.2/test/lib/completions/dselect.exp --- bash-completion-1.1/test/lib/completions/dselect.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/dselect.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "dselect " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/dsniff.exp bash-completion-1.2/test/lib/completions/dsniff.exp --- bash-completion-1.1/test/lib/completions/dsniff.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/dsniff.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "dsniff -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/du.exp bash-completion-1.2/test/lib/completions/du.exp --- bash-completion-1.1/test/lib/completions/du.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/du.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "du " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/dumpdb.exp bash-completion-1.2/test/lib/completions/dumpdb.exp --- bash-completion-1.1/test/lib/completions/dumpdb.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/dumpdb.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "dumpdb " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/enscript.exp bash-completion-1.2/test/lib/completions/enscript.exp --- bash-completion-1.1/test/lib/completions/enscript.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/enscript.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "enscript --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/env.exp bash-completion-1.2/test/lib/completions/env.exp --- bash-completion-1.1/test/lib/completions/env.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/env.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +if {[assert_exec {env --help} "" "" "unsupported"]} { + assert_complete_any "env --" +}; # if + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/evince.exp bash-completion-1.2/test/lib/completions/evince.exp --- bash-completion-1.1/test/lib/completions/evince.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/evince.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,35 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified {/OLDPWD=/d} +}; # teardown() + + +setup + + +# NOTE: The directory `fixtures/evince' contains an additional subdir `foo' +# (should be visible as completion) and an additional file `.txt' +# (shouldn't be visible as completion) +set files { + foo/ + .bmp .BMP .cbr .CBR .cbz .CBZ .djv .DJV .djvu .DJVU + .dvi .DVI .dvi.bz2 .dvi.BZ2 .DVI.bz2 .DVI.BZ2 .dvi.gz .dvi.GZ .DVI.gz .DVI.GZ + .eps .EPS .eps.bz2 .eps.BZ2 .EPS.bz2 .EPS.BZ2 .eps.gz .eps.GZ .EPS.gz .EPS.GZ + .gif .GIF .ico .ICO .jpeg .JPEG .jpg .JPG .miff .MIFF .pbm .PBM .pcx .PCX + .pdf .PDF .pdf.bz2 .pdf.BZ2 .PDF.bz2 .PDF.BZ2 .pdf.gz .pdf.GZ .PDF.gz .PDF.GZ + .pgm .PGM .png .PNG .pnm .PNM .ppm .PPM + .ps .PS .ps.bz2 .ps.BZ2 .PS.bz2 .PS.BZ2 .ps.gz .ps.GZ .PS.gz .PS.GZ + .tga .TGA .tif .TIF .tiff .TIFF + .xpm .XPM .xwd .XWD +} +assert_complete_dir $files "evince " "fixtures/evince" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/expand.exp bash-completion-1.2/test/lib/completions/expand.exp --- bash-completion-1.1/test/lib/completions/expand.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/expand.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +if {[assert_exec {expand --help} "" "" "unsupported"]} { + assert_complete_any "expand --" +}; # if + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/filesnarf.exp bash-completion-1.2/test/lib/completions/filesnarf.exp --- bash-completion-1.1/test/lib/completions/filesnarf.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/filesnarf.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "filesnarf -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/find.exp bash-completion-1.2/test/lib/completions/find.exp --- bash-completion-1.1/test/lib/completions/find.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/find.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,80 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified {/OLDPWD=/d} +}; # teardown() + + +setup + + +assert_complete_any "find " + + +sync_after_int + + +assert_complete_any "find -fstype " + + +sync_after_int + + +set options [list -daystart -depth -follow -help \ + -ignore_readdir_race -maxdepth -mindepth -mindepth -mount \ + -noignore_readdir_race -noleaf -regextype -version -warn -nowarn \ + -xdev \ + -amin -anewer -atime -cmin -cnewer -ctime -empty -executable -false \ + -fstype -gid -group -ilname -iname -inum -ipath -iregex -iwholename \ + -links -lname -mmin -mtime -name -newer -nogroup -nouser -path -perm \ + -readable -regex -samefile -size -true -type -uid -used -user \ + -wholename -writable -xtype -context \ + -delete -exec -execdir -fls -fprint -fprint0 -fprintf -ls -ok -okdir \ + -print -print0 -printf -prune -quit] +assert_complete $options {find -} + + +sync_after_int + + +set test "-wholename should complete files/dirs" +set dir fixtures/shared/default +set files [split [exec bash -c "cd $dir && ls -p"] "\n"] +assert_complete_dir $files "find -wholename " $dir + + +sync_after_int + + +set test "-uid should complete uids" + # Complete +set cmd "find -uid " +send "$cmd\t" +expect { + -re "$cmd\r\n\\d+.*/@$cmd$" { pass "$test" } + -re /@ { unresolved "$test at prompt" } + -re eof { unresolved "eof" } +}; # expect + + +sync_after_int + + +set test "-gid should complete gids" + # Complete +set cmd "find -gid " +send "$cmd\t" +expect { + -re "$cmd\r\n\\d+.*/@$cmd$" { pass "$test" } + -re /@ { unresolved "$test at prompt" } + -re eof { unresolved "eof" } +}; # expect + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/find_member.exp bash-completion-1.2/test/lib/completions/find_member.exp --- bash-completion-1.1/test/lib/completions/find_member.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/find_member.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "find_member -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/finger.exp bash-completion-1.2/test/lib/completions/finger.exp --- bash-completion-1.1/test/lib/completions/finger.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/finger.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,57 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +set test "Tab should complete usernames" +# Build string list of usernames +set users {} +foreach u [exec bash -c "compgen -A user"] { + lappend users $u +}; # foreach +assert_complete $users "finger " $test + + +sync_after_int + + +set test "Tab should complete partial username" +assert_complete_partial [exec bash -c "compgen -A user"] "finger" + + +sync_after_int + + +set test "Tab should complete partial hostname" +# Build string list of hostnames, starting with the character of the first +# host, unless host starts with a COMP_WORDBREAKS character, e.g. a colon (:). +# Hosts starting with a COMP_WORDBREAKS character are left out because these +# are exceptional cases, requiring specific tests. +set hosts {} +set char "" +foreach h [get_known_hosts] { + set first [string range $h 0 0] + if {$char == "" && [string first $first $COMP_WORDBREAKS] == -1} {set char $first} + if {$char != ""} { + # Only append unique hostnames starting with $char + if {$first == $char && [lsearch -exact $hosts "test@$h"] == -1} { + # Prefix hosts with username 'test@' + lappend hosts "test@$h" + }; # if + }; # if +}; # foreach +assert_complete $hosts "finger test@$char" $test + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/fmt.exp bash-completion-1.2/test/lib/completions/fmt.exp --- bash-completion-1.1/test/lib/completions/fmt.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/fmt.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +if {[assert_exec {fmt --help} "" "" "unsupported"]} { + assert_complete_any "fmt -" +}; # if + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/fold.exp bash-completion-1.2/test/lib/completions/fold.exp --- bash-completion-1.1/test/lib/completions/fold.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/fold.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +if {[assert_exec {fold --help} "" "" "unsupported"]} { + assert_complete_any "fold --" +}; # if + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/g4.exp bash-completion-1.2/test/lib/completions/g4.exp --- bash-completion-1.1/test/lib/completions/g4.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/g4.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "g4 " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/g77.exp bash-completion-1.2/test/lib/completions/g77.exp --- bash-completion-1.1/test/lib/completions/g77.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/g77.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "g77 " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/gcc.exp bash-completion-1.2/test/lib/completions/gcc.exp --- bash-completion-1.1/test/lib/completions/gcc.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/gcc.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "gcc " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/gcj.exp bash-completion-1.2/test/lib/completions/gcj.exp --- bash-completion-1.1/test/lib/completions/gcj.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/gcj.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "gcj " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/gcl.exp bash-completion-1.2/test/lib/completions/gcl.exp --- bash-completion-1.1/test/lib/completions/gcl.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/gcl.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "gcl " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/gdb.exp bash-completion-1.2/test/lib/completions/gdb.exp --- bash-completion-1.1/test/lib/completions/gdb.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/gdb.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "gdb - " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/genaliases.exp bash-completion-1.2/test/lib/completions/genaliases.exp --- bash-completion-1.1/test/lib/completions/genaliases.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/genaliases.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "genaliases -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/getent.exp bash-completion-1.2/test/lib/completions/getent.exp --- bash-completion-1.1/test/lib/completions/getent.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/getent.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "getent " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/g++.exp bash-completion-1.2/test/lib/completions/g++.exp --- bash-completion-1.1/test/lib/completions/g++.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/g++.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "g++ " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/gkrellm.exp bash-completion-1.2/test/lib/completions/gkrellm.exp --- bash-completion-1.1/test/lib/completions/gkrellm.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/gkrellm.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "gkrellm -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/gmplayer.exp bash-completion-1.2/test/lib/completions/gmplayer.exp --- bash-completion-1.1/test/lib/completions/gmplayer.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/gmplayer.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "gmplayer " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/gnatmake.exp bash-completion-1.2/test/lib/completions/gnatmake.exp --- bash-completion-1.1/test/lib/completions/gnatmake.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/gnatmake.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "gnatmake " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/gpc.exp bash-completion-1.2/test/lib/completions/gpc.exp --- bash-completion-1.1/test/lib/completions/gpc.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/gpc.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "gpc " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/gperf.exp bash-completion-1.2/test/lib/completions/gperf.exp --- bash-completion-1.1/test/lib/completions/gperf.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/gperf.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "gperf --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/gpg.exp bash-completion-1.2/test/lib/completions/gpg.exp --- bash-completion-1.1/test/lib/completions/gpg.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/gpg.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "gpg " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/gprof.exp bash-completion-1.2/test/lib/completions/gprof.exp --- bash-completion-1.1/test/lib/completions/gprof.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/gprof.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +if {[assert_exec {gprof --help} "" "" "unsupported"]} { + assert_complete_any "gprof --" +}; # if + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/grep.exp bash-completion-1.2/test/lib/completions/grep.exp --- bash-completion-1.1/test/lib/completions/grep.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/grep.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "grep --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/grub.exp bash-completion-1.2/test/lib/completions/grub.exp --- bash-completion-1.1/test/lib/completions/grub.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/grub.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "grub --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/gzip.exp bash-completion-1.2/test/lib/completions/gzip.exp --- bash-completion-1.1/test/lib/completions/gzip.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/gzip.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,28 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +set test "Tab should complete" + # Try completion +set cmd "gzip " +send "$cmd\t" +expect { + -re "^$cmd\r\n.*$cmd$" { pass "$test" } + -re /@ { unresolved "$test at prompt" } + -re eof { unresolved "eof" } +}; # expect + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/hcitool.exp bash-completion-1.2/test/lib/completions/hcitool.exp --- bash-completion-1.1/test/lib/completions/hcitool.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/hcitool.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "hcitool " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/head.exp bash-completion-1.2/test/lib/completions/head.exp --- bash-completion-1.1/test/lib/completions/head.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/head.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +if {[assert_exec {head --help} "" "" "unsupported"]} { + assert_complete_any "head --" +}; # if + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/iconv.exp bash-completion-1.2/test/lib/completions/iconv.exp --- bash-completion-1.1/test/lib/completions/iconv.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/iconv.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "iconv -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/identify.exp bash-completion-1.2/test/lib/completions/identify.exp --- bash-completion-1.1/test/lib/completions/identify.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/identify.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "identify -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/id.exp bash-completion-1.2/test/lib/completions/id.exp --- bash-completion-1.1/test/lib/completions/id.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/id.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "id -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/ifdown.exp bash-completion-1.2/test/lib/completions/ifdown.exp --- bash-completion-1.1/test/lib/completions/ifdown.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/ifdown.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ifdown " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/ifup.exp bash-completion-1.2/test/lib/completions/ifup.exp --- bash-completion-1.1/test/lib/completions/ifup.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/ifup.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ifup " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/indent.exp bash-completion-1.2/test/lib/completions/indent.exp --- bash-completion-1.1/test/lib/completions/indent.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/indent.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "indent --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/info.exp bash-completion-1.2/test/lib/completions/info.exp --- bash-completion-1.1/test/lib/completions/info.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/info.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "info " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/inject.exp bash-completion-1.2/test/lib/completions/inject.exp --- bash-completion-1.1/test/lib/completions/inject.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/inject.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "inject " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/insmod.exp bash-completion-1.2/test/lib/completions/insmod.exp --- bash-completion-1.1/test/lib/completions/insmod.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/insmod.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "insmod in" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/invoke-rc.d.exp bash-completion-1.2/test/lib/completions/invoke-rc.d.exp --- bash-completion-1.1/test/lib/completions/invoke-rc.d.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/invoke-rc.d.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "invoke-rc.d " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/ipsec.exp bash-completion-1.2/test/lib/completions/ipsec.exp --- bash-completion-1.1/test/lib/completions/ipsec.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/ipsec.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ipsec " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/ipv6calc.exp bash-completion-1.2/test/lib/completions/ipv6calc.exp --- bash-completion-1.1/test/lib/completions/ipv6calc.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/ipv6calc.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,26 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ipv6calc -" + + +sync_after_int + + +assert_complete_any "ipv6calc --in " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/irb.exp bash-completion-1.2/test/lib/completions/irb.exp --- bash-completion-1.1/test/lib/completions/irb.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/irb.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "irb " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/isql.exp bash-completion-1.2/test/lib/completions/isql.exp --- bash-completion-1.1/test/lib/completions/isql.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/isql.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,23 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified {/ODBCINI=/d} +}; # teardown() + + +setup + + +assert_bash_exec {OLDODBCINI=$ODBCINI; ODBCINI=$TESTDIR/fixtures/isql/odbc.ini} +assert_complete_any "isql " +sync_after_int +assert_bash_exec {ODBCINI=$OLDODBCINI; unset -v OLDODBCINI} + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/iwconfig.exp bash-completion-1.2/test/lib/completions/iwconfig.exp --- bash-completion-1.1/test/lib/completions/iwconfig.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/iwconfig.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "iwconfig --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/iwlist.exp bash-completion-1.2/test/lib/completions/iwlist.exp --- bash-completion-1.1/test/lib/completions/iwlist.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/iwlist.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "iwlist --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/iwpriv.exp bash-completion-1.2/test/lib/completions/iwpriv.exp --- bash-completion-1.1/test/lib/completions/iwpriv.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/iwpriv.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "iwpriv --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/iwspy.exp bash-completion-1.2/test/lib/completions/iwspy.exp --- bash-completion-1.1/test/lib/completions/iwspy.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/iwspy.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_env_unmodified "iwspy --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/jar.exp bash-completion-1.2/test/lib/completions/jar.exp --- bash-completion-1.1/test/lib/completions/jar.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/jar.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "jar " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/jarsigner.exp bash-completion-1.2/test/lib/completions/jarsigner.exp --- bash-completion-1.1/test/lib/completions/jarsigner.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/jarsigner.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "jarsigner " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/javac.exp bash-completion-1.2/test/lib/completions/javac.exp --- bash-completion-1.1/test/lib/completions/javac.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/javac.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "javac " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/javadoc.exp bash-completion-1.2/test/lib/completions/javadoc.exp --- bash-completion-1.1/test/lib/completions/javadoc.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/javadoc.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "javadoc " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/java.exp bash-completion-1.2/test/lib/completions/java.exp --- bash-completion-1.1/test/lib/completions/java.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/java.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,46 @@ +proc setup {} { + assert_bash_exec {CLASSPATH=$TESTDIR/fixtures/java/a:$TESTDIR/fixtures/java/bashcomp.jar} + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "java -" + + +sync_after_int + + +assert_complete "b bashcomp.jarred toplevel" "java " + + +sync_after_int + + +assert_complete "bashcomp.jarred toplevel" \ + "java -cp fixtures/java/bashcomp.jar " + + +sync_after_int + + +assert_no_complete "java -cp \"\" " + + +sync_after_int + + +assert_complete "a/ bashcomp.jar" "java -jar fixtures/java/" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/k3b.exp bash-completion-1.2/test/lib/completions/k3b.exp --- bash-completion-1.1/test/lib/completions/k3b.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/k3b.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "k3b " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/kdvi.exp bash-completion-1.2/test/lib/completions/kdvi.exp --- bash-completion-1.1/test/lib/completions/kdvi.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/kdvi.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,27 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified {/OLDPWD=/d} +}; # teardown() + + +setup + + +# NOTE: The directory `fixtures/kdvi' contains an additional subdir `foo' +# (should be visible as completion) and an additional file `.txt' +# (shouldn't be visible as completion) +set files { + foo/ + .dvi .DVI .dvi.bz2 .DVI.bz2 .dvi.gz .DVI.gz .dvi.Z .DVI.Z +} +assert_complete_dir $files "kdvi " "fixtures/kdvi" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/killall.exp bash-completion-1.2/test/lib/completions/killall.exp --- bash-completion-1.1/test/lib/completions/killall.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/killall.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,26 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "killall " + + +sync_after_int + + +assert_complete [get_signals] "killall -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/kill.exp bash-completion-1.2/test/lib/completions/kill.exp --- bash-completion-1.1/test/lib/completions/kill.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/kill.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,26 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "kill 1" + + +sync_after_int + + +assert_complete [get_signals] "kill -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/kldload.exp bash-completion-1.2/test/lib/completions/kldload.exp --- bash-completion-1.1/test/lib/completions/kldload.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/kldload.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "kldload " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/kldunload.exp bash-completion-1.2/test/lib/completions/kldunload.exp --- bash-completion-1.1/test/lib/completions/kldunload.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/kldunload.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,24 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +if {[catch {eval exec {kldstat | grep "\.ko$"}}] == 0} { + assert_complete_any "kldunload " +} else { + assert_no_complete "kldunload " +} + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/kpdf.exp bash-completion-1.2/test/lib/completions/kpdf.exp --- bash-completion-1.1/test/lib/completions/kpdf.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/kpdf.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,26 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified {/OLDPWD=/d} +}; # teardown() + + +setup + + +# NOTE: The directory `fixtures/kpdf' contains an additional subdir `foo' +# (should be visible as completion) and an additional file `.txt' +# (shouldn't be visible as completion) +set files { + foo/ .eps .ps .EPS .PS .pdf .PDF +} +assert_complete_dir $files "kpdf " "fixtures/kpdf" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/kplayer.exp bash-completion-1.2/test/lib/completions/kplayer.exp --- bash-completion-1.1/test/lib/completions/kplayer.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/kplayer.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "kplayer " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/larch.exp bash-completion-1.2/test/lib/completions/larch.exp --- bash-completion-1.1/test/lib/completions/larch.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/larch.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "larch library-" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/ldd.exp bash-completion-1.2/test/lib/completions/ldd.exp --- bash-completion-1.1/test/lib/completions/ldd.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/ldd.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ldd " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/ld.exp bash-completion-1.2/test/lib/completions/ld.exp --- bash-completion-1.1/test/lib/completions/ld.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/ld.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ld " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/less.exp bash-completion-1.2/test/lib/completions/less.exp --- bash-completion-1.1/test/lib/completions/less.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/less.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "less --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/lftp.exp bash-completion-1.2/test/lib/completions/lftp.exp --- bash-completion-1.1/test/lib/completions/lftp.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/lftp.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,24 @@ +proc setup {} { + assert_bash_exec {HOME=$TESTDIR/fixtures/lftp} + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +set expected [get_hosts] +# `lftptest' is defined in ./fixtures/lftp/.lftp/bookmarks +lappend expected lftptest +assert_complete $expected "lftp " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/lftpget.exp bash-completion-1.2/test/lib/completions/lftpget.exp --- bash-completion-1.1/test/lib/completions/lftpget.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/lftpget.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lftpget -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/lilo.exp bash-completion-1.2/test/lib/completions/lilo.exp --- bash-completion-1.1/test/lib/completions/lilo.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/lilo.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lilo -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/links.exp bash-completion-1.2/test/lib/completions/links.exp --- bash-completion-1.1/test/lib/completions/links.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/links.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "links " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/lisp.exp bash-completion-1.2/test/lib/completions/lisp.exp --- bash-completion-1.1/test/lib/completions/lisp.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/lisp.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lisp " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/list_admins.exp bash-completion-1.2/test/lib/completions/list_admins.exp --- bash-completion-1.1/test/lib/completions/list_admins.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/list_admins.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "list_admins -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/list_lists.exp bash-completion-1.2/test/lib/completions/list_lists.exp --- bash-completion-1.1/test/lib/completions/list_lists.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/list_lists.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "list_lists -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/list_members.exp bash-completion-1.2/test/lib/completions/list_members.exp --- bash-completion-1.1/test/lib/completions/list_members.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/list_members.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "list_members -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/list_owners.exp bash-completion-1.2/test/lib/completions/list_owners.exp --- bash-completion-1.1/test/lib/completions/list_owners.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/list_owners.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "list_owners -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/ln.exp bash-completion-1.2/test/lib/completions/ln.exp --- bash-completion-1.1/test/lib/completions/ln.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/ln.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ln " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/look.exp bash-completion-1.2/test/lib/completions/look.exp --- bash-completion-1.1/test/lib/completions/look.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/look.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +if {[assert_exec {look foo | grep ^foo} words]} { + assert_complete $words "look foo" +}; # if + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/ls.exp bash-completion-1.2/test/lib/completions/ls.exp --- bash-completion-1.1/test/lib/completions/ls.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/ls.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +if {[assert_exec {ls --help} "" "" "unsupported"]} { + assert_complete_any "ls --" +}; # if + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/lvchange.exp bash-completion-1.2/test/lib/completions/lvchange.exp --- bash-completion-1.1/test/lib/completions/lvchange.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/lvchange.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lvchange --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/lvcreate.exp bash-completion-1.2/test/lib/completions/lvcreate.exp --- bash-completion-1.1/test/lib/completions/lvcreate.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/lvcreate.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lvcreate --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/lvdisplay.exp bash-completion-1.2/test/lib/completions/lvdisplay.exp --- bash-completion-1.1/test/lib/completions/lvdisplay.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/lvdisplay.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lvdisplay --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/lvextend.exp bash-completion-1.2/test/lib/completions/lvextend.exp --- bash-completion-1.1/test/lib/completions/lvextend.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/lvextend.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lvextend --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/lvmdiskscan.exp bash-completion-1.2/test/lib/completions/lvmdiskscan.exp --- bash-completion-1.1/test/lib/completions/lvmdiskscan.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/lvmdiskscan.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lvmdiskscan --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/lvm.exp bash-completion-1.2/test/lib/completions/lvm.exp --- bash-completion-1.1/test/lib/completions/lvm.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/lvm.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lvm pv" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/lvreduce.exp bash-completion-1.2/test/lib/completions/lvreduce.exp --- bash-completion-1.1/test/lib/completions/lvreduce.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/lvreduce.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lvreduce --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/lvremove.exp bash-completion-1.2/test/lib/completions/lvremove.exp --- bash-completion-1.1/test/lib/completions/lvremove.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/lvremove.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lvremove --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/lvrename.exp bash-completion-1.2/test/lib/completions/lvrename.exp --- bash-completion-1.1/test/lib/completions/lvrename.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/lvrename.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lvrename --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/lvresize.exp bash-completion-1.2/test/lib/completions/lvresize.exp --- bash-completion-1.1/test/lib/completions/lvresize.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/lvresize.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lvresize --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/lvscan.exp bash-completion-1.2/test/lib/completions/lvscan.exp --- bash-completion-1.1/test/lib/completions/lvscan.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/lvscan.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lvscan --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/lvs.exp bash-completion-1.2/test/lib/completions/lvs.exp --- bash-completion-1.1/test/lib/completions/lvs.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/lvs.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lvs --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/lzma.exp bash-completion-1.2/test/lib/completions/lzma.exp --- bash-completion-1.1/test/lib/completions/lzma.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/lzma.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,26 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lzma " + + +sync_after_int + + +assert_complete "a/ bashcomp.lzma bashcomp.tlz" "lzma -d fixtures/xz/" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/lzop.exp bash-completion-1.2/test/lib/completions/lzop.exp --- bash-completion-1.1/test/lib/completions/lzop.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/lzop.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "lzop " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/m4.exp bash-completion-1.2/test/lib/completions/m4.exp --- bash-completion-1.1/test/lib/completions/m4.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/m4.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +if {[assert_exec {m4 --help} "" "" "unsupported"]} { + assert_complete_any "m4 --" +}; # if + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/macof.exp bash-completion-1.2/test/lib/completions/macof.exp --- bash-completion-1.1/test/lib/completions/macof.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/macof.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "macof -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/mailmanctl.exp bash-completion-1.2/test/lib/completions/mailmanctl.exp --- bash-completion-1.1/test/lib/completions/mailmanctl.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/mailmanctl.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mailmanctl " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/mailsnarf.exp bash-completion-1.2/test/lib/completions/mailsnarf.exp --- bash-completion-1.1/test/lib/completions/mailsnarf.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/mailsnarf.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mailsnarf -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/make.exp bash-completion-1.2/test/lib/completions/make.exp --- bash-completion-1.1/test/lib/completions/make.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/make.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "make " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/man.exp bash-completion-1.2/test/lib/completions/man.exp --- bash-completion-1.1/test/lib/completions/man.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/man.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "man man" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/mc.exp bash-completion-1.2/test/lib/completions/mc.exp --- bash-completion-1.1/test/lib/completions/mc.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/mc.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mc -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/mcrypt.exp bash-completion-1.2/test/lib/completions/mcrypt.exp --- bash-completion-1.1/test/lib/completions/mcrypt.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/mcrypt.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mcrypt " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/md5sum.exp bash-completion-1.2/test/lib/completions/md5sum.exp --- bash-completion-1.1/test/lib/completions/md5sum.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/md5sum.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "md5sum " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/mdecrypt.exp bash-completion-1.2/test/lib/completions/mdecrypt.exp --- bash-completion-1.1/test/lib/completions/mdecrypt.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/mdecrypt.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mdecrypt " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/mencoder.exp bash-completion-1.2/test/lib/completions/mencoder.exp --- bash-completion-1.1/test/lib/completions/mencoder.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/mencoder.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mencoder " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/minicom.exp bash-completion-1.2/test/lib/completions/minicom.exp --- bash-completion-1.1/test/lib/completions/minicom.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/minicom.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "minicom -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/mkdir.exp bash-completion-1.2/test/lib/completions/mkdir.exp --- bash-completion-1.1/test/lib/completions/mkdir.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/mkdir.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mkdir " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/mkfifo.exp bash-completion-1.2/test/lib/completions/mkfifo.exp --- bash-completion-1.1/test/lib/completions/mkfifo.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/mkfifo.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mkfifo " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/mkinitrd.exp bash-completion-1.2/test/lib/completions/mkinitrd.exp --- bash-completion-1.1/test/lib/completions/mkinitrd.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/mkinitrd.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mkinitrd " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/mkisofs.exp bash-completion-1.2/test/lib/completions/mkisofs.exp --- bash-completion-1.1/test/lib/completions/mkisofs.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/mkisofs.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,48 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mkisofs " + + +sync_after_int + + +set test "-uid should complete uids" + # Try completion +set cmd "mkisofs -uid " +send "$cmd\t" +expect { + -re "^$cmd\r\n\\d+.*$cmd$" { pass "$test" } + -re /@ { unresolved "$test at prompt" } + -re eof { unresolved "eof" } +}; # expect + + +sync_after_int + + +set test "-gid should complete gids" + # Try completion +set cmd "mkisofs -gid " +send "$cmd\t" +expect { + -re "^$cmd\r\n\\d+.*$cmd$" { pass "$test" } + -re /@ { unresolved "$test at prompt" } + -re eof { unresolved "eof" } +}; # expect + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/mknod.exp bash-completion-1.2/test/lib/completions/mknod.exp --- bash-completion-1.1/test/lib/completions/mknod.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/mknod.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mknod " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/mmsitepass.exp bash-completion-1.2/test/lib/completions/mmsitepass.exp --- bash-completion-1.1/test/lib/completions/mmsitepass.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/mmsitepass.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mmsitepass " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/module.exp bash-completion-1.2/test/lib/completions/module.exp --- bash-completion-1.1/test/lib/completions/module.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/module.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "module " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/mogrify.exp bash-completion-1.2/test/lib/completions/mogrify.exp --- bash-completion-1.1/test/lib/completions/mogrify.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/mogrify.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mogrify " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/montage.exp bash-completion-1.2/test/lib/completions/montage.exp --- bash-completion-1.1/test/lib/completions/montage.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/montage.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "montage " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/mount.exp bash-completion-1.2/test/lib/completions/mount.exp --- bash-completion-1.1/test/lib/completions/mount.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/mount.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,121 @@ +# mount completion from fstab can't be tested directly because it +# (correctly) uses absolute paths. So we create a custom completion which +# reads from a file in our text fixture instead. +proc setup_dummy_mnt {} { + assert_bash_exec {unset COMPREPLY cur} + assert_bash_exec {unset -f _mnt} + + global TESTDIR + assert_bash_exec { \ + _mnt() { \ + local cur=$(_get_cword); \ + _linux_fstab $(_get_pword) < "$TESTDIR/fixtures/mount/test-fstab"; \ + }; \ + complete -F _mnt mnt \ + } +} + + +proc teardown_dummy_mnt {} { + assert_bash_exec {unset COMPREPLY cur} + assert_bash_exec {unset -f _mnt} + assert_bash_exec {complete -r mnt} +} + + +proc setup {} { + save_env + setup_dummy_mnt +} + + +proc teardown {} { + teardown_dummy_mnt + assert_env_unmodified +} + + +setup + + +assert_complete_any "mount " + + +sync_after_int + + +assert_complete_any "mount -t " + + +sync_after_int + + +set test "Check completing nfs mounts" +set expected [list /test/path /test/path2 /second/path] +set cmd "mount mocksrv:/" +assert_bash_exec {OLDPATH="$PATH"; PATH="$TESTDIR/fixtures/mount/bin:$PATH";} +# This needs an explicit cword param or will output "unresolved". +assert_complete $expected $cmd $test "/@" 20 "/" +sync_after_int +assert_bash_exec {PATH="$OLDPATH"; unset -v OLDPATH} + + +sync_after_int + + +set test "Testing internal __linux_fstab_unescape function for mount" +# One round of slashes is for bash. +assert_bash_exec {var=one\'two\\040three\\} +assert_bash_exec {__linux_fstab_unescape var} +set cmd {echo $var} +send "$cmd\r" +expect { + -ex "$cmd\r\none'two three\\" { pass $test } +# default { fail $test } +} +sync_after_int +assert_bash_exec {unset var} + + +sync_after_int + + +# Begin testing through mnt (see setup_dummy_mnt). +assert_complete {/mnt/nice-test-path} {mnt /mnt/nice-test-p} +sync_after_int + +assert_complete {/mnt/nice\ test-path} {mnt /mnt/nice\ test-p} +sync_after_int + +assert_complete {/mnt/nice\$test-path} {mnt /mnt/nice\$test-p} +sync_after_int + +assert_complete {/mnt/nice\ test\\path} {mnt /mnt/nice\ test\\p} +sync_after_int + +assert_complete {{/mnt/nice\ test\\path} {/mnt/nice\ test-path}} \ + {mnt /mnt/nice\ } "" /@ 20 {/mnt/nice\ } +sync_after_int + +assert_complete {/mnt/nice\$test-path} {mnt /mnt/nice\$} +sync_after_int + +assert_complete {/mnt/nice\'test-path} {mnt /mnt/nice\'} +sync_after_int + +assert_complete {/mnt/other\'test\ path} {mnt /mnt/other} +sync_after_int + +assert_complete {Ubuntu\ Karmic} {mnt -L Ubu} +sync_after_int + +assert_complete {Debian-it\'s\ awesome} {mnt -L Deb} +sync_after_int + +# This does not work. Proper support for this requires smarter parsing of +# $COMP_LINE and it's not worth doing just for mount. +#assert_complete {$'/mnt/nice\ntest-path'} {mnt $'/mnt/nice\n} +#sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/mplayer.exp bash-completion-1.2/test/lib/completions/mplayer.exp --- bash-completion-1.1/test/lib/completions/mplayer.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/mplayer.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mplayer " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/msgsnarf.exp bash-completion-1.2/test/lib/completions/msgsnarf.exp --- bash-completion-1.1/test/lib/completions/msgsnarf.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/msgsnarf.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "msgsnarf -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/mtx.exp bash-completion-1.2/test/lib/completions/mtx.exp --- bash-completion-1.1/test/lib/completions/mtx.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/mtx.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mtx " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/mutt.exp bash-completion-1.2/test/lib/completions/mutt.exp --- bash-completion-1.1/test/lib/completions/mutt.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/mutt.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,33 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified {/OLDPWD=/d} +}; # teardown() + + +setup + + +assert_complete_any "mutt -" + + +sync_after_int + + +set test "mutt should complete mailboxes" +set expected {foo/ bar/ muttrc} +assert_complete_dir $expected "mutt -F muttrc -f =" fixtures/mutt + + +set test "mutt should complete aliases" +set expected {a1 a2} +assert_complete_dir $expected "mutt -F muttrc -A " fixtures/mutt + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/muttng.exp bash-completion-1.2/test/lib/completions/muttng.exp --- bash-completion-1.1/test/lib/completions/muttng.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/muttng.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "muttng -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/mv.exp bash-completion-1.2/test/lib/completions/mv.exp --- bash-completion-1.1/test/lib/completions/mv.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/mv.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mv " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/mysqladmin.exp bash-completion-1.2/test/lib/completions/mysqladmin.exp --- bash-completion-1.1/test/lib/completions/mysqladmin.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/mysqladmin.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "mysqladmin -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/ncftp.exp bash-completion-1.2/test/lib/completions/ncftp.exp --- bash-completion-1.1/test/lib/completions/ncftp.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/ncftp.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ncftp " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/netstat.exp bash-completion-1.2/test/lib/completions/netstat.exp --- bash-completion-1.1/test/lib/completions/netstat.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/netstat.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "netstat " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/newlist.exp bash-completion-1.2/test/lib/completions/newlist.exp --- bash-completion-1.1/test/lib/completions/newlist.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/newlist.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "newlist " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/nl.exp bash-completion-1.2/test/lib/completions/nl.exp --- bash-completion-1.1/test/lib/completions/nl.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/nl.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "nl " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/nm.exp bash-completion-1.2/test/lib/completions/nm.exp --- bash-completion-1.1/test/lib/completions/nm.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/nm.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "nm " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/ntpdate.exp bash-completion-1.2/test/lib/completions/ntpdate.exp --- bash-completion-1.1/test/lib/completions/ntpdate.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/ntpdate.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ntpdate -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/objcopy.exp bash-completion-1.2/test/lib/completions/objcopy.exp --- bash-completion-1.1/test/lib/completions/objcopy.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/objcopy.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "objcopy " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/objdump.exp bash-completion-1.2/test/lib/completions/objdump.exp --- bash-completion-1.1/test/lib/completions/objdump.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/objdump.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "objdump " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/od.exp bash-completion-1.2/test/lib/completions/od.exp --- bash-completion-1.1/test/lib/completions/od.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/od.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "od " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/openssl.exp bash-completion-1.2/test/lib/completions/openssl.exp --- bash-completion-1.1/test/lib/completions/openssl.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/openssl.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,28 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +set test "Tab should complete" + # Try completion +set cmd "openssl " +send "$cmd\t" +expect { + -re "^$cmd\r\n.*$cmd$" { pass "$test" } + -re /@ { unresolved "$test at prompt" } + -re eof { unresolved "eof" } +}; # expect + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/p4.exp bash-completion-1.2/test/lib/completions/p4.exp --- bash-completion-1.1/test/lib/completions/p4.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/p4.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "p4 " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/pack200.exp bash-completion-1.2/test/lib/completions/pack200.exp --- bash-completion-1.1/test/lib/completions/pack200.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/pack200.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pack200 " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/paste.exp bash-completion-1.2/test/lib/completions/paste.exp --- bash-completion-1.1/test/lib/completions/paste.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/paste.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "paste " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/patch.exp bash-completion-1.2/test/lib/completions/patch.exp --- bash-completion-1.1/test/lib/completions/patch.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/patch.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "patch " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/perldoc.exp bash-completion-1.2/test/lib/completions/perldoc.exp --- bash-completion-1.1/test/lib/completions/perldoc.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/perldoc.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,38 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "perldoc -" + + +sync_after_int + + +set test "perldoc should complete word containing colons" +set cmd "perldoc File::" +send "$cmd\t" +expect { + # Assuming the module `File::Path' is always installed + -re "\\sPath\\s" { pass "$test" } + # Assuming there's no perl module named `fixtures', but only our directory + # `test/fixtures' which is presented falsely. + -re "\\sfixtures/\\s" { fail "$test" } + -re "perldoc File::File::" { fail "$test" } + -re /@ { unresolved "$test" } + default { unresolved "$test" } +}; # expect + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/perl.exp bash-completion-1.2/test/lib/completions/perl.exp --- bash-completion-1.1/test/lib/completions/perl.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/perl.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,95 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "perl " + + +sync_after_int + + +set test "Second argument should file complete" +set cmd "perl foo fixtures/shared/default/f" +send "$cmd\t" +expect { + -re "^$cmd\r\nfoo +foo.d/ *\r\n/@${cmd}oo$" { pass "$test" } + -re /@ { unresolved "$test at prompt" } + -re eof { unresolved "eof" } +} + + +sync_after_int + + +set test "-I without space should complete directories" +set cmd "perl -Ifixtures/shared/default/" +send "$cmd\t" +expect { + -re "^$cmd\r\nbar bar.d/ +foo.d/ *\r\n/@$cmd$" { pass "$test" } + -re /@ { unresolved "$test at prompt" } + -re eof { unresolved "eof" } +} + + +sync_after_int + + +set test "-I with space should complete directories" +set cmd "perl -I fixtures/shared/default/" +send "$cmd\t" +expect { + -re "^$cmd\r\nbar bar.d/ +foo.d/ *\r\n/@$cmd$" { pass "$test" } + -re /@ { unresolved "$test at prompt" } + -re eof { unresolved "eof" } +} + + +sync_after_int + + +set test "-x without space should complete directories" +set cmd "perl -xfixtures/shared/default/b" +send "$cmd\t" +expect { + -re "^${cmd}ar\\\\ bar.d/ *$" { pass "$test" } + -re /@ { unresolved "$test at prompt" } + -re eof { unresolved "eof" } +} + + +sync_after_int + + +set test "-x with space should complete directories" +set cmd "perl -x fixtures/shared/default/b" +send "$cmd\t" +expect { + -re "^${cmd}ar\\\\ bar.d/ *$" { pass "$test" } + -re /@ { unresolved "$test at prompt" } + -re eof { unresolved "eof" } +} + + +sync_after_int + + +set test "- should complete options" +set options { + -0 -a -c -C -d -D -e -F -h -i -I -l -m -M -n -p -P -s -S -T -u -U -v -V -w -W -x -X +} +assert_complete $options "perl -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/pgrep.exp bash-completion-1.2/test/lib/completions/pgrep.exp --- bash-completion-1.1/test/lib/completions/pgrep.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/pgrep.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pgrep " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/pine.exp bash-completion-1.2/test/lib/completions/pine.exp --- bash-completion-1.1/test/lib/completions/pine.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/pine.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pine " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/ping.exp bash-completion-1.2/test/lib/completions/ping.exp --- bash-completion-1.1/test/lib/completions/ping.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/ping.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ping " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/pkg-config.exp bash-completion-1.2/test/lib/completions/pkg-config.exp --- bash-completion-1.1/test/lib/completions/pkg-config.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/pkg-config.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pkg-config -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/pkg_deinstall.exp bash-completion-1.2/test/lib/completions/pkg_deinstall.exp --- bash-completion-1.1/test/lib/completions/pkg_deinstall.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/pkg_deinstall.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + assert_bash_exec {PKG_DBDIR=fixtures/pkgtools/db} + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +set pkgs [exec bash -c "cd fixtures/pkgtools/db ; compgen -d"] +assert_complete $pkgs "pkg_deinstall " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/pkg_delete.exp bash-completion-1.2/test/lib/completions/pkg_delete.exp --- bash-completion-1.1/test/lib/completions/pkg_delete.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/pkg_delete.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pkg_delete " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/pkg_info.exp bash-completion-1.2/test/lib/completions/pkg_info.exp --- bash-completion-1.1/test/lib/completions/pkg_info.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/pkg_info.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pkg_info " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/pkill.exp bash-completion-1.2/test/lib/completions/pkill.exp --- bash-completion-1.1/test/lib/completions/pkill.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/pkill.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pkill " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/portinstall.exp bash-completion-1.2/test/lib/completions/portinstall.exp --- bash-completion-1.1/test/lib/completions/portinstall.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/portinstall.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + assert_bash_exec {PORTSDIR=fixtures/pkgtools/ports ; sed -e s,PORTSDIR,$PORTSDIR,g $PORTSDIR/INDEX.dist > $PORTSDIR/INDEX ; cp $PORTSDIR/INDEX $PORTSDIR/INDEX-5} + save_env +}; # setup() + + +proc teardown {} { + assert_bash_exec {rm fixtures/pkgtools/ports/INDEX fixtures/pkgtools/ports/INDEX-5} + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete "bash-2.05b.007_6 bash-3.1.17 bash-completion-20060301_2 shells/bash shells/bash-completion shells/bash2" "portinstall " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/portupgrade.exp bash-completion-1.2/test/lib/completions/portupgrade.exp --- bash-completion-1.1/test/lib/completions/portupgrade.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/portupgrade.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,21 @@ +proc setup {} { + assert_bash_exec {PKG_DBDIR=fixtures/pkgtools/db} + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete "a b-c-d" "portupgrade " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/povray.exp bash-completion-1.2/test/lib/completions/povray.exp --- bash-completion-1.1/test/lib/completions/povray.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/povray.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "povray " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/pr.exp bash-completion-1.2/test/lib/completions/pr.exp --- bash-completion-1.1/test/lib/completions/pr.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/pr.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pr " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/psql.exp bash-completion-1.2/test/lib/completions/psql.exp --- bash-completion-1.1/test/lib/completions/psql.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/psql.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "psql -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/ptx.exp bash-completion-1.2/test/lib/completions/ptx.exp --- bash-completion-1.1/test/lib/completions/ptx.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/ptx.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ptx " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/pvchange.exp bash-completion-1.2/test/lib/completions/pvchange.exp --- bash-completion-1.1/test/lib/completions/pvchange.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/pvchange.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pvchange --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/pvcreate.exp bash-completion-1.2/test/lib/completions/pvcreate.exp --- bash-completion-1.1/test/lib/completions/pvcreate.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/pvcreate.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pvcreate --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/pvdisplay.exp bash-completion-1.2/test/lib/completions/pvdisplay.exp --- bash-completion-1.1/test/lib/completions/pvdisplay.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/pvdisplay.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pvdisplay --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/pvmove.exp bash-completion-1.2/test/lib/completions/pvmove.exp --- bash-completion-1.1/test/lib/completions/pvmove.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/pvmove.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pvmove --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/pvremove.exp bash-completion-1.2/test/lib/completions/pvremove.exp --- bash-completion-1.1/test/lib/completions/pvremove.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/pvremove.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pvremove --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/pvscan.exp bash-completion-1.2/test/lib/completions/pvscan.exp --- bash-completion-1.1/test/lib/completions/pvscan.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/pvscan.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pvscan --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/pvs.exp bash-completion-1.2/test/lib/completions/pvs.exp --- bash-completion-1.1/test/lib/completions/pvs.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/pvs.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "pvs --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/python.exp bash-completion-1.2/test/lib/completions/python.exp --- bash-completion-1.1/test/lib/completions/python.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/python.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "python " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/qrunner.exp bash-completion-1.2/test/lib/completions/qrunner.exp --- bash-completion-1.1/test/lib/completions/qrunner.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/qrunner.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "qrunner -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/querybts.exp bash-completion-1.2/test/lib/completions/querybts.exp --- bash-completion-1.1/test/lib/completions/querybts.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/querybts.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "querybts --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/rcsdiff.exp bash-completion-1.2/test/lib/completions/rcsdiff.exp --- bash-completion-1.1/test/lib/completions/rcsdiff.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/rcsdiff.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "rcsdiff " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/rcs.exp bash-completion-1.2/test/lib/completions/rcs.exp --- bash-completion-1.1/test/lib/completions/rcs.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/rcs.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "rcs " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/rdict.exp bash-completion-1.2/test/lib/completions/rdict.exp --- bash-completion-1.1/test/lib/completions/rdict.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/rdict.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "rdict --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/readelf.exp bash-completion-1.2/test/lib/completions/readelf.exp --- bash-completion-1.1/test/lib/completions/readelf.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/readelf.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "readelf --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/readonly.exp bash-completion-1.2/test/lib/completions/readonly.exp --- bash-completion-1.1/test/lib/completions/readonly.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/readonly.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "readonly BASH_ARG" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/remove_members.exp bash-completion-1.2/test/lib/completions/remove_members.exp --- bash-completion-1.1/test/lib/completions/remove_members.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/remove_members.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "remove_members --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/removepkg.exp bash-completion-1.2/test/lib/completions/removepkg.exp --- bash-completion-1.1/test/lib/completions/removepkg.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/removepkg.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "removepkg " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/renice.exp bash-completion-1.2/test/lib/completions/renice.exp --- bash-completion-1.1/test/lib/completions/renice.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/renice.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,42 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +set test "Tab should show complete process ids" + # Try completion +set cmd "renice 1" +send "$cmd\t" +expect { + -re "$cmd\r\n\\d+.*/@$cmd$" { pass "$test" } + -re /@ { unresolved "$test at prompt" } + -re eof { unresolved "eof" } +}; # expect + + +sync_after_int + + +set test "Tab should show complete process group ids" + # Try completion +set cmd "renice -g " +send "$cmd\t" +expect { + -re "$cmd\r\n\\d+.*/@$cmd$" { pass "$test" } + -re /@ { unresolved "$test at prompt" } + -re eof { unresolved "eof" } +}; # expect + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/reportbug.exp bash-completion-1.2/test/lib/completions/reportbug.exp --- bash-completion-1.1/test/lib/completions/reportbug.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/reportbug.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "reportbug --m" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/ri.exp bash-completion-1.2/test/lib/completions/ri.exp --- bash-completion-1.1/test/lib/completions/ri.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/ri.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ri " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/rlog.exp bash-completion-1.2/test/lib/completions/rlog.exp --- bash-completion-1.1/test/lib/completions/rlog.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/rlog.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "rlog " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/rmdir.exp bash-completion-1.2/test/lib/completions/rmdir.exp --- bash-completion-1.1/test/lib/completions/rmdir.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/rmdir.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "rmdir " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/rm.exp bash-completion-1.2/test/lib/completions/rm.exp --- bash-completion-1.1/test/lib/completions/rm.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/rm.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "rm " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/rmlist.exp bash-completion-1.2/test/lib/completions/rmlist.exp --- bash-completion-1.1/test/lib/completions/rmlist.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/rmlist.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "rmlist -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/rpcdebug.exp bash-completion-1.2/test/lib/completions/rpcdebug.exp --- bash-completion-1.1/test/lib/completions/rpcdebug.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/rpcdebug.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "rpcdebug -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/rpm.exp bash-completion-1.2/test/lib/completions/rpm.exp --- bash-completion-1.1/test/lib/completions/rpm.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/rpm.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,29 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "rpm " + + +sync_after_int + + + # Build list of installed packages +if {[assert_exec {rpm -qa --qf=%\{NAME\}\n | sort -u} packages]} { + assert_complete $packages "rpm -q " +}; # if + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/rsync.exp bash-completion-1.2/test/lib/completions/rsync.exp --- bash-completion-1.1/test/lib/completions/rsync.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/rsync.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "rsync " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/rtcwake.exp bash-completion-1.2/test/lib/completions/rtcwake.exp --- bash-completion-1.1/test/lib/completions/rtcwake.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/rtcwake.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "rtcwake " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/sbcl.exp bash-completion-1.2/test/lib/completions/sbcl.exp --- bash-completion-1.1/test/lib/completions/sbcl.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/sbcl.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete {bar "bar bar.d/" foo foo.d/} "sbcl fixtures/shared/default/" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/sbcl-mt.exp bash-completion-1.2/test/lib/completions/sbcl-mt.exp --- bash-completion-1.1/test/lib/completions/sbcl-mt.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/sbcl-mt.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete {bar "bar bar.d/" foo foo.d/} "sbcl-mt fixtures/shared/default/" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/scp.exp bash-completion-1.2/test/lib/completions/scp.exp --- bash-completion-1.1/test/lib/completions/scp.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/scp.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,121 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified { + /BASH_LINENO=/d + /BASH_SOURCE=/d + /OLDPWD=/d + } +}; # teardown() + + +setup + + +set test "Tab should complete remote pwd" +set host bash_completion + + # Retrieving home directory (host_pwd) from ssh-host `bash_completion' + # yields error? +if { + [catch { + exec -- ssh -o "Batchmode yes" -o "ConnectTimeout 1" $host pwd 2>> /dev/null + } host_pwd] +} { + # Yes, retrieving pwd from ssh yields error; reset `host_pwd' + # Indicate host pwd is unknown and test is unsupported + # NOTE: To support this test, set the hostname "bash_completion" + # in `$HOME/.ssh/config' or `/etc/ssh_config' + set host_pwd "" + unsupported $test +}; # if + + + # Try completion +set cmd "scp $host:" +send "$cmd\t" +sync_after_tab +expect { + -re "^$cmd$host_pwd.*$" { pass "$test" } + -re /@ { unresolved "$test at prompt" } +}; # expect + + +sync_after_int + + +set test "Tab should complete known-hosts" + + # Build string list of expected completions + # Get hostnames and give them a colon (:) suffix + # Hosts `gee' and `hus' are defined in ./fixtures/scp/config + # Hosts `doo' and `ike' are defined in ./fixtures/scp/known_hosts +set expected {} +foreach host [get_hosts] { + lappend expected "$host:" +}; # foreach +lappend expected doo: gee: hus: ike: + # Append local filenames +lappend expected config known_hosts "spaced\\ \\ conf" +set dir fixtures/scp +assert_complete_dir $expected "scp -F config " $dir + + +sync_after_int + + +set test "-F without space shouldn't error" + # Try completion +set cmd "scp -F" +send "$cmd\t " +expect { + -re "^${cmd}bash: option requires an argument -- F" { fail "$test" } + -re "^$cmd\r\n.*\r\n/@" { pass "$test" } + -re /@ { unresolved "$test at prompt" } + default { unresolved "$test" } +}; # expect + + +sync_after_int + + +set test "Config file containing space should work" + # Build string list of expected completions + # Get hostnames and give them a colon (:) suffix +set expected {} +foreach host [get_hosts] { + lappend expected "$host:" +}; # foreach + # Hosts `gee', `hus' and `jar' are defined in "./fixtures/scp/spaced conf" + # Hosts `doo' and `ike' are defined in ./fixtures/scp/known_hosts +lappend expected doo: gee: hus: ike: jar: + # Append local filenames +lappend expected config known_hosts "spaced\\ \\ conf" +set dir fixtures/scp +#assert_complete_dir $expected "scp -F 'spaced conf' " $dir +set prompt "/$dir/@" +assert_bash_exec "cd $dir" "" $prompt +set cmd "scp -F 'spaced conf' " +send "$cmd\t" +expect -ex "$cmd\r\n" +if {[match_items [lsort -unique $expected] $test]} { + expect { + -re $prompt { pass "$test" } + -re eof { unresolved "eof" } + }; # expect +} else { + # Expected failure (known bug) because of bash-4 bug in quoted words: + # http://www.mail-archive.com/bug-bash@gnu.org/msg06095.html + if {[lindex $::BASH_VERSINFO 0] >= 4} {xfail "$test"} {fail "$test"} +}; # if +sync_after_int $prompt +assert_bash_exec {cd "$TESTDIR"} + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/screen.exp bash-completion-1.2/test/lib/completions/screen.exp --- bash-completion-1.1/test/lib/completions/screen.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/screen.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,52 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified {/OLDPWD=/d} +}; # teardown() + + +setup + + +assert_complete_any "screen -" + + +sync_after_int + + +set test "-c should complete files/dirs" +set dir fixtures/shared/default +set prompt "/$dir/@" +assert_bash_exec "cd $dir" "" $prompt +set cmd "screen -c " +set expected {bar {bar bar.d} foo {foo.d}} +send "$cmd\t" +expect -ex "$cmd" +expect { + -re "\r\nbar\\s+bar bar.d/\\s+foo\\s+foo.d/" { pass "$test" } + # Directories might not be suffixed with a slash (/). This is because + # _filedir only works if `-o filenames' is in effect, which isn't the + # case for `screen' on bash-3, so an expected failure (xfail) + -re "\r\nbar\\s+bar bar.d\\s+foo\\s+foo.d" { + if {[lindex $::BASH_VERSINFO 0] < 4} {xfail "$test"} {fail "$test"} + } + -re "\r\nbar\\s+bar\\\\ bar.d/\\s+foo\\s+foo.d/" { + # On bash-3, the space in `bar bar.d' is escaped with a backslash + # as a side-effect of emulating `-o filenames'. + if {[lindex $::BASH_VERSINFO 0] <= 3} {pass "$test"} {fail "$test"} + } + -re $prompt { unresolved "$test at prompt" } + default { unresolved "$test" } +}; # expect +sync_after_int $prompt +assert_bash_exec {cd "$TESTDIR"} + + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/sed.exp bash-completion-1.2/test/lib/completions/sed.exp --- bash-completion-1.1/test/lib/completions/sed.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/sed.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +if {[assert_exec {sed --help} "" "" "unsupported"]} { + assert_complete_any "sed --" +}; # if + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/seq.exp bash-completion-1.2/test/lib/completions/seq.exp --- bash-completion-1.1/test/lib/completions/seq.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/seq.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "seq --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/service.exp bash-completion-1.2/test/lib/completions/service.exp --- bash-completion-1.1/test/lib/completions/service.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/service.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "service " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/set.exp bash-completion-1.2/test/lib/completions/set.exp --- bash-completion-1.1/test/lib/completions/set.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/set.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "set no" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/sftp.exp bash-completion-1.2/test/lib/completions/sftp.exp --- bash-completion-1.1/test/lib/completions/sftp.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/sftp.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,77 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified { + /BASH_LINENO=/d + /BASH_SOURCE=/d + /OLDPWD=/d + } +}; # teardown() + + +setup + + + # Build string list of expected completions +set expected [get_hosts] + # Hosts `gee' and `hus' are defined in ./fixtures/sftp/config + # Hosts `doo' and `ike' are defined in ./fixtures/sftp/known_hosts +lappend expected doo gee hus ike +set dir fixtures/scp +assert_complete_dir $expected "sftp -F config " $dir + + +sync_after_int + + +set test "-F without space shouldn't error" + # Try completion +set cmd "sftp -F" +send "$cmd\t " +expect { + -re "^${cmd}bash: option requires an argument -- F" { fail "$test" } + -re "^$cmd\r\n.*\r\n/@" { pass "$test" } + -re /@ { unresolved "$test at prompt" } + default { unresolved "$test" } +}; # expect + + +sync_after_int + + + # Build string list of expected completions + # Get hostnames and give them a colon (:) suffix +set expected [get_hosts] + # Hosts `gee', `hus' and `jar' are defined in "./fixtures/scp/spaced conf" + # Hosts `doo' and `ike' are defined in ./fixtures/scp/known_hosts +lappend expected doo gee hus ike jar +set dir fixtures/sftp +assert_complete_dir $expected "sftp -F spaced\\ \\ conf " $dir + + +sync_after_int + + +set test "-F should complete filename" +set dir fixtures/sftp +set prompt "/$dir/@" +assert_bash_exec "cd $dir" "" $prompt +set cmd "ssh -Fsp" +send "$cmd\t" +expect -ex "$cmd" +expect { + -ex "aced\\ \\ conf" { pass "$test" } + # _filedir works only if `-o filenames' is in effect, which isn't the + # case for `sftp' + -re "aced conf" { xfail "$test" } + -re $prompt { unresolved "$test at prompt" } + default { unresolved "$test" } +}; # expect +sync_after_int $prompt +assert_bash_exec {cd "$TESTDIR"} + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/sha1sum.exp bash-completion-1.2/test/lib/completions/sha1sum.exp --- bash-completion-1.1/test/lib/completions/sha1sum.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/sha1sum.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "sha1sum --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/shar.exp bash-completion-1.2/test/lib/completions/shar.exp --- bash-completion-1.1/test/lib/completions/shar.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/shar.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "shar --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/sitecopy.exp bash-completion-1.2/test/lib/completions/sitecopy.exp --- bash-completion-1.1/test/lib/completions/sitecopy.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/sitecopy.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "sitecopy --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/smartctl.exp bash-completion-1.2/test/lib/completions/smartctl.exp --- bash-completion-1.1/test/lib/completions/smartctl.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/smartctl.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "smartctl --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/snownews.exp bash-completion-1.2/test/lib/completions/snownews.exp --- bash-completion-1.1/test/lib/completions/snownews.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/snownews.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "snownews --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/sort.exp bash-completion-1.2/test/lib/completions/sort.exp --- bash-completion-1.1/test/lib/completions/sort.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/sort.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "sort --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/split.exp bash-completion-1.2/test/lib/completions/split.exp --- bash-completion-1.1/test/lib/completions/split.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/split.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +if {[assert_exec {split --help} "" "" "unsupported"]} { + assert_complete_any "split --" +}; # if + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/spovray.exp bash-completion-1.2/test/lib/completions/spovray.exp --- bash-completion-1.1/test/lib/completions/spovray.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/spovray.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "spovray " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/ssh.exp bash-completion-1.2/test/lib/completions/ssh.exp --- bash-completion-1.1/test/lib/completions/ssh.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/ssh.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,93 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified { + /BASH_LINENO=/d + /BASH_SOURCE=/d + /OLDPWD=/d + } +}; # teardown() + + +setup + + +set test "Tab should complete both commands and hostname" + # Try completion +set dir fixtures/ssh +set prompt "/$dir/@" +assert_bash_exec "cd $dir" "" $prompt +set cmd "ssh -F config ls" +send "$cmd\t" +set expected "^$cmd\r\n.*ls.*ls_known_host.*\r\n$prompt$cmd$" +expect { + -re $expected { pass "$test" } + -re $prompt { unresolved "$test at prompt" } + default { unresolved "$test" } +}; # expect +sync_after_int $prompt +assert_bash_exec {cd "$TESTDIR"} + + +sync_after_int + + +set test "-F without space shouldn't error" + # Try completion +set cmd "ssh -F" +send "$cmd\t " +set expected "^$cmd $" +expect { + -re "^${cmd}bash: option requires an argument -- F" { fail "$test" } + -re "^$cmd\r\n.*\r\n/@" { pass "$test" } + -re /@ { unresolved "$test at prompt" } + default { unresolved "$test" } +}; # expect + + +sync_after_int + + +set test "First argument shouldn't complete with commands" +# NOTE: This test assumes there's a command "bash" and no host named "bash" +set cmd "ssh bas" +assert_complete [get_known_hosts "bas"] $cmd $test + + +sync_after_int + + +set test "First argument should complete partial hostname" +assert_complete_partial [get_hosts] ssh "" $test /@ 20 \ + [list "ltrim_colon_completions"] + + +sync_after_int + + +set test "-F should complete filename" +set dir fixtures/ssh +set prompt "/$dir/@" +assert_bash_exec "cd $dir" "" $prompt +set cmd "ssh -Fsp" +send "$cmd\t" +expect -ex "$cmd" +expect { + -ex "aced\\ \\ conf" { pass "$test" } + # _filedir works only if `-o filenames' is in effect, which isn't the + # case for `ssh' + -re "aced conf" { xfail "$test" } + -re $prompt { unresolved "$test at prompt" } + default { unresolved "$test" } +}; # expect +sync_after_int $prompt +assert_bash_exec {cd "$TESTDIR"} + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/sshmitm.exp bash-completion-1.2/test/lib/completions/sshmitm.exp --- bash-completion-1.1/test/lib/completions/sshmitm.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/sshmitm.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "sshmitm -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/sshow.exp bash-completion-1.2/test/lib/completions/sshow.exp --- bash-completion-1.1/test/lib/completions/sshow.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/sshow.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "sshow -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/strace.exp bash-completion-1.2/test/lib/completions/strace.exp --- bash-completion-1.1/test/lib/completions/strace.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/strace.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "strace -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/strip.exp bash-completion-1.2/test/lib/completions/strip.exp --- bash-completion-1.1/test/lib/completions/strip.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/strip.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "strip --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/sudo.exp bash-completion-1.2/test/lib/completions/sudo.exp --- bash-completion-1.1/test/lib/completions/sudo.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/sudo.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete "fixtures/shared/default/foo.d/" "sudo cd fixtures/shared/default/fo" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/svk.exp bash-completion-1.2/test/lib/completions/svk.exp --- bash-completion-1.1/test/lib/completions/svk.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/svk.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "svk " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/svnadmin.exp bash-completion-1.2/test/lib/completions/svnadmin.exp --- bash-completion-1.1/test/lib/completions/svnadmin.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/svnadmin.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "svnadmin " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/svn.exp bash-completion-1.2/test/lib/completions/svn.exp --- bash-completion-1.1/test/lib/completions/svn.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/svn.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "svn " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/svnlook.exp bash-completion-1.2/test/lib/completions/svnlook.exp --- bash-completion-1.1/test/lib/completions/svnlook.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/svnlook.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "svnlook " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/sync_members.exp bash-completion-1.2/test/lib/completions/sync_members.exp --- bash-completion-1.1/test/lib/completions/sync_members.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/sync_members.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "sync_members --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/sysctl.exp bash-completion-1.2/test/lib/completions/sysctl.exp --- bash-completion-1.1/test/lib/completions/sysctl.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/sysctl.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +if {[assert_exec {sysctl -N -a 2>/dev/null | grep ^kern | sort -u} values]} { + assert_complete $values "sysctl kern" +}; # if + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/tac.exp bash-completion-1.2/test/lib/completions/tac.exp --- bash-completion-1.1/test/lib/completions/tac.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/tac.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "tac --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/tail.exp bash-completion-1.2/test/lib/completions/tail.exp --- bash-completion-1.1/test/lib/completions/tail.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/tail.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +if {[assert_exec {tail --help} "" "" "unsupported"]} { + assert_complete_any "tail --" +}; # if + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/tar.exp bash-completion-1.2/test/lib/completions/tar.exp --- bash-completion-1.1/test/lib/completions/tar.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/tar.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "tar " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/tcpkill.exp bash-completion-1.2/test/lib/completions/tcpkill.exp --- bash-completion-1.1/test/lib/completions/tcpkill.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/tcpkill.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "tcpkill -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/tcpnice.exp bash-completion-1.2/test/lib/completions/tcpnice.exp --- bash-completion-1.1/test/lib/completions/tcpnice.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/tcpnice.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "tcpnice -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/tee.exp bash-completion-1.2/test/lib/completions/tee.exp --- bash-completion-1.1/test/lib/completions/tee.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/tee.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "tee " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/texindex.exp bash-completion-1.2/test/lib/completions/texindex.exp --- bash-completion-1.1/test/lib/completions/texindex.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/texindex.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "texindex --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/tightvncviewer.exp bash-completion-1.2/test/lib/completions/tightvncviewer.exp --- bash-completion-1.1/test/lib/completions/tightvncviewer.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/tightvncviewer.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "tightvncviewer " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/time.exp bash-completion-1.2/test/lib/completions/time.exp --- bash-completion-1.1/test/lib/completions/time.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/time.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "time set" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/touch.exp bash-completion-1.2/test/lib/completions/touch.exp --- bash-completion-1.1/test/lib/completions/touch.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/touch.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +if {[assert_exec {touch --help} "" "" "unsupported"]} { + assert_complete_any "touch --" +}; # if + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/tr.exp bash-completion-1.2/test/lib/completions/tr.exp --- bash-completion-1.1/test/lib/completions/tr.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/tr.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +if {[assert_exec {tr --help} "" "" "unsupported"]} { + assert_complete_any "tr --" +}; # if + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/unace.exp bash-completion-1.2/test/lib/completions/unace.exp --- bash-completion-1.1/test/lib/completions/unace.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/unace.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "unace -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/uname.exp bash-completion-1.2/test/lib/completions/uname.exp --- bash-completion-1.1/test/lib/completions/uname.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/uname.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +if {[assert_exec {uname --help} "" "" "unsupported"]} { + assert_complete_any "uname --" +}; # if + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/unexpand.exp bash-completion-1.2/test/lib/completions/unexpand.exp --- bash-completion-1.1/test/lib/completions/unexpand.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/unexpand.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +if {[assert_exec {unexpand --help} "" "" "unsupported"]} { + assert_complete_any "unexpand --" +}; # if + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/uniq.exp bash-completion-1.2/test/lib/completions/uniq.exp --- bash-completion-1.1/test/lib/completions/uniq.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/uniq.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +if {[assert_exec {uniq --help} "" "" "unsupported"]} { + assert_complete_any "uniq --" +}; # if + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/units.exp bash-completion-1.2/test/lib/completions/units.exp --- bash-completion-1.1/test/lib/completions/units.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/units.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +if {[assert_exec {units --help} "" "" "unsupported"]} { + assert_complete_any "units --" +}; # if + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/unpack200.exp bash-completion-1.2/test/lib/completions/unpack200.exp --- bash-completion-1.1/test/lib/completions/unpack200.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/unpack200.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "unpack200 " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/unrar.exp bash-completion-1.2/test/lib/completions/unrar.exp --- bash-completion-1.1/test/lib/completions/unrar.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/unrar.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "unrar -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/unset.exp bash-completion-1.2/test/lib/completions/unset.exp --- bash-completion-1.1/test/lib/completions/unset.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/unset.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "unset BASH_ARG" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/unshunt.exp bash-completion-1.2/test/lib/completions/unshunt.exp --- bash-completion-1.1/test/lib/completions/unshunt.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/unshunt.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "unshunt -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/update-alternatives.exp bash-completion-1.2/test/lib/completions/update-alternatives.exp --- bash-completion-1.1/test/lib/completions/update-alternatives.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/update-alternatives.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "update-alternatives --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/update-rc.d.exp bash-completion-1.2/test/lib/completions/update-rc.d.exp --- bash-completion-1.1/test/lib/completions/update-rc.d.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/update-rc.d.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "update-rc.d -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/urlsnarf.exp bash-completion-1.2/test/lib/completions/urlsnarf.exp --- bash-completion-1.1/test/lib/completions/urlsnarf.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/urlsnarf.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "urlsnarf -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/vdir.exp bash-completion-1.2/test/lib/completions/vdir.exp --- bash-completion-1.1/test/lib/completions/vdir.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/vdir.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vdir " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/vgcfgbackup.exp bash-completion-1.2/test/lib/completions/vgcfgbackup.exp --- bash-completion-1.1/test/lib/completions/vgcfgbackup.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/vgcfgbackup.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgcfgbackup -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/vgcfgrestore.exp bash-completion-1.2/test/lib/completions/vgcfgrestore.exp --- bash-completion-1.1/test/lib/completions/vgcfgrestore.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/vgcfgrestore.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgcfgrestore -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/vgchange.exp bash-completion-1.2/test/lib/completions/vgchange.exp --- bash-completion-1.1/test/lib/completions/vgchange.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/vgchange.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgchange -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/vgck.exp bash-completion-1.2/test/lib/completions/vgck.exp --- bash-completion-1.1/test/lib/completions/vgck.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/vgck.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgck -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/vgconvert.exp bash-completion-1.2/test/lib/completions/vgconvert.exp --- bash-completion-1.1/test/lib/completions/vgconvert.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/vgconvert.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgconvert -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/vgcreate.exp bash-completion-1.2/test/lib/completions/vgcreate.exp --- bash-completion-1.1/test/lib/completions/vgcreate.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/vgcreate.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgcreate -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/vgdisplay.exp bash-completion-1.2/test/lib/completions/vgdisplay.exp --- bash-completion-1.1/test/lib/completions/vgdisplay.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/vgdisplay.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgdisplay -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/vgexport.exp bash-completion-1.2/test/lib/completions/vgexport.exp --- bash-completion-1.1/test/lib/completions/vgexport.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/vgexport.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgexport -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/vgextend.exp bash-completion-1.2/test/lib/completions/vgextend.exp --- bash-completion-1.1/test/lib/completions/vgextend.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/vgextend.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgextend -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/vgimport.exp bash-completion-1.2/test/lib/completions/vgimport.exp --- bash-completion-1.1/test/lib/completions/vgimport.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/vgimport.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgimport -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/vgmerge.exp bash-completion-1.2/test/lib/completions/vgmerge.exp --- bash-completion-1.1/test/lib/completions/vgmerge.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/vgmerge.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgmerge -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/vgmknodes.exp bash-completion-1.2/test/lib/completions/vgmknodes.exp --- bash-completion-1.1/test/lib/completions/vgmknodes.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/vgmknodes.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgmknodes -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/vgreduce.exp bash-completion-1.2/test/lib/completions/vgreduce.exp --- bash-completion-1.1/test/lib/completions/vgreduce.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/vgreduce.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgreduce -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/vgremove.exp bash-completion-1.2/test/lib/completions/vgremove.exp --- bash-completion-1.1/test/lib/completions/vgremove.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/vgremove.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgremove -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/vgrename.exp bash-completion-1.2/test/lib/completions/vgrename.exp --- bash-completion-1.1/test/lib/completions/vgrename.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/vgrename.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgrename -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/vgscan.exp bash-completion-1.2/test/lib/completions/vgscan.exp --- bash-completion-1.1/test/lib/completions/vgscan.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/vgscan.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgscan -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/vgs.exp bash-completion-1.2/test/lib/completions/vgs.exp --- bash-completion-1.1/test/lib/completions/vgs.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/vgs.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgs -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/vgsplit.exp bash-completion-1.2/test/lib/completions/vgsplit.exp --- bash-completion-1.1/test/lib/completions/vgsplit.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/vgsplit.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "vgsplit -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/vncviewer.exp bash-completion-1.2/test/lib/completions/vncviewer.exp --- bash-completion-1.1/test/lib/completions/vncviewer.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/vncviewer.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified { + /declare -f _vncviewer_bootstrap/d + } +}; # teardown() + + +setup + + +assert_complete_any "vncviewer " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/wc.exp bash-completion-1.2/test/lib/completions/wc.exp --- bash-completion-1.1/test/lib/completions/wc.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/wc.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +if {[assert_exec {wc --help} "" "" "unsupported"]} { + assert_complete_any "wc --" +}; # if + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/webmitm.exp bash-completion-1.2/test/lib/completions/webmitm.exp --- bash-completion-1.1/test/lib/completions/webmitm.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/webmitm.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "webmitm -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/wget.exp bash-completion-1.2/test/lib/completions/wget.exp --- bash-completion-1.1/test/lib/completions/wget.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/wget.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "wget --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/who.exp bash-completion-1.2/test/lib/completions/who.exp --- bash-completion-1.1/test/lib/completions/who.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/who.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,22 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +if {[assert_exec {who --help} "" "" "unsupported"]} { + assert_complete_any "who --" +}; # if + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/withlist.exp bash-completion-1.2/test/lib/completions/withlist.exp --- bash-completion-1.1/test/lib/completions/withlist.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/withlist.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "withlist --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/wol.exp bash-completion-1.2/test/lib/completions/wol.exp --- bash-completion-1.1/test/lib/completions/wol.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/wol.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,29 @@ +proc setup {} { + # See fixtures/shared/bin/{arp,ifconfig} + assert_bash_exec {OLDPATH="$PATH"; PATH="$TESTDIR/fixtures/shared/bin:$PATH";} + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified + assert_bash_exec {PATH="$OLDPATH"; unset -v OLDPATH} +}; # teardown() + + +setup + + +assert_complete "00:00:00:00:00:00 11:11:11:11:11:11 22:22:22:22:22:22 33:33:33:33:33:33" "wol " + + +sync_after_int + + +assert_complete "00:00:00:00:00:00" "wol 00:" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/wtf.exp bash-completion-1.2/test/lib/completions/wtf.exp --- bash-completion-1.1/test/lib/completions/wtf.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/wtf.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "wtf " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/wvdial.exp bash-completion-1.2/test/lib/completions/wvdial.exp --- bash-completion-1.1/test/lib/completions/wvdial.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/wvdial.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "wvdial -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/xhost.exp bash-completion-1.2/test/lib/completions/xhost.exp --- bash-completion-1.1/test/lib/completions/xhost.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/xhost.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,100 @@ +proc setup {} { + assert_bash_exec {HOME=$TESTDIR} + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +set test "Tab should complete hostnames" + # Build string list of hostnames +set hosts {} +foreach h [exec bash -c "compgen -A hostname"] { + lappend hosts $h +}; # foreach +assert_complete $hosts "xhost " $test + + +sync_after_int + + +set test "Tab should complete partial hostname" +# Build string list of hostnames, starting with the character of the first hostname +set hosts {} +set char "" +foreach h [exec bash -c "compgen -A hostname"] { + if {$char == ""} {set char [string range $h 0 0]} + # Only append hostname if starting with $char + if {[string range $h 0 0] == "$char"} { + lappend hosts $h + }; # if +}; # foreach +assert_complete $hosts "xhost $char" $test + + +sync_after_int + + +set test "Tab should complete hostnames prefixed with +" +# Build string list of hostnames, prefixed with plus (+) +set hosts {} +foreach h [exec bash -c "compgen -A hostname"] { + lappend hosts "+$h" +}; # foreach +assert_complete $hosts "xhost \+" $test + + +sync_after_int + + +set test "Tab should complete partial hostname prefixed with +" + # Build string list of hostnames, starting with character of first host. +set hosts {} +foreach h [exec bash -c "compgen -A hostname"] { + if {$char == ""} {set char [string range $h 0 0]} + # Only append hostname if starting with $char + if {[string range $h 0 0] == "$char"} { + lappend hosts "+$h" + }; # if +}; # foreach +assert_complete $hosts "xhost +$char" + + +sync_after_int + + +set test "Tab should complete hostnames prefixed with -" + # Build string list of hostnames, prefix with minus (-) +set hosts {} +foreach h [exec bash -c "compgen -A hostname"] { + lappend hosts "-$h" +}; # foreach +assert_complete $hosts "xhost -" $test + + +sync_after_int + + +set test "Tab should complete partial hostname prefixed with -" + # Build list of hostnames, starting with character of first host +set hosts {} +foreach h [exec bash -c "compgen -A hostname"] { + if {$char == ""} {set char [string range $h 0 0]} + # Only append hostname if starting with $char + if {[string range $h 0 0] == "$char"} { + lappend hosts "-$h" + }; # if +}; # foreach +assert_complete $hosts "xhost -$char" $test + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/xmllint.exp bash-completion-1.2/test/lib/completions/xmllint.exp --- bash-completion-1.1/test/lib/completions/xmllint.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/xmllint.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "xmllint " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/xmlwf.exp bash-completion-1.2/test/lib/completions/xmlwf.exp --- bash-completion-1.1/test/lib/completions/xmlwf.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/xmlwf.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "xmlwf " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/xmms.exp bash-completion-1.2/test/lib/completions/xmms.exp --- bash-completion-1.1/test/lib/completions/xmms.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/xmms.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "xmms --" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/xpovray.exp bash-completion-1.2/test/lib/completions/xpovray.exp --- bash-completion-1.1/test/lib/completions/xpovray.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/xpovray.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "xpovray " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/xrandr.exp bash-completion-1.2/test/lib/completions/xrandr.exp --- bash-completion-1.1/test/lib/completions/xrandr.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/xrandr.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "xrandr " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/xsltproc.exp bash-completion-1.2/test/lib/completions/xsltproc.exp --- bash-completion-1.1/test/lib/completions/xsltproc.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/xsltproc.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "xsltproc " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/xvnc4viewer.exp bash-completion-1.2/test/lib/completions/xvnc4viewer.exp --- bash-completion-1.1/test/lib/completions/xvnc4viewer.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/xvnc4viewer.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,45 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +set test "Tab should complete options" +set options { + -AcceptClipboard -AutoSelect -DebugDelay -display + -DotWhenNoCursor -FullColor -FullColour -FullScreen + -geometry -help -listen -Log + -LowColourLevel -MenuKey -name -Parent + -passwd -PasswordFile -PointerEventInterval -PreferredEncoding + -SendClipboard -SendPrimary -Shared -UseLocalCursor + -via -ViewOnly -WMDecorationHeight -WMDecorationWidth + -ZlibLevel +} +assert_complete $options {vncviewer -} + + +sync_after_int + + +set expected {hextile raw zrle} +assert_complete $expected "xvnc4viewer -PreferredEncoding " + + +sync_after_int + + +set expected {hextile raw zrle} +assert_complete $expected "xvnc4viewer --preferredencoding " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/xz.exp bash-completion-1.2/test/lib/completions/xz.exp --- bash-completion-1.1/test/lib/completions/xz.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/xz.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,33 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "xz " + + +sync_after_int + + +assert_complete "a/ bashcomp.lzma bashcomp.tar.xz bashcomp.tlz bashcomp.xz" \ + "xz -d fixtures/xz/" + + +sync_after_int + + +assert_complete "a/ bashcomp.tar" "xz fixtures/xz/" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/ypcat.exp bash-completion-1.2/test/lib/completions/ypcat.exp --- bash-completion-1.1/test/lib/completions/ypcat.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/ypcat.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ypcat " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/ypmatch.exp bash-completion-1.2/test/lib/completions/ypmatch.exp --- bash-completion-1.1/test/lib/completions/ypmatch.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/ypmatch.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "ypmatch foo " + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/yum-arch.exp bash-completion-1.2/test/lib/completions/yum-arch.exp --- bash-completion-1.1/test/lib/completions/yum-arch.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/yum-arch.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "yum-arch -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/completions/yum.exp bash-completion-1.2/test/lib/completions/yum.exp --- bash-completion-1.1/test/lib/completions/yum.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/completions/yum.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,20 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified +}; # teardown() + + +setup + + +assert_complete_any "yum -" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/lib/library.exp bash-completion-1.2/test/lib/library.exp --- bash-completion-1.1/test/lib/library.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/library.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,908 @@ + # Source `init.tcl' again to restore the `unknown' procedure + # NOTE: DejaGnu has an old `unknown' procedure which unfortunately disables + # tcl auto-loading. +source [file join [info library] init.tcl] +package require textutil::string + + + +# Execute a bash command and make sure the exit status is successful. +# If not, output the error message. +# @param string $cmd Bash command line to execute. If empty string (""), the +# exit status of the previously executed bash command will be +# checked; specify `title' to adorn the error message. +# @param string $title (optional) Command title. If empty, `cmd' is used. +# @param string $prompt (optional) Bash prompt. Default is "/@" +# @param mixed $out (optional) Reference to (tcl) variable to hold output. +# If variable equals -1 (default) the bash command is expected +# to return no output. If variable equals 0, any output +# from the bash command is disregarded. +proc assert_bash_exec {{aCmd ""} {title ""} {prompt /@} {out -1}} { + if {$out != 0 && $out != -1} {upvar $out results} + if {[string length $aCmd] != 0} { + send "$aCmd\r" + expect -ex "$aCmd\r\n" + }; # if + if {[string length $title] == 0} {set title $aCmd} + expect -ex $prompt + set results $expect_out(buffer); # Catch output + # Remove $prompt suffix from output + set results [ + string range $results 0 [ + expr [string length $results] - [string length $prompt] - 1 + ] + ] + if {$out == -1 && [string length $results] > 0} { + if {[info exists multipass_name]} { + fail "ERROR Unexpected output from bash command \"$title\"" + }; # if + send_user "ERROR Unexpected output from bash command \"$title\":\n$results" + }; # if + + set cmd "echo $?" + send "$cmd\r" + expect { + -ex "$cmd\r\n0\r\n$prompt" {} + $prompt { + if {[info exists multipass_name]} { + fail "ERROR executing bash command \"$title\"" + }; # if + send_user "ERROR executing bash command \"$title\"" + } + }; # expect +}; # assert_bash_exec() + + +# Test `type ...' in bash +# Indicate "unsupported" if `type' exits with error status. +# @param string $command Command to locate +proc assert_bash_type {command} { + set test "$command should be available in bash" + set cmd "type $command &> /dev/null && echo -n 0 || echo -n 1" + send "$cmd\r" + expect "$cmd\r\n" + expect { + -ex 0 { set result true } + -ex 1 { set result false; unsupported "$test" } + }; # expect + expect "/@" + return $result +}; # assert_bash_type() + + +# Make sure the expected list is returned by executing the specified command. +# @param list $expected +# @param string $cmd Command given to generate items +# @param string $test (optional) Test title. Default is "$cmd should show completions" +# @param string $prompt (optional) Bash prompt. Default is "/@" +# @param integer $size (optional) Chunk size. Default is 20. +# @result boolean True if successful, False if not +proc assert_bash_list {expected cmd {test ""} {prompt /@} {size 20}} { + if {$test == ""} {set test "$cmd should show expected output"} + if {[llength $expected] == 0} { + assert_no_output $cmd $test $prompt + } else { + send "$cmd\r" + expect -ex "$cmd\r\n" + + if {[match_items $expected $test $prompt $size]} { + expect { + -re $prompt { pass "$test" } + -re eof { unresolved "eof" } + } + } else { + fail "$test" + } + } +} + + +proc assert_bash_list_dir {expected cmd dir {test ""} {prompt /@} {size 20}} { + set prompt "/$dir/@" + assert_bash_exec "cd $dir" "" $prompt + assert_bash_list $expected $cmd $test $prompt $size + sync_after_int $prompt + assert_bash_exec {cd "$TESTDIR"} +}; # assert_bash_list_dir() + + +# Make sure the expected items are returned by TAB-completing the specified +# command. +# @param list $expected Expected completions. +# @param string $cmd Command given to generate items +# @param string $test (optional) Test title. Default is "$cmd should show completions" +# @param string $prompt (optional) Bash prompt. Default is "/@" +# @param integer $size (optional) Chunk size. Default is 20. +# @param string $cword (optional) Last argument of $cmd which is an +# argument-to-complete and to be replaced with the longest common prefix +# of $expected. If empty string (default), `assert_complete' autodetects +# if the last argument is an argument-to-complete by checking if $cmd +# doesn't end with whitespace. Specifying `cword' should only be necessary +# if this autodetection fails, e.g. when the last whitespace is escaped or +# quoted, e.g. "finger foo\ " or "finger 'foo " +# @param list $filters (optional) List of filters to apply to this function to tweak +# the expected completions and argument-to-complete. Possible values: +# - "ltrim_colon_completions" +# @result boolean True if successful, False if not +proc assert_complete {expected cmd {test ""} {prompt /@} {size 20} {cword ""} {filters ""}} { + if {[llength $expected] == 0} { + assert_no_complete $cmd $test + } else { + if {$test == ""} {set test "$cmd should show completions"} + send "$cmd\t" + if {[llength $expected] == 1} { + expect -ex "$cmd" + + if {[lsearch -exact $filters "ltrim_colon_completions"] == -1} { + set cur ""; # Default to empty word to complete on + set words [split_words_bash $cmd] + if {[llength $words] > 1} { + # Assume last word of `$cmd' is word to complete on. + set index [expr [llength $words] - 1] + set cur [lindex $words $index] + }; # if + # Remove second word from beginning of single item $expected + if {[string first $cur $expected] == 0} { + set expected [list [string range $expected [string length $cur] end]] + }; # if + }; # if + } else { + expect -ex "$cmd\r\n" + # Make sure expected items are unique + set expected [lsort -unique $expected] + }; # if + + if {[lsearch -exact $filters "ltrim_colon_completions"] != -1} { + # If partial contains colon (:), remove partial from begin of items + # See also: bash_completion.__ltrim_colon_completions() + _ltrim_colon_completions cword expected + }; # if + + if {[match_items $expected $test $prompt $size]} { + if {[llength $expected] == 1} { + pass "$test" + } else { + # Remove optional (partial) last argument-to-complete from `cmd', + # E.g. "finger test@" becomes "finger" + + if {[lsearch -exact $filters "ltrim_colon_completions"] != -1} { + set cmd2 $cmd + } else { + set cmd2 [_remove_cword_from_cmd $cmd $cword] + }; # if + + # Determine common prefix of completions + set common [::textutil::string::longestCommonPrefixList $expected] + #if {[string length $common] > 0} {set common " $common"} + expect { + -ex "$prompt$cmd2$common" { pass "$test" } + -re $prompt { unresolved "$test at prompt" } + -re eof { unresolved "eof" } + }; # expect + }; # if + } else { + fail "$test" + }; # if + }; # if +}; # assert_complete() + + +# @param string $cmd Command to remove cword from +# @param string $cword (optional) Last argument of $cmd which is an +# argument-to-complete and to be deleted. If empty string (default), +# `_remove_cword_from_cmd' autodetects if the last argument is an +# argument-to-complete by checking if $cmd doesn't end with whitespace. +# Specifying `cword' is only necessary if this autodetection fails, e.g. +# when the last whitespace is escaped or quoted, e.g. "finger foo\ " or +# "finger 'foo " +# @return string Command with cword removed +proc _remove_cword_from_cmd {cmd {cword ""}} { + set cmd2 $cmd + # Is $cword specified? + if {[string length $cword] > 0} { + # Remove $cword from end of $cmd + if {[string last $cword $cmd] == [string length $cmd] - [string length $cword]} { + set cmd2 [string range $cmd 0 [expr [string last $cword $cmd] - 1]] + }; # if + } else { + # No, $cword not specified; + # Check if last argument is really an-argument-to-complete, i.e. + # doesn't end with whitespace. + # NOTE: This check fails if trailing whitespace is escaped or quoted, + # e.g. "finger foo\ " or "finger 'foo ". Specify parameter + # $cword in those cases. + # Is last char whitespace? + if {! [string is space [string range $cmd end end]]} { + # No, last char isn't whitespace; + # Remove argument-to-complete from end of $cmd + set cmd2 [lrange [split $cmd] 0 end-1] + append cmd2 " " + }; # if + }; # if + return $cmd2 +}; # _remove_cword_from_cmd() + + +# Escape regexp special characters +proc _escape_regexp_chars {var} { + upvar $var str + regsub -all {([\^$+*?.|(){}[\]\\])} $str {\\\1} str +} + +# Make sure any completions are returned +proc assert_complete_any {cmd {test ""} {prompt /@}} { + if {$test == ""} {set test "$cmd should show completions"} + send "$cmd\t" + expect -ex "$cmd" + _escape_regexp_chars cmd + expect { + -timeout 1 + # Match completions, multiple words + # NOTE: The `\S*' (zero or more non-whitespace characters) matches a + # longest common prefix of the completions shown. + # E.g. `fmt -' becomes `fmt --' (two dashes) when completing + -re "^\r\n.*$prompt$cmd\\S*$" { pass "$test" } + timeout { + expect { + # Match completion, single word. This word is shown on the + # same line as the command. + -re "^\\w+ $" { pass "$test" } + # Try matching multiple words again, with new timeout + -re "^\r\n.*$prompt$cmd\\S*$" { pass "$test" } + } + } + -re $prompt { unresolved "$test at prompt" } + eof { unresolved "eof" } + }; # expect +}; # assert_complete_any() + + +# Make sure the expected files are returned by TAB-completing the +# specified command in the specified subdirectory. +# @param list $expected +# @param string $cmd Command given to generate items +# @param string $dir Subdirectory to attempt completion in. The directory must be relative from the $TESTDIR and without a trailing slash. E.g. `fixtures/evince' +# @param string $test (optional) Test title. Default is "$cmd should show completions" +# @param string $prompt (optional) Bash prompt. Default is "/@" +# @param integer $size (optional) Chunk size. Default is 20. +# @param string $cword (optional) Last word of $cmd to complete. See: assert_complete() +# @result boolean True if successful, False if not +proc assert_complete_dir {expected cmd dir {test ""} {size 20} {cword ""}} { + set prompt "/$dir/@" + assert_bash_exec "cd $dir" "" $prompt + assert_complete $expected $cmd $test $prompt $size $cword + sync_after_int $prompt + assert_bash_exec {cd "$TESTDIR"} +}; # assert_complete_dir + + + +# Make sure a partial argument is completed. +# A completion is tried with `$partial', or if this is empty, the first +# character of the first item of `$expected'. Only the items from $expected, +# starting with this character are then expected as completions. +# @param list $expected List of all completions. +# @param string $cmd Command given to generate items +# @param string $partial Word to complete +# @param string $test (optional) Test title. Default is "$cmd should show completions" +# @param string $prompt (optional) Bash prompt. Default is "/@" +# @param integer $size (optional) Chunk size. Default is 20. +# @param list $filters (optional) List of filters to apply to this function to tweak +# the expected completions and argument-to-complete. +# @see assert_complete() +# @result boolean True if successful, False if not +proc assert_complete_partial {expected cmd {partial ""} {test ""} {prompt /@} {size 20} {filters ""}} { + if {$test == ""} {set test "$cmd should complete partial argument"} + if {[llength $expected] == 0} { + unresolved "$test" + } else { + set pick {} + # Make sure expected items are unique + set expected [lsort -unique $expected] + foreach item $expected { + if {$partial == ""} {set partial [string range $item 0 0]} + # Only append item if starting with $partial + if {[string range $item 0 [expr [string length $partial] - 1]] == "$partial"} { + lappend pick $item + }; # if + }; # foreach + assert_complete $pick "$cmd $partial" $test $prompt $size $partial $filters + }; # if +}; # assert_complete_partial() + + +# See also: bash_completion._ltrim_colon_completions +proc _ltrim_colon_completions {cword items} { + upvar 1 $cword cword_out + upvar 1 $items items_out + # If word-to-complete contains a colon, + # and bash-version < 4, + # or bash-version >= 4 and COMP_WORDBREAKS contains a colon + if { + [string first : $cword_out] > -1 && ( + [lindex $::BASH_VERSINFO 0] < 4 || + ([lindex $::BASH_VERSINFO 0] >= 4 && [string first ":" $::COMP_WORDBREAKS] > -1) + ) + } { + for {set i 0} {$i < [llength $items_out]} {incr i} { + set item [lindex $items_out $i] + if {[string first $cword_out $item] == 0} { + # Strip colon-prefix + lset items_out $i [string range $item [string length $cword_out] end] + }; # if + }; # for + #set cword_out "" + }; # if +}; # _ltrim_colon_completions() + + +# Make sure the bash environment hasn't changed between now and the last call +# to `save_env()'. +# @param string $sed Sed commands to preprocess diff output. +# Example calls: +# +# # Replace `COMP_PATH=.*' with `COMP_PATH=PATH' +# assert_env_unmodified {s/COMP_PATH=.*/COMP_PATH=PATH/} +# +# # Remove lines containing `OLDPWD=' +# assert_env_unmodified {/OLDPWD=/d} +# +# @param string $file Filename to generate environment save file from. See +# `gen_env_filename()'. +# @param string $diff Expected diff output (after being processed by $sed) +# @see save_env() +proc assert_env_unmodified {{sed ""} {file ""} {diff ""}} { + set test "Environment should not be modified" + _save_env [gen_env_filename $file 2] + + # Prepare sed script + + # Escape special bash characters ("\) + regsub -all {([\"\\])} $sed {\\\1} sed; #"# (fix Vim syntax highlighting) + # Escape newlines + regsub -all {\n} [string trim $sed] "\r\n" sed + + # Prepare diff script + + # If diff is filled, escape newlines and make sure it ends with a newline + if {[string length [string trim $diff]]} { + regsub -all {\n} [string trim $diff] "\r\n" diff + append diff "\r\n" + } else { + set diff "" + }; # if + + # Execute diff + + # NOTE: The dummy argument 'LAST-ARG' sets bash variable $_ (last argument) to + # 'LAST-ARG' so that $_ doesn't mess up the diff (as it would if $_ + # was the (possibly multi-lined) sed script). + set cmd "diff_env \"[gen_env_filename $file 1]\" \"[gen_env_filename $file 2]\" \"$sed\" LAST-ARG" + send "$cmd\r" + expect "LAST-ARG\r\n" + + expect { + -re "^$diff[wd]@$" { pass "$test" } + -re [wd]@ { + fail "$test" + + # Show diff to user + + set diff $expect_out(buffer) + # Remove possible `\r\n[wd]@' from end of diff + if {[string last "\r\n[wd]@" $diff] == [string length $diff] - [string length "\r\n[wd]@"]} { + set diff [string range $diff 0 [expr [string last "\r\n[wd]@" $diff] - 1]] + }; # if + send_user $diff; + } + }; # expect +}; # assert_env_unmodified() + + +# Make sure the specified command executed from within Tcl/Expect. +# Fail the test with status UNSUPPORTED if Tcl fails with error "POSIX/ENOENT +# (No such file or directory)", or with the given Tcl failure status command +# (default "unresolved") if other error occurs. +# NOTE: Further tests are assumed if executing the command is successful. The +# test isn't immediately declared to have PASSED if the command is +# executed successful. +# @param string $command +# @param string $stdout (optional) Reference to variable to hold stdout. +# @param string $test (optional) Test title +# @param string $failcmd (optional, default "unresolved") Failure command +# @see assert_bash_exec() +proc assert_exec {cmd {stdout ''} {test ''} {failcmd "unresolved"}} { + if {$test == ""} {set test "$cmd should execute successfully"} + upvar $stdout results + set status [catch {eval exec $cmd} results] + if {$status == 0} { + set result true + } else { + set result false + # Command not found (POSIX/ENOENT = no such file or directory)? + if {[lindex $::errorCode 0] == "POSIX" && [lindex $::errorCode 1] == "ENOENT"} { + # Yes, command not found; + # Indicate test is unsupported + unsupported "$test" + } else { + $failcmd "$test" + }; # if + }; # if + return $result +}; # assert_exec() + + +# Check that no completion is attempted on a certain command. +# Params: +# @cmd The command to attempt to complete. +# @test Optional parameter with test name. +proc assert_no_complete {{cmd} {test ""}} { + if {[string length $test] == 0} { + set test "$cmd shouldn't complete" + }; # if + + send "$cmd\t" + expect -ex "$cmd" + + # We can't anchor on $, simulate typing a magical string instead. + set endguard "Magic End Guard" + send "$endguard" + expect { + -re "^$endguard$" { pass "$test" } + default { fail "$test" } + timeout { fail "$test" } + }; # expect +}; # assert_no_complete() + + +# Check that no output is generated on a certain command. +# @param string $cmd The command to attempt to complete. +# @param string $test Optional parameter with test name. +# @param string $prompt (optional) Bash prompt. Default is "/@" +proc assert_no_output {{cmd} {test ""} {prompt /@}} { + if {[string length $test] == 0} { + set test "$cmd shouldn't generate output" + } + + send "$cmd\r" + expect -ex "$cmd" + + expect { + -re "^\r\n$prompt$" { pass "$test" } + default { fail "$test" } + timeout { fail "$test" } + } +} + + +# Source/run file with additional tests if completion for the specified command +# is installed in bash. +# @param string $command Command to check completion availability for. +# @param string $file (optional) File to source/run. Default is +# "lib/completions/$cmd.exp". +proc assert_source_completions {command {file ""}} { + if {[is_bash_completion_installed_for $command]} { + if {[string length $file] == 0} { + set file "lib/completions/$command.exp" + } + source $file + } else { + untested $command + } +} + + +# Sort list. +# `exec sort' is used instead of `lsort' to achieve exactly the +# same sort order as in bash. +# @param list $items +# @return list Sort list +proc bash_sort {items} { + return [split [exec sort << [join $items "\n"]] "\n"] +} + + +# Get 'known' hostnames. Looks also in ssh's 'known_hosts' files. +# @param string cword (optional) Word, hosts should start with. +# @return list Hostnames +# @see get_hosts() +proc get_known_hosts {{cword ''}} { + assert_bash_exec "_known_hosts_real '$cword'; echo_array COMPREPLY" \ + {} /@ result + return $result +}; # get_known_hosts() + + +# Get hostnames +# @return list Hostnames +# @see get_known_hosts() +proc get_hosts {} { + set hosts [exec bash -c "compgen -A hostname"] + # NOTE: Circumventing var `avahi_hosts' and appending directly to `hosts' + # causes an empty element to be inserted in `hosts'. + # -- FVu, Fri Jul 17 23:11:46 CEST 2009 + set avahi_hosts [get_hosts_avahi] + if {[llength $avahi_hosts] > 0} { + lappend hosts $avahi_hosts + }; # if + return $hosts +}; # get_hosts() + + +# Get hostnames according to avahi +# @return list Hostnames +proc get_hosts_avahi {} { + # Retrieving hosts is successful? + if { [catch {exec bash -c { + type avahi-browse >&/dev/null \ + && avahi-browse -cpr _workstation._tcp 2>/dev/null | command grep ^= | cut -d\; -f7 | sort -u + }} hosts] } { + # No, retrieving hosts yields error; + # Reset hosts + set hosts {} + }; # if + return $hosts +}; # get_hosts_avahi() + + +# Get signals +# This function is written in analogy to the bash function `_signals()' in +# `bash_completion'. +# @return list Signals starting with `SIG', but with the `SIG' prefix removed. +proc get_signals {} { + set signals {} + foreach signal [exec bash -c {compgen -A signal}] { + # Does signal start with `SIG'? + if {[string range $signal 0 [expr [string length "SIG"] - 1]] == "SIG"} { + # Remove `SIG' prefix + set signal [string range $signal 3 end] + # Add signal (with dash (-) prefix) to list + lappend signals -$signal + }; # if + }; # foreach + return $signals +}; # get_signals() + + +# Initialize tcl globals with bash variables +proc init_tcl_bash_globals {} { + global BASH_VERSINFO BASH_VERSION COMP_WORDBREAKS + assert_bash_exec {printf "%s" "$COMP_WORDBREAKS"} {} /@ COMP_WORDBREAKS + assert_bash_exec {printf "%s " "${BASH_VERSINFO[@]}"} "" /@ BASH_VERSINFO + set BASH_VERSINFO [eval list $BASH_VERSINFO] + assert_bash_exec {printf "%s" "$BASH_VERSION"} "" /@ BASH_VERSION + assert_bash_exec {printf "%s" "$TESTDIR"} "" /@ TESTDIR +}; # init_tcl_bash_globals() + + +# Check whether completion is installed for the specified command by executing +# `complete -p ...' in bash. +# @param string $command Command to check completion availability for. +# @return boolean True (1) if completion is installed, False (0) if not. +proc is_bash_completion_installed_for {command} { + set test "$command should have completion installed in bash" + set cmd "complete -p $command &> /dev/null && echo -n 0 || echo -n 1" + send "$cmd\r" + expect "$cmd\r\n" + expect { + -ex 0 { set result true } + -ex 1 { set result false } + } + expect "/@" + return $result +}; # is_bash_completion_installed_for() + + +# Detect if test suite is running under Cygwin/Windows +proc is_cygwin {} { + expr {[string first [string tolower [exec uname -s]] cygwin] >= 0} +}; # is_cygwin() + + +# Expect items. +# Break items into chunks because `expect' seems to have a limited buffer size +# @param list $items +# @param integer $size Chunk size +# @result boolean True if successful, False if not +proc match_items {items test {prompt /@} {size 20}} { + set items [bash_sort $items] + set result false + for {set i 0} {$i < [llength $items]} {set i [expr {$i + $size}]} { + # For chunks > 1, allow leading whitespace + if {$i > $size} { set expected "\\s*" } else { set expected "" } + for {set j 0} {$j < $size && $i + $j < [llength $items]} {incr j} { + set item "[lindex $items [expr {$i + $j}]]" + _escape_regexp_chars item + append expected $item + if {[llength $items] > 1} {append expected {\s+}}; + }; # for + if {[llength $items] == 1} { + expect { + -re "^$expected\r\n$" { set result true } + # NOTE: The optional space ( ?) depends on whether -o nospace is active + -re "^$expected ?$" { set result true } + -re "^$prompt$" {set result false; break } + "\r\n" { set result false; break } + default { set result false; break } + timeout { set result false; break } + }; # expect + } else { + expect { + -re "^$expected" { set result true } + default { set result false; break } + timeout { set result false; break } + }; # expect + }; # if + }; # for + return $result +}; # match_items() + + + +# Get real command. +# - arg: $1 Command +# - return: Command found, empty string if not found +proc realcommand {cmd} { + set result "" + if [string length [set path [auto_execok $cmd]]] { + if {[string length [auto_execok realpath]]} { + set result [exec realpath $path] + } elseif {[string length [auto_execok readlink]]} { + set result [exec readlink -f $path] + } else { + set result $path + }; # if + }; # if + return $result +}; # realcommand() + + +# Generate filename to save environment to. +# @param string $file File-basename to save environment to. If the file has a +# `.exp' suffix, it is removed. E.g.: +# - "file.exp" becomes "file.env1~" +# - "" becomes "env.env1~" +# - "filename" becomes "filename.env1~" +# The file will be stored in the $TESTDIR/tmp directory. +# @param integer $seq Sequence number. Must be either 1 or 2. +proc gen_env_filename {{file ""} {seq 1}} { + if {[string length $file] == 0} { + set file "env" + } else { + # Remove possible directories + set file [file tail $file] + # Remove possible '.exp' suffix from filename + if {[string last ".exp" $file] == [string length $file] - [string length ".exp"]} { + set file [string range $file 0 [expr [string last ".exp" $file] - 1]] + }; # if + }; # if + return "\$TESTDIR/tmp/$file.env$seq~" +}; # gen_env_filename() + + +# Save the environment for later comparison +# @param string $file Filename to generate environment save file from. See +# `gen_env_filename()'. +proc save_env {{file ""}} { + _save_env [gen_env_filename $file 1] +}; # save_env() + + +# Save the environment for later comparison +# @param string File to save the environment to. Default is "$TESTDIR/tmp/env1~". +# @see assert_env_unmodified() +proc _save_env {{file ""}} { + assert_bash_exec "{ set; declare -F; shopt -p; } > \"$file\"" +}; # _save_env() + + +# Source bash_completion package +proc source_bash_completion {} { + assert_bash_exec {BASH_COMPLETION_DIR=$(cd "$TESTDIR/.."; pwd)/contrib} + assert_bash_exec {BASH_COMPLETION_COMPAT_DIR=$BASH_COMPLETION_DIR} + assert_bash_exec {BASH_COMPLETION=$(cd "$TESTDIR/.."; pwd)/bash_completion} + assert_bash_exec {source "$BASH_COMPLETION"} +}; # source_bash_completion() + + +# Split line into words, disregarding backslash escapes (e.g. \b (backspace), +# \g (bell)), but taking backslashed spaces into account. +# Aimed for simulating bash word splitting. +# Example usage: +# +# % set a {f cd\ \be} +# % split_words $a +# f {cd\ \be} +# +# @param string Line to split +# @return list Words +proc split_words_bash {line} { + set words {} + set glue false + foreach part [split $line] { + set glue_next false + # Does `part' end with a backslash (\)? + if {[string last "\\" $part] == [string length $part] - [string length "\\"]} { + # Remove end backslash + set part [string range $part 0 [expr [string length $part] - [string length "\\"] - 1]] + # Indicate glue on next run + set glue_next true + }; # if + # Must `part' be appended to latest word (= glue)? + if {[llength $words] > 0 && [string is true $glue]} { + # Yes, join `part' to latest word; + set zz [lindex $words [expr [llength $words] - 1]] + # Separate glue with backslash-space (\ ); + lset words [expr [llength $words] - 1] "$zz\\ $part" + } else { + # No, don't append word to latest word; + # Append `part' as separate word + lappend words $part + }; # if + set glue $glue_next + }; # foreach + return $words +}; # split_words_bash() + + +# Given a list of items this proc finds a (part, full) pair so that when +# completing from $part $full will be the only option. +# +# Arguments: +# list The list of full completions. +# partName Output parameter for the partial string. +# fullName Output parameter for the full string, member of item. +# +# Results: +# 1, or 0 if no suitable result was found. +proc find_unique_completion_pair {{list} {partName} {fullName}} { + upvar $partName part + upvar $fullName full + set bestscore 0 + set list [lsort $list] + set n [llength $list] + for {set i 0} {$i < $n} {incr i} { + set cur [lindex $list $i] + set curlen [string length $cur] + + set prev [lindex $list [expr {$i - 1}]] + set next [lindex $list [expr {$i + 1}]] + set diffprev [expr {$prev == ""}] + set diffnext [expr {$next == ""}] + + # Analyse each item of the list and look for the minimum length of the + # partial prefix which is distinct from both $next and $prev. The list + # is sorted so the prefix will be unique in the entire list. + # + # In the worst case we analyse every character in the list 3 times. + # That's actually very fast, sorting could take more. + for {set j 0} {$j < $curlen} {incr j} { + set curchar [string index $cur $j] + if {!$diffprev && [string index $prev $j] != $curchar} { + set diffprev 1 + } + if {!$diffnext && [string index $next $j] != $curchar} { + set diffnext 1 + } + if {$diffnext && $diffprev} { + break + } + } + + # At the end of the loop $j is the index of last character of + # the unique partial prefix. The length is one plus that. + set parlen [expr {$j + 1}] + if {$parlen >= $curlen} { + continue + } + + # Try to find the most "readable pair"; look for a long pair where + # $part is about half of $full. + if {$parlen < $curlen / 2} { + set parlen [expr {$curlen / 2}] + } + set score [expr {$curlen - $parlen}] + if {$score > $bestscore} { + set bestscore $score + set part [string range $cur 0 [expr {$parlen - 1}]] + set full $cur + } + } + return [expr {$bestscore != 0}] +} + + +# Start bash running as test environment. +proc start_bash {} { + global TESTDIR TOOL_EXECUTABLE spawn_id + set TESTDIR [pwd] + # If `--tool_exec' option not specified, use "bash" + if {! [info exists TOOL_EXECUTABLE]} {set TOOL_EXECUTABLE bash} + exp_spawn $TOOL_EXECUTABLE --rcfile config/bashrc + assert_bash_exec {} "$TOOL_EXECUTABLE --rcfile config/bashrc" + # Bash < 3.2.41 has a bug where 'history' disappears from SHELLOPTS + # whenever a shopt setting is sourced or eval'ed. Disabling 'history' + # makes it not show in tests "Environment should not be modified" + # for bash < 3.2.41. + # -- FVu, Tue Sep 15 22:52:00 CEST 2009 + assert_bash_exec {is_bash_version_minimal 3 2 41 || set +o history} +}; # start_bash() + + +# Redirect xtrace output to a file. +# +# 'set -x' can be very useful for debugging but by default it writes to +# stderr. Bash 4.1 has a feature to redirect this output to a random FD. +# +# This function uses file descriptor 6. This will break if any completion +# tries to use the same descriptor. +proc init_bash_xtrace {{fname xtrace.log}} { + global BASH_VERSINFO + if {([lindex $BASH_VERSINFO 0] == 4 && [lindex $BASH_VERSINFO 1] < 1) || + [lindex $BASH_VERSINFO 0] < 4} { + note "BASH_XTRACEFD not available in this version; no xtrace.log" + return + } + verbose "Enabling bash xtrace output to '$fname'" + assert_bash_exec "exec 6>'$fname'" + assert_bash_exec "BASH_XTRACEFD=6" + assert_bash_exec "set -o xtrace" +} + + +# Setup test environment +# +# Common initialization for unit and completion tests. +proc start_interactive_test {} { + start_bash + source_bash_completion + init_tcl_bash_globals + + global OPT_BASH_XTRACE + if {[info exists OPT_BASH_XTRACE]} { + init_bash_xtrace + } + global OPT_TIMEOUT + if {[info exists OPT_TIMEOUT]} { + global timeout + verbose "Changing default expect timeout from $timeout to $OPT_TIMEOUT" + set timeout $OPT_TIMEOUT + } +} + + +# Interrupt completion and sync with prompt. +# Send signals QUIT & INT. +# @param string $prompt (optional) Bash prompt. Default is "/@" +proc sync_after_int {{prompt /@}} { + set test "Sync after INT" + sleep .1 + send \031\003; # QUIT/INT + # Wait to allow bash to become ready + # See also: http://lists.alioth.debian.org/pipermail/bash-completion-devel/ + # 2010-February/002566.html + sleep .1 + # NOTE: Regexp `.*' causes `expect' to discard previous unknown output. + # This is necessary if a completion doesn't match expectations. + # For instance with `filetype_xspec' completion (e.g. `kdvi') if + # one expects `.txt' as a completion (wrong, because it isn't + # there), the unmatched completions need to be cleaned up. + expect -re ".*$prompt$" +} + + +proc sync_after_tab {} { + # NOTE: Wait in case completion returns nothing - because `units' isn't + # installed, so that "^$cdm.*$" doesn't match too early - before + # comp_install has finished + sleep .4 +}; # sync_after_tab() + + +# Return current working directory with `TESTDIR' stripped +# @return string Working directory. E.g. /, or /fixtures/ +proc wd {} { + global TESTDIR + # Remove `$TESTDIR' prefix from current working directory + set wd [string replace [pwd] 0 [expr [string length $TESTDIR] - 1]]/ +}; # wd() diff -Nru bash-completion-1.1/test/lib/library.sh bash-completion-1.2/test/lib/library.sh --- bash-completion-1.1/test/lib/library.sh 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/library.sh 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,75 @@ +# Bash library for bash-completion DejaGnu testsuite + + +# @param $1 Char to add to $COMP_WORDBREAKS +# @see remove_comp_wordbreak_char() +add_comp_wordbreak_char() { + if [ ${BASH_VERSINFO[0]} -ge 4 ]; then + [[ "${COMP_WORDBREAKS//[^$1]}" ]] || COMP_WORDBREAKS=$COMP_WORDBREAKS$1 + fi +} # add_comp_wordbreak_char() + + +# Diff environment files to detect if environment is unmodified +# @param $1 File 1 +# @param $2 File 2 +# @param $3 Additional sed script +diff_env() { + diff "$1" "$2" | sed -e " +# Remove diff line indicators + /^[0-9,]\{1,\}[acd]/d +# Remove diff block separators + /---/d +# Remove underscore variable + /[<>] _=/d +# Remove PPID bash variable + /[<>] PPID=/d + $3" +} # diff_env() + + +# Output array elements, sorted and separated by newline +# Unset variable after outputting. +# @param $1 Name of array variable to process +echo_array() { + local name=$1[@] + printf "%s\n" "${!name}" | sort +} # echo_array() + + +# Check if current bash version meets specified minimum +# @param $1 (integer) Major version number +# @param $2 (integer) Minor version number +# @param $3 (integer) Patch level +# @return 0 if success, > 0 if not +is_bash_version_minimal() { + [[ ( + ${BASH_VERSINFO[0]} -gt $1 + ) || ( + ${BASH_VERSINFO[0]} -eq $1 && + ${BASH_VERSINFO[1]} -gt $2 + ) || ( + ${BASH_VERSINFO[0]} -eq $1 && + ${BASH_VERSINFO[1]} -eq $2 && + ${BASH_VERSINFO[2]} -ge $3 + ) + ]] +} # is_bash_version_minimal() + + +# @param $1 Char to remove from $COMP_WORDBREAKS +# @see add_comp_wordbreak_char() +remove_comp_wordbreak_char() { + if [ ${BASH_VERSINFO[0]} -ge 4 ]; then + COMP_WORDBREAKS=${COMP_WORDBREAKS//$1} + fi +} # remove_comp_wordbreak_char() + + +# Local variables: +# mode: shell-script +# sh-basic-offset: 4 +# sh-indent-comment: t +# indent-tabs-mode: nil +# End: +# ex: ts=4 sw=4 et filetype=sh diff -Nru bash-completion-1.1/test/lib/unit.exp bash-completion-1.2/test/lib/unit.exp --- bash-completion-1.1/test/lib/unit.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/lib/unit.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,17 @@ +source lib/library.exp + + +proc unit_exit {} { + # Exit bash + send "\rexit\r" +} + + +proc unit_start {} { + start_interactive_test +} + + +proc unit_version {} { + puts "$::TESTDIR, bash-$::BASH_VERSION" +} diff -Nru bash-completion-1.1/test/Makefile.am bash-completion-1.2/test/Makefile.am --- bash-completion-1.1/test/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/Makefile.am 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,8 @@ +DEJATOOL = completion install unit +AM_RUNTESTFLAGS = --outdir log + +EXTRA_DIST = completion \ + config \ + fixtures \ + lib \ + unit diff -Nru bash-completion-1.1/test/Makefile.in bash-completion-1.2/test/Makefile.in --- bash-completion-1.1/test/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/Makefile.in 2010-06-16 16:45:23.000000000 +0100 @@ -0,0 +1,343 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +subdir = test +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +SOURCES = +DIST_SOURCES = +RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir +EXPECT = expect +RUNTEST = runtest +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +am__leading_dot = @am__leading_dot@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build_alias = @build_alias@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host_alias = @host_alias@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +DEJATOOL = completion install unit +AM_RUNTESTFLAGS = --outdir log +EXTRA_DIST = completion \ + config \ + fixtures \ + lib \ + unit + +all: all-am + +.SUFFIXES: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign test/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +check-DEJAGNU: site.exp + srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \ + EXPECT=$(EXPECT); export EXPECT; \ + runtest=$(RUNTEST); \ + if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \ + exit_status=0; l='$(DEJATOOL)'; for tool in $$l; do \ + if $$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \ + then :; else exit_status=1; fi; \ + done; \ + else echo "WARNING: could not find \`runtest'" 1>&2; :;\ + fi; \ + exit $$exit_status +site.exp: Makefile + @echo 'Making a new site.exp file...' + @echo '## these variables are automatically generated by make ##' >site.tmp + @echo '# Do not edit here. If you wish to override these values' >>site.tmp + @echo '# edit the last section' >>site.tmp + @echo 'set srcdir $(srcdir)' >>site.tmp + @echo "set objdir `pwd`" >>site.tmp + @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp + @test ! -f site.exp || \ + sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp + @-rm -f site.bak + @test ! -f site.exp || mv site.exp site.bak + @mv site.tmp site.exp + +distclean-DEJAGNU: + -rm -f site.exp site.bak + -l='$(DEJATOOL)'; for tool in $$l; do \ + rm -f $$tool.sum $$tool.log; \ + done + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-DEJAGNU distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: check-am install-am install-strip + +.PHONY: all all-am check check-DEJAGNU check-am clean clean-generic \ + distclean distclean-DEJAGNU distclean-generic distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff -Nru bash-completion-1.1/test/unit/compgen.exp bash-completion-1.2/test/unit/compgen.exp --- bash-completion-1.1/test/unit/compgen.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/unit/compgen.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,52 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified {/OLDPWD/d} +}; # teardown() + + +setup + + +if {[lindex $::BASH_VERSINFO 0] <= 3} { + set test {compgen -f a\\\\\\\'b/ on bash-3 should return a\'b/c}; + set cmd {compgen -f a\\\\\\\'b/} +} else { + set test {compgen -f a\\\'b/ on bash-4 should return a\'b/c}; + set cmd {compgen -f a\\\'b/} +}; # if +set dir fixtures/compgen +set prompt "/$dir/@" +assert_bash_exec "cd $dir" "" $prompt +send "$cmd\r" +expect -ex "$cmd\r\n" +expect { + -re {a\\\'b/c} { + # On bash-3.2, compgen returns inconsequent output + if { + [lindex $::BASH_VERSINFO 0] >= 4 || ( + [lindex $::BASH_VERSINFO 0] == 3 && + [lindex $::BASH_VERSINFO 1] == 2 + ) + } {pass $test} else {fail $test} + } + -re {a'b/c} { + if {[lindex $::BASH_VERSINFO 0] <= 3 } \ + {pass $test} else {fail $test} + } + -re $prompt { pass "$test" } + -re eof { unresolved "eof" } +}; # expect +sync_after_int $prompt +assert_bash_exec {cd "$TESTDIR"} + +#assert_bash_list_dir {a\\\'b/c} $cmd fixtures/compgen + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/unit/_count_args.exp bash-completion-1.2/test/unit/_count_args.exp --- bash-completion-1.1/test/unit/_count_args.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/unit/_count_args.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,68 @@ +proc setup {} { + assert_bash_exec {unset COMP_CWORD COMP_LINE COMP_POINT COMP_WORDS} + save_env +}; # setup() + + +proc teardown {} { + assert_bash_exec {unset args COMP_CWORD COMP_LINE COMP_POINT COMP_WORDS} + # Delete 'COMP_WORDBREAKS' occupying two lines + assert_env_unmodified { + /COMP_WORDBREAKS=/{N + d + } + } +}; # teardown() + + +setup + + +set test "_count_args should run without errors" +assert_bash_exec {_count_args > /dev/null} $test + + +sync_after_int + + +set test "a b| should set args to 1"; # | = cursor position +set cmd {COMP_WORDS=(a b); COMP_CWORD=1; COMP_LINE='a b'; COMP_POINT=3; _count_args; echo -n $args} +assert_bash_list 1 $cmd $test + + +sync_after_int + + +set test "a b|c should set args to 1"; # | = cursor position +set cmd {COMP_WORDS=(a bc); COMP_CWORD=1; COMP_LINE='a bc'; COMP_POINT=3; _count_args; echo -n $args} +assert_bash_list 1 $cmd $test + + +sync_after_int + + +set test "a b c| should set args to 2"; # | = cursor position +set cmd {COMP_WORDS=(a b c); COMP_CWORD=2; COMP_LINE='a b c'; COMP_POINT=4; _count_args; echo -n $args} +assert_bash_list 2 $cmd $test + + +sync_after_int + + +set test "a b| c should set args to 1"; # | = cursor position +set cmd {COMP_WORDS=(a b c); COMP_CWORD=1; COMP_LINE='a b c'; COMP_POINT=3; _count_args; echo -n $args} +assert_bash_list 1 $cmd $test + + +sync_after_int + + +set test "a b -c| d should set args to 2"; # | = cursor position +set cmd {COMP_WORDS=(a b -c d); COMP_CWORD=2; COMP_LINE='a b -c d'; COMP_POINT=6; _count_args; echo -n $args} +assert_bash_list 2 $cmd $test + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/unit/__expand_tilde_by_ref.exp bash-completion-1.2/test/unit/__expand_tilde_by_ref.exp --- bash-completion-1.1/test/unit/__expand_tilde_by_ref.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/unit/__expand_tilde_by_ref.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,87 @@ +# @param string $out Reference to variable to hold value of bash environment +# variable $HOME. +proc setup {home user} { + upvar $home _home + upvar $user _user + save_env + assert_bash_exec {echo "$HOME"} {} /@ _home + set _home [string trim $_home] + assert_bash_exec {echo "$USER"} {} /@ _user + set _user [string trim $_user] +}; # setup() + + +proc teardown {} { + assert_env_unmodified { + /var=/d + } +}; # teardown() + + +setup home user + + +set test "function should run without errors" +assert_bash_exec {__expand_tilde_by_ref > /dev/null} $test + + +sync_after_int + + +set test "function should not pollute environment" +# NOTE: A possible environment pollution is detected by assert_env_modified() in teardown() +assert_bash_exec {foo() { local aa="~"; __expand_tilde_by_ref aa; }; foo; unset foo} $test + + +sync_after_int + + +set test "~user should return /home/user" +set cmd [format {var="~%s"; __expand_tilde_by_ref var; printf "%%s" "$var"} $user] +assert_bash_list "$home" $cmd $test + + +sync_after_int + + +set test "~/foo should return /home/user/foo" +set cmd {var='~/foo'; __expand_tilde_by_ref var; printf "%s" "$var"} +assert_bash_list "$home/foo" $cmd $test + + +sync_after_int + + +set test "~user/bar should return /home/user/bar" +set cmd [format {var="~%s/bar"; __expand_tilde_by_ref var; printf "%%s" "$var"} $user] +assert_bash_list "$home/bar" $cmd $test + + +sync_after_int + + +set test "~user/\$HOME should return /home/user/\$HOME" +set cmd [format {var="~%s/\$HOME"; __expand_tilde_by_ref var; printf "%%s" "$var"} $user] +assert_bash_list "$home/\$HOME" $cmd $test + + +sync_after_int + + +set test "'~user/a b' should return '/home/user/a b'" +set cmd [format {var="~%s/a b"; __expand_tilde_by_ref var; printf "%%s" "$var"} $user] +assert_bash_list [list [format {%s/a b} $home]] $cmd $test + + +sync_after_int + + +set test "~user/* should return /home/user/*" +set cmd [format {var="~%s/*"; __expand_tilde_by_ref var; printf "%%s" "$var"} $user] +assert_bash_list "$home/\*" $cmd $test + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/unit/_filedir.exp bash-completion-1.2/test/unit/_filedir.exp --- bash-completion-1.1/test/unit/_filedir.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/unit/_filedir.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,267 @@ +proc setup {} { + assert_bash_exec {unset COMPREPLY cur} + assert_bash_exec {unset -f _f} + save_env + # Declare bash completion function `_f' + assert_bash_exec { \ + _f() { local cur=$(_get_cword); unset COMPREPLY; _filedir; }; \ + complete -F _f f \ + } + # Declare bash completion function `_f2' with `-o filenames' active. + assert_bash_exec { \ + complete -F _f -o filenames f2 \ + } + # Declare bash completion function `_g' to complete on `.e1' files + assert_bash_exec { \ + _g() { local cur=$(_get_cword); unset COMPREPLY; _filedir e1; }; \ + complete -F _g g \ + } + # Create directories `a*b' and `a\b' only when not running on Cygwin/Windows; + # directories containing `*' or `\' aren't allowed on Cygwin/Windows + if {! [is_cygwin]} { + # Create directory `a*b' + assert_bash_exec {(cd fixtures/_filedir && [ ! -d a\*b ] && mkdir a\*b && touch a\*b/j || true)} + # Create directory `a\b' + assert_bash_exec {(cd fixtures/_filedir && [ ! -d a\\b ] && mkdir a\\b && touch a\\b/g || true)} + } +} + + +proc teardown {} { + if {! [is_cygwin]} { + assert_bash_exec {(cd fixtures/_filedir && rm -- a\\b/g && rmdir a\\b/ || true)} + assert_bash_exec {(cd fixtures/_filedir && rm -- a\*b/j && rmdir a\*b/ || true)} + } + assert_bash_exec {unset COMPREPLY cur} + assert_bash_exec {unset -f _f _g} + assert_bash_exec {complete -r f g} + assert_env_unmodified { + /OLDPWD/d + /OLD_CTYPE/d + } +} + + +setup + + +set test "_filedir should run without errors" +assert_bash_exec {_filedir > /dev/null} $test + + +sync_after_int + + +foreach name {f f2} { + + set test "completing $name ab/ should return e" + set cmd "$name ab/" + assert_complete_dir e $cmd "fixtures/_filedir" $test + + + sync_after_int + + + set test "completing $name a\\ b/ should return i" + set cmd "$name a\\ b/" + assert_complete_dir i $cmd "fixtures/_filedir" $test + + + sync_after_int + + + set test "completing $name a\\\'b/ should return c" + set cmd "$name a\\\'b/" + assert_complete_dir c $cmd "fixtures/_filedir" $test + + + sync_after_int + + + set test "completing $name a\\\"b/ should return d"; #" + set cmd "$name a\\\"b/"; #" + assert_complete_dir d $cmd "fixtures/_filedir" $test + + + sync_after_int + + + set test "completing $name a\\\$b/ should return h" + set cmd "$name a\\\$b/" + assert_complete_dir "\b\b\b\b\b$::TESTDIR/fixtures/_filedir/a\\\\\$b/h" \ + $cmd "fixtures/_filedir" $test + + + sync_after_int + + + # Execute these tests only when not running on Cygwin/Windows, because + # directories containing asterisk (*) or backslash (\) aren't allowed on + # Cygwin/Windows + if {! [is_cygwin]} { + set test "completing $name a\\\\b/ should return g" + set cmd "$name a\\\\b/" + assert_complete_dir g $cmd "fixtures/_filedir" $test + + + sync_after_int + } + + + set test "completing $name a\\&b/ should return f" + set cmd "$name a\\&b/" + assert_complete_dir f $cmd "fixtures/_filedir" $test + + + sync_after_int + + + set test "completing $name a\$ should return a\\\$b/" + set cmd "$name a\$" + assert_complete_dir "\b\\\\\$b/" $cmd "fixtures/_filedir" $test + + + sync_after_int + + + # NOTE: Bash versions 4.0.0 up to 4.0.34 contain a bug when completing quoted + # words, so tests below aren't executed for these bash versions. + if {! ( + [lindex $::BASH_VERSINFO 0] == 4 && + [lindex $::BASH_VERSINFO 1] == 0 && + [lindex $::BASH_VERSINFO 2] < 35 + )} { + set cmd "$name 'ab/" + assert_complete_dir {e'} $cmd "fixtures/_filedir" + + + sync_after_int + + + set cmd "$name 'a b/" + assert_complete_dir {i'} $cmd "fixtures/_filedir" + + + sync_after_int + + + set cmd "$name 'a\"b/"; #" + assert_complete_dir {d'} $cmd "fixtures/_filedir" + + + sync_after_int + + + set cmd "$name 'a\$b/" + if {[lindex $::BASH_VERSINFO 0] == 4} { + assert_complete_dir {h'} $cmd "fixtures/_filedir" + } else { + assert_complete_dir "\b\b\b\b$::TESTDIR/fixtures/_filedir/a\$b/h'" $cmd "fixtures/_filedir" + } + + + sync_after_int + + + # Execute these tests only when not running on Cygwin/Windows, because + # directories containing `*' or `\' aren't allowed on Cygwin/Windows + if {! [is_cygwin]} { + set cmd "$name 'a\\b/" + assert_complete_dir {g'} $cmd "fixtures/_filedir" + + + sync_after_int + } + + + set cmd "$name 'a&b/" + assert_complete_dir {f'} $cmd "fixtures/_filedir" + + + sync_after_int + + + set cmd "$name \"ab/"; #" + assert_complete_dir {e"} $cmd "fixtures/_filedir"; #" + + + sync_after_int + + + set cmd "$name \"a b/"; #" + assert_complete_dir {i"} $cmd "fixtures/_filedir"; #" + + + sync_after_int + + + set cmd "$name \"a'b/"; #" + assert_complete_dir {c"} $cmd "fixtures/_filedir"; #" + + + sync_after_int + + + set cmd "$name \"a\\\"b/"; #" + assert_complete_dir {d"} $cmd "fixtures/_filedir"; #" + + + sync_after_int + + + set cmd "$name \"a\\\$b/"; #" + assert_complete_dir "\b\b\b\b\b$::TESTDIR/fixtures/_filedir/a\\\\\$b/h\\\"" $cmd "fixtures/_filedir" + + + sync_after_int + + + set cmd "$name \"a\\b/"; #" + assert_complete_dir "\b\b\bb/e\\\"" $cmd "fixtures/_filedir" + + + sync_after_int + + + set cmd "$name \"a\\\\b/"; #" + assert_complete_dir {g"} $cmd "fixtures/_filedir"; #" + + + sync_after_int + + + set cmd "$name \"a&b/"; #" + assert_complete_dir {f"} $cmd "fixtures/_filedir"; #" + + + sync_after_int + + + }; # if 4.0.0 < bash-version > 4.0.34 +}; # foreach + + +set test "completing with filter '.e1' should show completions" +assert_complete_dir {ee.e1 foo/ gg.e1} "g " "fixtures/_filedir/ext" $test + + +sync_after_int + + +set test "completing f aé should return g when LC_CTYPE=C" +# Backup/set LC_CTYPE +assert_bash_exec {OLD_CTYPE=$LC_CTYPE; LC_CTYPE=C} +if {[lindex $::BASH_VERSINFO 0] > 3} { + assert_complete_dir g "f aé/" "fixtures/_filedir" +} else { + assert_complete_dir "\b\b\b\b$'a\\\\303\\\\251/g'" "f aé/" \ + "fixtures/_filedir" +} +# Restore LC_CTYPE +assert_bash_exec {[[ $OLD_CTYPE ]] && LC_CTYPE=$OLD_CTYPE || unset LC_CTYPE} + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/unit/find_unique_completion_pair.exp bash-completion-1.2/test/unit/find_unique_completion_pair.exp --- bash-completion-1.1/test/unit/find_unique_completion_pair.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/unit/find_unique_completion_pair.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,37 @@ +# Note: This test actually tests a function in the test library. It doesn't +# need bash running; but it doesn't hurt either. + +# Run one test. Look below for usage. +proc test_find_ucp {{list} {epart} {econt} {eret 1}} { + set efull "$epart$econt" + set rret [find_unique_completion_pair $list rpart rfull] + if {$eret != $rret} { + if {$eret} { + fail "find_unique_completion_pair: Nothing found for {$list}" + } else { + fail "find_unique_completion_pair: Expected failure for {$list}" + } + } elseif {!$eret} { + pass "find_unique_completion_pair: No results for list {$list}" + } elseif {$rpart != $epart || $rfull != $efull} { + fail "find_unique_completion_pair: Got \"$rpart\", \"$rfull\" \ + instead of \"$epart\", \"$efull\" for list {$list}" + } else { + pass "find_unique_completion_pair: Got \"$epart\", \"$efull\" \ + for list {$list}" + } +} + +test_find_ucp {a} 0 0 0 +test_find_ucp {ab} a b +test_find_ucp {a ab abcd abc} 0 0 0 +test_find_ucp {a ab abcde abc} abcd e +test_find_ucp {user1 user2} 0 0 0 +test_find_ucp {root username2 username1} ro ot +test_find_ucp {root username21 username2} ro ot +test_find_ucp {long_user_name lang_user_name long_usor_name} lang_us er_name +test_find_ucp {lang_user_name1 long_user_name lang_user_name long_usor_name} \ + long_use r_name +test_find_ucp {root username} user name +test_find_ucp {a aladin} ala din +test_find_ucp {ala aladin} alad in diff -Nru bash-completion-1.1/test/unit/_get_comp_words_by_ref.exp bash-completion-1.2/test/unit/_get_comp_words_by_ref.exp --- bash-completion-1.1/test/unit/_get_comp_words_by_ref.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/unit/_get_comp_words_by_ref.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,386 @@ +proc setup {} { + assert_bash_exec {unset COMP_CWORD COMP_LINE COMP_POINT COMP_WORDS} + save_env +}; # setup() + + +proc teardown {} { + assert_bash_exec { \ + unset COMP_CWORD COMP_LINE COMP_POINT COMP_WORDS cur prev words cword \ + cur2 prev2 words2 cword2 \ + } + # Delete 'COMP_WORDBREAKS' occupying two lines + assert_env_unmodified { + /COMP_WORDBREAKS=/{N + d + } + } +}; # teardown() + + +setup + + +set test "_get_comp_words_by_ref should run without errors" +assert_bash_exec {_get_comp_words_by_ref cur > /dev/null} $test + + +sync_after_int + + +# See also ./lib/completions/alias.exp. Here `_get_cword' is actually tested +# by moving the cursor left into the current word. + + +set test "a b|"; # | = cursor position +set cmd {COMP_WORDS=(a b); COMP_CWORD=1; COMP_LINE='a b'; COMP_POINT=3; _get_comp_words_by_ref cur prev; echo "$cur $prev"} +assert_bash_list {"b a"} $cmd $test + + +sync_after_int + + +set test "a |"; # | = cursor position +set cmd {COMP_WORDS=(a); COMP_CWORD=1; COMP_LINE='a '; COMP_POINT=2; _get_comp_words_by_ref cur prev; echo "$cur $prev"} +assert_bash_list {" a"} $cmd $test + + +sync_after_int + + +set test "a b |"; # | = cursor position +set cmd {COMP_WORDS=(a b ''); COMP_CWORD=2; COMP_LINE='a b '; COMP_POINT=4; _get_comp_words_by_ref cur prev; echo "$cur $prev"} +assert_bash_list {" b"} $cmd $test + + +sync_after_int + + +set test "a b | with WORDBREAKS -= :"; # | = cursor position +set cmd {COMP_WORDS=(a b ''); COMP_CWORD=2; COMP_LINE='a b '; COMP_POINT=4; _get_comp_words_by_ref -n : cur; printf %s "$cur"} +assert_bash_list {} $cmd $test + + +sync_after_int + + +set test "a b|c"; # | = cursor position +set cmd {COMP_WORDS=(a bc); COMP_CWORD=1; COMP_LINE='a bc'; COMP_POINT=3; _get_comp_words_by_ref cur prev; echo "$cur $prev"} +assert_bash_list {"b a"} $cmd $test + + +sync_after_int + + +set test {a b\ c| should return b\ c}; # | = cursor position +set cmd {COMP_WORDS=(a 'b\ c'); COMP_CWORD=1; COMP_LINE='a b\ c'; COMP_POINT=6; _get_comp_words_by_ref cur prev; echo "$cur $prev"} +assert_bash_list {"b\\ c a"} $cmd $test + + +sync_after_int + + +set test {a b\| c should return b\ }; # | = cursor position +set cmd {COMP_WORDS=(a 'b\ c'); COMP_CWORD=1; COMP_LINE='a b\ c'; COMP_POINT=4; _get_comp_words_by_ref cur prev; echo "$cur $prev"} +assert_bash_list {"b\\ a"} $cmd $test + + +sync_after_int + + +set test {a "b\|}; #"# | = cursor position +set cmd {COMP_WORDS=(a '"b\'); COMP_CWORD=1; COMP_LINE='a "b\'; COMP_POINT=5; _get_comp_words_by_ref cur prev; echo "$cur $prev"} +assert_bash_list {"\"b\\ a"} $cmd $test + + +sync_after_int + + +set test {a 'b c|}; # | = cursor position +if { + [lindex $::BASH_VERSINFO 0] == 4 && + [lindex $::BASH_VERSINFO 1] == 0 && + [lindex $::BASH_VERSINFO 2] < 35 +} { + set cmd {COMP_WORDS=(a "'" b c); COMP_CWORD=3} +} else { + set cmd {COMP_WORDS=(a "'b c"); COMP_CWORD=1} +}; # if +append cmd {; COMP_LINE="a 'b c"; COMP_POINT=6; _get_comp_words_by_ref cur prev; echo "$cur $prev"} +send "$cmd\r" +expect -ex "$cmd\r\n" +expect { + -ex "'b c a\r\n/@" { pass "$test" } + -ex "c b\r\n/@" { + if { + [lindex $::BASH_VERSINFO 0] == 4 && + [lindex $::BASH_VERSINFO 1] == 0 && + [lindex $::BASH_VERSINFO 2] < 35 + } {xfail "$test"} {fail "$test"} + } +}; # expect + + +sync_after_int + + +set test {a "b c|}; #"# | = cursor position +if { + [lindex $::BASH_VERSINFO 0] == 4 && + [lindex $::BASH_VERSINFO 1] == 0 && + [lindex $::BASH_VERSINFO 2] < 35 +} { + set cmd {COMP_WORDS=(a "\"" b c); COMP_CWORD=3} +} else { + set cmd {COMP_WORDS=(a "\"b c"); COMP_CWORD=1} +}; # if +append cmd {; COMP_LINE="a \"b c"; COMP_POINT=6} +assert_bash_exec $cmd +set cmd {_get_comp_words_by_ref cur prev; echo "$cur $prev"}; +send "$cmd\r" +expect -ex "$cmd\r\n" +expect { + -ex "\"b c a\r\n/@" { pass "$test" } + -ex "c b\r\n/@" { + if { + [lindex $::BASH_VERSINFO 0] == 4 && + [lindex $::BASH_VERSINFO 1] == 0 && + [lindex $::BASH_VERSINFO 2] < 35 + } {xfail "$test"} {fail "$test"} + } +}; # expect + + +sync_after_int + + +set test {a b:c| with WORDBREAKS += :}; # | = cursor position +if {[lindex $::BASH_VERSINFO 0] <= 3} { + set cmd {COMP_WORDS=(a "b:c"); COMP_CWORD=1} + set expected {"b:c a"} +} else { + set cmd {add_comp_wordbreak_char :; COMP_WORDS=(a b : c); COMP_CWORD=3} + set expected {"c :"} +}; # if +append cmd {; COMP_LINE='a b:c'; COMP_POINT=5} +# NOTE: Split-send cmd to prevent backspaces (\008) in output +assert_bash_exec $cmd $test +set cmd {_get_comp_words_by_ref cur prev; echo "$cur $prev"} +assert_bash_list $expected $cmd $test + + +sync_after_int + + +set test {a b:c| with WORDBREAKS -= :}; # | = cursor position +if {[lindex $::BASH_VERSINFO 0] <= 3} { + set cmd {COMP_WORDS=(a "b:c"); COMP_CWORD=1} +} else { + set cmd {COMP_WORDS=(a b : c); COMP_CWORD=3} +}; # if +append cmd {; COMP_LINE='a b:c'; COMP_POINT=5} +assert_bash_exec $cmd $test +set cmd {_get_comp_words_by_ref -n : cur prev; echo "$cur $prev"} +assert_bash_list {"b:c a"} $cmd $test + + +sync_after_int + + +set test {a b c:| with WORDBREAKS -= :}; # | = cursor position +if {[lindex $::BASH_VERSINFO 0] <= 3} { + set cmd {COMP_WORDS=(a b c:); COMP_CWORD=2} +} else { + set cmd {COMP_WORDS=(a b c :); COMP_CWORD=3} +}; # if +append cmd {; COMP_LINE='a b c:'; COMP_POINT=6} +assert_bash_exec $cmd $test +set cmd {_get_comp_words_by_ref -n : cur prev; echo "$cur $prev"} +assert_bash_list {"c: b"} $cmd $test + + +sync_after_int + + +set test {a :| with WORDBREAKS -= : should return :}; # | = cursor position +set cmd {COMP_WORDS=(a :); COMP_CWORD=1; COMP_LINE='a :'; COMP_POINT=3} +assert_bash_exec $cmd +set cmd {_get_comp_words_by_ref -n : cur prev; echo "$cur $prev"} +assert_bash_list {": a"} $cmd $test + + +sync_after_int + + +set test {a b::| with WORDBREAKS -= : should return b::}; # | = cursor position +if {[lindex $::BASH_VERSINFO 0] <= 3} { + set cmd {COMP_WORDS=(a "b::"); COMP_CWORD=1} +} else { + set cmd {COMP_WORDS=(a b ::); COMP_CWORD=2} +}; # if +append cmd {; COMP_LINE='a b::'; COMP_POINT=5} +assert_bash_exec $cmd +set cmd {_get_comp_words_by_ref -n : cur prev; echo "$cur $prev"} +assert_bash_list {"b:: a"} $cmd $test + + +sync_after_int + + +# This test makes sure `_get_cword' doesn't use `echo' to return it's value, +# because -n might be interpreted by `echo' and thus will not be returned. +set test "a -n| should return -n"; # | = cursor position +set cmd {COMP_WORDS=(a -n); COMP_CWORD=1; COMP_LINE='a -n'; COMP_POINT=4} +assert_bash_exec $cmd +set cmd {_get_comp_words_by_ref cur; printf %s $cur} +assert_bash_list -n $cmd $test + + +sync_after_int + + +set test {a b>c| should return c}; # | = cursor position +set cmd {COMP_WORDS=(a b \> c); COMP_CWORD=3; COMP_LINE='a b>c'; COMP_POINT=5} +assert_bash_exec $cmd +set cmd {_get_comp_words_by_ref cur prev; echo "$cur"} +assert_bash_list c $cmd $test + + +sync_after_int + + +set test {a b=c| should return b=c (bash-3) or c (bash-4)}; # | = cursor position +if {[lindex $::BASH_VERSINFO] <= 3} { + set cmd {COMP_WORDS=(a "b=c"); COMP_CWORD=1} + set expected b=c +} else { + set cmd {COMP_WORDS=(a b = c); COMP_CWORD=3} + set expected c +}; # if +append cmd {; COMP_LINE='a b=c'; COMP_POINT=5} +assert_bash_exec $cmd +set cmd {_get_comp_words_by_ref cur prev; echo "$cur"} +assert_bash_list $expected $cmd $test + + +sync_after_int + + +set test {a *| should return *}; # | = cursor position +set cmd {COMP_WORDS=(a \*); COMP_CWORD=1; COMP_LINE='a *'; COMP_POINT=4} +assert_bash_exec $cmd +set cmd {_get_comp_words_by_ref cur; echo "$cur"} +assert_bash_list * $cmd $test + + +sync_after_int + + +set test {a $(b c| should return $(b c}; # | = cursor position +set cmd {COMP_WORDS=(a '$(b c'); COMP_CWORD=1; COMP_LINE='a $(b c'; COMP_POINT=7} +assert_bash_exec $cmd +set cmd {_get_comp_words_by_ref cur; printf %s "$cur"} +send "$cmd\r" +expect -ex "$cmd\r\n" +expect { + -ex "\$(b c/@" { pass "$test" } + # Expected failure on bash-4 + -ex "c/@" { xfail "$test" } +}; # expect + + +sync_after_int + + +set test {a $(b c\ d| should return $(b c\ d}; # | = cursor position +set cmd {COMP_WORDS=(a '$(b c\ d'); COMP_CWORD=1; COMP_LINE='a $(b c\ d'; COMP_POINT=10} +assert_bash_exec $cmd +set cmd {_get_comp_words_by_ref cur; printf %s "$cur"} +#assert_bash_list {{$(b\ c\\\ d}} $cmd $test +send "$cmd\r" +expect -ex "$cmd\r\n" +expect { + -ex "\$(b c\\ d/@" { pass "$test" } + # Expected failure on bash-4 + -ex "c\\ d/@" { xfail "$test" } +}; # expect + + +sync_after_int + + +set test {a 'b&c| should return 'b&c}; # | = cursor position +if { + [lindex $::BASH_VERSINFO 0] == 4 && + [lindex $::BASH_VERSINFO 1] == 0 && + [lindex $::BASH_VERSINFO 2] < 35 +} { + set cmd {COMP_WORDS=(a "'" b "&" c); COMP_CWORD=4} +} else { + set cmd {COMP_WORDS=(a "'b&c"); COMP_CWORD=1} +}; # if +append cmd {; COMP_LINE="a 'b&c"; COMP_POINT=6} +assert_bash_exec $cmd +set cmd {_get_comp_words_by_ref cur prev; printf %s "$cur"} +send "$cmd\r" +expect -ex "$cmd\r\n" +expect { + -ex "'b&c/@" { pass "$test" } + -ex "c/@" { + if { + [lindex $::BASH_VERSINFO 0] == 4 && + [lindex $::BASH_VERSINFO 1] == 0 && + [lindex $::BASH_VERSINFO 2] < 35 + } {xfail "$test"} {fail "$test"} + } +}; # expect + + +sync_after_int + + +set test {unknown argument should raise error} +set cmd {_get_comp_words_by_ref dummy} +assert_bash_list {"bash: _get_comp_words_by_ref(): `dummy': unknown argument"} $cmd $test + + +sync_after_int + + +set test "a b| to all vars"; # | = cursor position +set cmd {COMP_WORDS=(a b); COMP_CWORD=1; COMP_LINE='a b'; COMP_POINT=3} +assert_bash_exec $cmd +set cmd { \ + _get_comp_words_by_ref words cword prev cur; echo "${words[@]} $cword $cur $prev" \ +} +assert_bash_list {"a b 1 b a"} $cmd $test + + +sync_after_int + + +set test "a b| to alternate vars"; # | = cursor position +set cmd {COMP_WORDS=(a b); COMP_CWORD=1; COMP_LINE='a b'; COMP_POINT=3;} +assert_bash_exec $cmd +set cmd {_get_comp_words_by_ref -c cur2 -p prev2 -w words2 -i cword2} +assert_bash_exec $cmd +set cmd {echo "$cur2 $prev2 ${words2[@]} $cword2"} +assert_bash_list {"b a a b 1"} $cmd $test + + +sync_after_int + + +set test "a b| to alternate vars"; # | = cursor position +set cmd {COMP_WORDS=(a b); COMP_CWORD=1; COMP_LINE='a b'; COMP_POINT=3;} +assert_bash_exec $cmd +set cmd {_get_comp_words_by_ref -c cur2 -p prev2 -w words2 -i cword2} +assert_bash_exec $cmd +set cmd {echo "$cur2 $prev2 ${words2[@]} $cword2"} +assert_bash_list {"b a a b 1"} $cmd $test + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/unit/_get_cword.exp bash-completion-1.2/test/unit/_get_cword.exp --- bash-completion-1.1/test/unit/_get_cword.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/unit/_get_cword.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,316 @@ +proc setup {} { + assert_bash_exec {unset COMP_CWORD COMP_LINE COMP_POINT COMP_WORDS} + save_env +}; # setup() + + +proc teardown {} { + assert_bash_exec {unset COMP_CWORD COMP_LINE COMP_POINT COMP_WORDS} + # Delete 'COMP_WORDBREAKS' occupying two lines + assert_env_unmodified { + /COMP_WORDBREAKS=/{N + d + } + } +}; # teardown() + + +setup + + +set test "_get_cword should run without errors" +assert_bash_exec {_get_cword > /dev/null} $test + + +sync_after_int + + +# See also ./lib/completions/alias.exp. Here `_get_cword' is actually tested +# by moving the cursor left into the current word. + + +set test "a b| should return b"; # | = cursor position +set cmd {COMP_WORDS=(a b); COMP_CWORD=1; COMP_LINE='a b'; COMP_POINT=3; _get_cword} +assert_bash_list b $cmd $test + + +sync_after_int + + +set test "a | should return nothing"; # | = cursor position +set cmd {COMP_WORDS=(a); COMP_CWORD=1; COMP_LINE='a '; COMP_POINT=2; _get_cword} +send "$cmd\r" +expect -ex "$cmd\r\n/@" {pass "$test"} + + +sync_after_int + + +set test "a b | should return nothing"; # | = cursor position +set cmd {COMP_WORDS=(a b ''); COMP_CWORD=2; COMP_LINE='a b '; COMP_POINT=4; _get_cword} +send "$cmd\r" +expect -ex "$cmd\r\n/@" {pass "$test"} + + +sync_after_int + + +set test "a b | with WORDBREAKS -= : should return nothing"; # | = cursor position +set cmd {COMP_WORDS=(a b ''); COMP_CWORD=2; COMP_LINE='a b '; COMP_POINT=4; _get_cword :} +send "$cmd\r" +expect -ex "$cmd\r\n/@" {pass "$test"} + + +sync_after_int + + +set test "a b|c should return b"; # | = cursor position +set cmd {COMP_WORDS=(a bc); COMP_CWORD=1; COMP_LINE='a bc'; COMP_POINT=3; _get_cword} +assert_bash_list b $cmd $test + + +sync_after_int + + +set test {a b\ c| should return b\ c}; # | = cursor position +set cmd {COMP_WORDS=(a 'b\ c'); COMP_CWORD=1; COMP_LINE='a b\ c'; COMP_POINT=6; _get_cword} +assert_bash_list {"b\\ c"} $cmd $test + + +sync_after_int + + +set test {a b\| c should return b\ }; # | = cursor position +set cmd {COMP_WORDS=(a 'b\ c'); COMP_CWORD=1; COMP_LINE='a b\ c'; COMP_POINT=4; _get_cword} +assert_bash_list {"b\\"} $cmd $test + + +sync_after_int + + +set test {a "b\| should return "b\ }; # | = cursor position +set cmd {COMP_WORDS=(a '"b\'); COMP_CWORD=1; COMP_LINE='a "b\'; COMP_POINT=5; _get_cword} +assert_bash_list {"\"b\\"} $cmd $test + + +sync_after_int + + +set test {a 'b c| should return 'b c}; # | = cursor position +if { + [lindex $::BASH_VERSINFO 0] == 4 && + [lindex $::BASH_VERSINFO 1] == 0 && + [lindex $::BASH_VERSINFO 2] < 35 +} { + set cmd {COMP_WORDS=(a "'" b c); COMP_CWORD=3} +} else { + set cmd {COMP_WORDS=(a "'b c"); COMP_CWORD=1} +}; # if +append cmd {; COMP_LINE="a 'b c"; COMP_POINT=6; _get_cword} +send "$cmd\r" +expect -ex "$cmd\r\n" +expect { + -ex "'b c/@" { pass "$test" } + -ex "c/@" { + if { + [lindex $::BASH_VERSINFO 0] == 4 && + [lindex $::BASH_VERSINFO 1] == 0 && + [lindex $::BASH_VERSINFO 2] < 35 + } {xfail "$test"} {fail "$test"} + } +}; # expect + + +sync_after_int + + +set test {a "b c| should return "b c}; # | = cursor position +if { + [lindex $::BASH_VERSINFO 0] == 4 && + [lindex $::BASH_VERSINFO 1] == 0 && + [lindex $::BASH_VERSINFO 2] < 35 +} { + set cmd {COMP_WORDS=(a "\"" b c); COMP_CWORD=3} +} else { + set cmd {COMP_WORDS=(a "\"b c"); COMP_CWORD=1} +}; # if +append cmd {; COMP_LINE="a \"b c"; COMP_POINT=6; _get_cword}; +send "$cmd\r" +expect -ex "$cmd\r\n" +expect { + -ex "\"b c/@" { pass "$test" } + -ex "c/@" { + if { + [lindex $::BASH_VERSINFO 0] == 4 && + [lindex $::BASH_VERSINFO 1] == 0 && + [lindex $::BASH_VERSINFO 2] < 35 + } {xfail "$test"} {fail "$test"} + } +}; # expect + + +sync_after_int + + +set test {a b:c| with WORDBREAKS += : should return b:c (bash-3) or c (bash-4)}; # | = cursor position +if {[lindex $::BASH_VERSINFO 0] <= 3} { + set cmd {COMP_WORDS=(a "b:c"); COMP_CWORD=1} + set expected b:c +} else { + set cmd {add_comp_wordbreak_char :; COMP_WORDS=(a b : c); COMP_CWORD=3} + set expected c +}; # if +append cmd {; COMP_LINE='a b:c'; COMP_POINT=5; _get_cword} +assert_bash_list $expected $cmd $test + + +sync_after_int + + +set test {a b:c| with WORDBREAKS -= : should return b:c}; # | = cursor position +if {[lindex $::BASH_VERSINFO 0] <= 3} { + set cmd {COMP_WORDS=(a "b:c"); COMP_CWORD=1} +} else { + set cmd {COMP_WORDS=(a b : c); COMP_CWORD=3} +}; # if +append cmd {; COMP_LINE='a b:c'; COMP_POINT=5; _get_cword :} +assert_bash_list b:c $cmd $test + + +sync_after_int + + +set test {a b c:| with WORDBREAKS -= : should return c:}; # | = cursor position +if {[lindex $::BASH_VERSINFO 0] <= 3} { + set cmd {COMP_WORDS=(a b c:); COMP_CWORD=2} +} else { + set cmd {COMP_WORDS=(a b c :); COMP_CWORD=3} +}; # if +append cmd {; COMP_LINE='a b c:'; COMP_POINT=6; _get_cword :} +assert_bash_list c: $cmd $test + + +sync_after_int + + +set test {a :| with WORDBREAKS -= : should return :}; # | = cursor position +set cmd {COMP_WORDS=(a :); COMP_CWORD=1; COMP_LINE='a :'; COMP_POINT=3; _get_cword :} +assert_bash_list : $cmd $test + + +sync_after_int + + +set test {a b::| with WORDBREAKS -= : should return b::}; # | = cursor position +if {[lindex $::BASH_VERSINFO 0] <= 3} { + set cmd {COMP_WORDS=(a "b::"); COMP_CWORD=1} +} else { + set cmd {COMP_WORDS=(a b ::); COMP_CWORD=2} +}; # if +append cmd {; COMP_LINE='a b::'; COMP_POINT=5; _get_cword :} +assert_bash_list b:: $cmd $test + + +sync_after_int + + +# This test makes sure `_get_cword' doesn't use `echo' to return it's value, +# because -n might be interpreted by `echo' and thus will not be returned. +set test "a -n| should return -n"; # | = cursor position +set cmd {COMP_WORDS=(a -n); COMP_CWORD=1; COMP_LINE='a -n'; COMP_POINT=4; _get_cword} +assert_bash_list -n $cmd $test + + +sync_after_int + + +set test {a b>c| should return c}; # | = cursor position +set cmd {COMP_WORDS=(a b \> c); COMP_CWORD=3; COMP_LINE='a b>c'; COMP_POINT=5; _get_cword} +assert_bash_list c $cmd $test + + +sync_after_int + + +set test {a b=c| should return b=c (bash-3) or c (bash-4)}; # | = cursor position +if {[lindex $::BASH_VERSINFO] <= 3} { + set cmd {COMP_WORDS=(a "b=c"); COMP_CWORD=1} + set expected b=c +} else { + set cmd {COMP_WORDS=(a b = c); COMP_CWORD=3} + set expected c +}; # if +append cmd {; COMP_LINE='a b=c'; COMP_POINT=5; _get_cword} +assert_bash_list $expected $cmd $test + + +sync_after_int + + +set test {a *| should return *}; # | = cursor position +set cmd {COMP_WORDS=(a \*); COMP_CWORD=1; COMP_LINE='a *'; COMP_POINT=4; _get_cword} +assert_bash_list * $cmd $test + + +sync_after_int + + +set test {a $(b c| should return $(b c}; # | = cursor position +set cmd {COMP_WORDS=(a '$(b c'); COMP_CWORD=1; COMP_LINE='a $(b c'; COMP_POINT=7; _get_cword} +#assert_bash_list {{$(b\ c}} $cmd $test +send "$cmd\r" +expect -ex "$cmd\r\n" +expect { + -ex "\$(b c/@" { pass "$test" } + # Expected failure on bash-4 + -ex "c/@" { xfail "$test" } +}; # expect + + +sync_after_int + + +set test {a $(b c\ d| should return $(b c\ d}; # | = cursor position +set cmd {COMP_WORDS=(a '$(b c\ d'); COMP_CWORD=1; COMP_LINE='a $(b c\ d'; COMP_POINT=10; _get_cword} +#assert_bash_list {{$(b\ c\\\ d}} $cmd $test +send "$cmd\r" +expect -ex "$cmd\r\n" +expect { + -ex "\$(b c\\ d/@" { pass "$test" } + # Expected failure on bash-4 + -ex "c\\ d/@" { xfail "$test" } +}; # expect + + +sync_after_int + + +set test {a 'b&c| should return 'b&c}; # | = cursor position +if { + [lindex $::BASH_VERSINFO 0] == 4 && + [lindex $::BASH_VERSINFO 1] == 0 && + [lindex $::BASH_VERSINFO 2] < 35 +} { + set cmd {COMP_WORDS=(a "'" b "&" c); COMP_CWORD=4} +} else { + set cmd {COMP_WORDS=(a "'b&c"); COMP_CWORD=1} +}; # if +append cmd {; COMP_LINE="a 'b&c"; COMP_POINT=6; _get_cword} +send "$cmd\r" +expect -ex "$cmd\r\n" +expect { + -ex "'b&c/@" { pass "$test" } + -ex "c/@" { + if { + [lindex $::BASH_VERSINFO 0] == 4 && + [lindex $::BASH_VERSINFO 1] == 0 && + [lindex $::BASH_VERSINFO 2] < 35 + } {xfail "$test"} {fail "$test"} + } +}; # expect + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/test/unit/_known_hosts_real.exp bash-completion-1.2/test/unit/_known_hosts_real.exp --- bash-completion-1.1/test/unit/_known_hosts_real.exp 1970-01-01 00:00:00.000000000 +0000 +++ bash-completion-1.2/test/unit/_known_hosts_real.exp 2010-06-13 11:21:19.000000000 +0100 @@ -0,0 +1,118 @@ +proc setup {} { + save_env +}; # setup() + + +proc teardown {} { + assert_env_unmodified { + /COMPREPLY=/d + /OLDHOME=/d + } +}; # teardown() + + +setup + + +set test "Hosts should be put in COMPREPLY" +set hosts [get_hosts] + # Hosts `gee', `hus' and `jar' are defined in ./fixtures/_known_hosts_real/config + # doo, ike, jub, 10.0.0.1, kyl and 100.0.0.2 in ./fixtures/_known_hosts_real/known_hosts +lappend hosts doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 +set cmd {unset COMPREPLY; _known_hosts_real -aF fixtures/_known_hosts_real/config ''; echo_array COMPREPLY} +assert_bash_list $hosts $cmd $test + + +sync_after_int + + +set test "Hosts should have username prefix and colon suffix" +set hosts [get_hosts] + # Hosts `gee', `hus' and `jar' are defined in ./fixtures/_known_hosts_real/config + # doo, ike jub, 10.0.0.1, kyl and 100.0.0.2 in ./fixtures/_known_hosts_real/known_hosts +lappend hosts doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 +set hosts [lsort -ascii $hosts] +set expected {} +foreach host $hosts { + lappend expected "user@$host:" +}; # foreach + # Call _known_hosts +set cmd {unset COMPREPLY; _known_hosts_real -acF fixtures/_known_hosts_real/config 'user@'; echo_array COMPREPLY} +assert_bash_list $expected $cmd $test + + +sync_after_int + + +set test "Files containing consecutive spaces should work" +set hosts [get_hosts] +set hosts_orig $hosts + # Hosts `gee' and `hus' are defined in `./fixtures/_known_hosts_real/spaced conf' + # Host `two' is defined in ./fixtures/_known_hosts_real/known_hosts2 +lappend hosts gee hus two +set hosts_config $hosts + # Hosts `doo' and `ike' are defined in `./fixtures/_known_hosts_/spaced known_hosts' +lappend hosts doo ike +set hosts [join [bash_sort $hosts ] "\\s+"] +set hosts_orig [join [bash_sort $hosts_orig ] "\\s+"] +set hosts_config [join [bash_sort $hosts_config] "\\s+"] + # Call _known_hosts +set cmd {unset COMPREPLY; _known_hosts_real -aF 'fixtures/_known_hosts_real/spaced conf' ''; echo_array COMPREPLY} +send "$cmd\r" +expect -ex "$cmd\r\n" +expect { + -re "^$hosts\r\n/@$" { pass "$test" } + -re "^$hosts_orig\r\n/@$" { fail "$test (config file)" } + -re "^$hosts_config\r\n/@$" { fail "$test (known hosts file)" } + -re /@ { unresolved "$test at prompt" } + default { unresolved "$test" } +}; # expect + + +sync_after_int + + +set test "Files starting with tilde (~) should work" +set hosts [get_hosts] + # Host `two' is defined in ./fixtures/_known_hosts_real/known_hosts2 + # Host `three' is defined in ./fixtures/_known_hosts_real/known_hosts3 +lappend hosts two three +set hosts [join [bash_sort $hosts] "\\s+"] + # Setup environment +set cmd {OLDHOME=$HOME; HOME=$TESTDIR} +send "$cmd\r" +expect -ex "$cmd\r\n/@" + # Call _known_hosts +set cmd {unset COMPREPLY; _known_hosts_real -aF fixtures/_known_hosts_real/config_tilde ''; echo_array COMPREPLY} +send "$cmd\r" +expect -ex "$cmd\r\n" +expect { + -re "^$hosts\r\n/@$" { pass "$test" } + default { unresolved "$test" } +}; # expect + # Teardown environment +set cmd {HOME=$OLDHOME} +send "$cmd\r" +expect -ex "$cmd\r\n/@" + + +sync_after_int + + +set test "Empty COMP_KNOWN_HOSTS_WITH_HOSTFILE should omit HOSTFILE" +assert_bash_exec "COMP_KNOWN_HOSTS_WITH_HOSTFILE=" +set hosts [get_hosts_avahi] + # Hosts `gee', `hus' and `jar' are defined in ./fixtures/_known_hosts_real/config + # doo, ike, jub, 10.0.0.1, kyl and 100.0.0.2 in ./fixtures/_known_hosts_real/known_hosts +lappend hosts doo gee hus ike jar jub kyl 10.0.0.1 100.0.0.2 + # Call _known_hosts +set cmd {unset COMPREPLY; _known_hosts_real -aF fixtures/_known_hosts_real/config ''; echo_array COMPREPLY} +assert_bash_list $hosts $cmd $test +sync_after_int +assert_bash_exec "unset -v COMP_KNOWN_HOSTS_WITH_HOSTFILE" + + +sync_after_int + + +teardown diff -Nru bash-completion-1.1/TODO bash-completion-1.2/TODO --- bash-completion-1.1/TODO 2009-10-03 14:18:09.000000000 +0100 +++ bash-completion-1.2/TODO 2010-06-13 11:21:19.000000000 +0100 @@ -2,8 +2,8 @@ --------------------------------------------------------- bash completion really needs to be rewritten from the ground up, using all of -the features available in bash 3.1 and without regard for compatibility with -the 2.x line. +the features available in bash 3.2+ and without regard for compatibility with +earlier versions. At that time, it should be split into multiple files for easier source management. Whether or not it is actually installed on the destination