diff options
author | David Paleino <dapal@debian.org> | 2013-11-04 17:58:57 +0100 |
---|---|---|
committer | David Paleino <dapal@debian.org> | 2013-11-04 17:58:57 +0100 |
commit | 059a87a5936cfebfd2d71ab8057002cafb2ea051 (patch) | |
tree | 7fafa4bb39a443ba4d49fccc852193adfea93564 | |
parent | 30649a02707d24744853f84946f744fdcf7c2757 (diff) | |
download | bash-completion-upstream/2.1.tar.gz |
Imported Upstream version 2.1upstream/2.1
276 files changed, 4227 insertions, 1408 deletions
@@ -1,6 +1,7 @@ David Paleino (Debian) <d.paleino@gmail.com> Freddy Vulto <fvulto@gmail.com> Guillame Rousse (Mandriva) <Guillaume.Rousse@inria.fr> +Igor Murzov <e-mail@date.by> Mike Kelly (Exherbo) <pioto@pioto.org> Santiago M. Mola (Exherbo) <cooldwind@gmail.com> Ville Skyttä (Fedora/Red Hat) <ville.skytta@iki.fi> @@ -1,3 +1,165 @@ +bash-completion (2.1) + + [ AllKind ] + * Fix __ltrim_colon_completions() fail on parameter (\$1) containing + a glob. + + [ Andreas Müller ] + * completions/Makefile.am: symlinks depends on $(DATA) to avoid race + conditions + + [ Christian von Roques ] + * Fix __reassemble_comp_words_by_ref for $COMP_CWORD == ${#COMP_WORDS[@]} + + [ David Paleino ] + * Fix helper script to create changelogs + + [ Guillaume Rousse ] + * New completions: nmcli, gphoto2 + * Improved completions: + - dsniff: add -p option completion + - dsniff: fix interface completion + + + [ Igor Murzov ] + * _command_offset: Restore compopts properly (Alioth: #313890) + * _parse_help, _parse_usage: Run commands in C locale. + * New completions: wget, zathura + * Improved completions: + - cppcheck: Add new standards to --std option. + - evince: Evince supports opening .pdf.xz files (Alioth: #313739). + - feh: Add new options introduced in feh-2.7. + - feh: Fix list of background styles. + - fusermount: Complete curlftpfs-mounts for "fusermount -u" (Debian: + #685377) + - kcov: Add new sort types (introduced in kcov-9). + - kcov: Complete arguments of --limits option. + - lvm: Fix typo in option name: s/continguous/contiguous/. + - make: Do not append space if target is a filepath. + - mount: Fix parsing /etc/fstab on *BSD. + - mount.linux: Add some new mount options intoduced in Linux 3.5 and 3.7 + - mount.linux: Add options completion for nfs and davfs. + - mount.linux: Clean up mount options, remove duplicates. + - mplayer: Add opus to the list of supported formats. + - mplayer: Add -subcp argument completion. + - opera: Handle options. + - slackpkg, slapt-get: Update the list of package sets. + - tar: Fix detection if the $prev is a tar file. + - valgrind: Add --soname-synonyms option arguments completion. + * Testsuite: + - _filedir: Remove the cruft from the a\$b->h unit test (Alioth: #313480) + + [ Jeroen Hoek ] + * Improved completions: + - unzip: Add support for OpenDocument formats. + + [ Ken Sharp ] + * Improved completions: + - wine: add .msi completion + + [ Martin Ueding ] + * Stylistic cleanup + + [ Tristan Wibberley ] + * Improved completions: + - make: incremental completion for make with compact display + - make: convert make completion to use smarter parser + + [ Ville Skyttä ] + * Avoid sourcing dirs in completion loader to avoid fd leaks (RedHat: #903540) + * Ignore colormake symlink. + * Line continuation, whitespace, and compgen -W ... -- "$cur" + quoting cleanups. + * _available_interfaces: Try with "ip link" if ifconfig is not available. + * _ip_addresses: Try with "ip addr" if ifconfig is not available. + * _known_hosts_real: Filter ruptime stdout error spewage (Alioth: #313893). + * _mac_addresses: Try local interfaces with "ip link" if ifconfig not + available. + * _mac_addresses: Try ARP cache with "ip neigh" if arp is not available. + * _mac_addresses: Fix with net-tools' ifconfig that outputs ether, not HWaddr. + * New completions: chronyc, eject, eog, file-roller, hexdump, interdiff, lua, + luac, luseradd, luserdel, lusermod, mussh, nc, ngrep, patch, pydoc, + pyflakes, pylint, ss, strings, tshark, wsimport, xxd + * Improved completions: + - acpi, chpasswd, dmesg, gkrellm, groupmems, hwclock, lastlog, pwd, vipw: + Complete options even without "-" given. + - arpspoof, dsniff, ether-wake, nmap: Offer active interfaces only. + - clzip, pdlzip, plzip: New lzip alias completions. + - colormake: New make alias completion (LP: #743208, Debian: #682557) + - cpio: Recognize pass thru when -p is bundled w/other options + (RedHat: #912113). + - cppcheck: Add --language/-x argument completion. + - cppcheck: Complete --include= with filenames. + - dnsspoof, filesnarf, macof, sshow, tcpkill, tcpnice, urlsnarf: Fix -i + completion. + - genisoimage: Use _parse_help instead of hardcoding options, add basic test + case. + - groupmems: Add -R/--root arg completion. + - hexdump: Actually install for hd as well. + - host: Complete with known hosts. + - ip: Improve addr show and link show completions. + - ip: Remove some stale TODOs. + - jar: Reuse unzip's xspec (RedHat: #928253). + - koji: Complete on build targets when --target is given to wait-repo. + - lv{create,resize,extend}, vg{create,reduce,extend,split}: Fix variable + leaks. + - lvm: Add _lvm prefix to helper functions. + - lvm: Take option args into account when counting args (RedHat: #860510). + - lvm volumes: Complete on /dev/mapper/* (RedHat: #851787). + - lzip: Do not append space after equal sign in long options. + - make: Convert internal variable names to lowercase, indentation fix. + - make: Don't leak $mode. + - make: Make work in POSIX mode. + - man: Add support for .lz man pages (RedHat: #839310). + - man: Don't expand man page extensions too early. + - man: Fix -P/--pager full path arg completion. + - modinfo: Use ,, for lowercasing instead of tr in a subshell. + - modprobe: Don't suggest installing already installed modules. + - ncftp: Add option completion. + - pkg-config: Try to complete --variable= if package name is already given. + - pydoc: Complete on keywords and topics. + - python, pydoc: Add module completion. + - scp: Treat strings with slash before colon or starting with [.~] as local. + - ssh: Add some -o and related arg completions. + - ssh: Add -O argument completion (Debian: #680652). + - tar: Don't take -I to mean bzip2. + - tar: Fix completing files inside *.tlz when J is explicitly given. + - tar: Simplify bzip patterns. + - tar: Support *.tar.lz (Debian: #703599). + - tar: Recognize taz and tb2 as compressed tarballs. + - tcpdump: Fix -z full path arg completion. + - unzip/zipinfo: Associate with more StarOffice extensions. + - useradd, userdel, usermod: Add -R/--root arg completion. + - useradd, usermod: Support comma separated -G/--groups arg completion. + - useradd: Fix -k, -K, and --home-dir argument completions. + - userdel: Add -h/--help non-completion. + - valgrind: Fix full path <command> arg completion. + - vgcreate: Add missing symlink. + - vipw: Add -R/--root arg completion. + - vpnc: Add bunch of option arg (non)completions. + - vpnc: Use _parse_help instead of hardcoding options, add basic test case. + - wget: Use == instead of =. + - wine: Fix extension glob to work on its own. + - wol: Try "ip addr" before ifconfig for finding out broadcast addresses. + - xrandr: Add bunch of option arg non-completions. + - xrandr: Use _parse_help. + - xrandr --mode: Clean up one awk call. + - xrandr: Avoid --mode completion error when --output is not given. + - xrandr: Don't leak $i when completing --mode. + * Deprecated completions: + - udevadm: one is shipped in systemd >= 196 (RedHat: #919246). + * Testsuite: + - Make pydoc test more likely to work with our limited expect buffer size. + - Fix pwd unit test + + [ Yann Rouillard ] + * New completions: pkgutil, pkgrm, pkgadd, pkg-get, svcadm. + + [ wonder.mice ] + * Fixed tilde expanding in _filedir_xspec + + -- David Paleino <d.paleino@gmail.com> Fri, 05 Apr 2013 12:05:15 +0200 + bash-completion (2.0) [ Anthony Ramine ] @@ -324,7 +486,7 @@ bash-completion (1.90) bash-completion (1.3) [ Guillaume Rousse ] - * added pure-perl perldoc completion helper, using work from Aristotle + * added pure-perl perldoc completion helper, using work from Aristotle Pagaltzis (pagaltzis@gmx.de) * added completions for xfreerdp and iscsiadm * updated xm subcommands list @@ -880,7 +1042,7 @@ bash-completion (1.0) 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) + 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. @@ -898,7 +1060,7 @@ bash-completion (1.0) bash-completion (20080705) unstable; urgency=low [ David Paleino ] - * Added more completions to imagemagick (thanks to Nelson A. de + * 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: @@ -931,7 +1093,7 @@ bash-completion (20080617.4) experimental; urgency=low - refactored _filedir_xspec using quote_readline() - fixed COMPREPLY's in _iwconfig - fixed _cvs() - - _known_hosts(): use files from UserKnownHostsFile options in + - _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) @@ -999,7 +1161,7 @@ bash-completion (20080617) unstable; urgency=low - 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, + - 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 @@ -1007,7 +1169,7 @@ bash-completion (20080617) unstable; urgency=low (Debian: #455510) - fixes Perl completion (Debian: #470742) - fixes get_cword -> _get_cword typo (Debian: #478596) - - fixes _get_cword() function to properly handle filenames with + - 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) diff --git a/Makefile.in b/Makefile.in index 297e66b7..488f4d08 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.5 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -623,7 +623,7 @@ distcheck: dist *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod a+w $(distdir) + chmod -R a-w $(distdir); chmod u+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.11.5 -*- Autoconf -*- +# generated automatically by aclocal 1.11.6 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, @@ -38,7 +38,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [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.5], [], +m4_if([$1], [1.11.6], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -54,7 +54,7 @@ m4_define([_AM_AUTOCONF_VERSION], []) # 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.5])dnl +[AM_AUTOMAKE_VERSION([1.11.6])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) diff --git a/bash_completion b/bash_completion index d6ae8ae4..6d3ba762 100644 --- a/bash_completion +++ b/bash_completion @@ -3,7 +3,7 @@ # bash_completion - programmable completion functions for bash 4.1+ # # Copyright © 2006-2008, Ian Macdonald <ian@caliban.org> -# © 2009-2011, Bash Completion Maintainers +# © 2009-2013, Bash Completion Maintainers # <bash-completion-devel@lists.alioth.debian.org> # # This program is free software; you can redistribute it and/or modify @@ -24,7 +24,7 @@ # # http://bash-completion.alioth.debian.org/ # -# RELEASE: 1.99 +# RELEASE: 2.1 if [[ $- == *v* ]]; then BASH_COMPLETION_ORIGINAL_V_VALUE="-v" @@ -184,7 +184,7 @@ _upvar() # Assign variables one scope above the caller -# Usage: local varname [varname ...] && +# Usage: local varname [varname ...] && # _upvars [-v varname value] | [-aN varname [value ...]] ... # Available OPTIONS: # -aN Assign next N values to varname as array @@ -208,7 +208,7 @@ _upvars() "${FUNCNAME[0]}: \`$1': invalid number specifier" 1>&2 return 1; } # Assign array of -aN elements - [[ "$2" ]] && unset -v "$2" && eval $2=\(\"\${@:3:${1#-a}}\"\) && + [[ "$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; } ;; @@ -244,7 +244,7 @@ __reassemble_comp_words_by_ref() # 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? @@ -284,6 +284,7 @@ __reassemble_comp_words_by_ref() # Indicate new cword [[ $i == $COMP_CWORD ]] && eval $3=$j done + [[ $i == $COMP_CWORD ]] && eval $3=$j else # No, list of word completions separators hasn't changed; eval $2=\( \"\${COMP_WORDS[@]}\" \) @@ -355,7 +356,7 @@ __get_cword_at_cursor_by_ref() # cword Return cword via $cword # # Available OPTIONS: -# -n EXCLUDE Characters out of $COMP_WORDBREAKS which should NOT be +# -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. @@ -383,7 +384,7 @@ _get_comp_words_by_ref() w) vwords=$OPTARG ;; esac done - while [[ $# -ge $OPTIND ]]; do + while [[ $# -ge $OPTIND ]]; do case ${!OPTIND} in cur) vcur=cur ;; prev) vprev=prev ;; @@ -399,7 +400,7 @@ _get_comp_words_by_ref() [[ $vcur ]] && { upvars+=("$vcur" ); upargs+=(-v $vcur "$cur" ); } [[ $vcword ]] && { upvars+=("$vcword"); upargs+=(-v $vcword "$cword"); } - [[ $vprev && $cword -ge 1 ]] && { upvars+=("$vprev" ); upargs+=(-v $vprev + [[ $vprev && $cword -ge 1 ]] && { upvars+=("$vprev" ); upargs+=(-v $vprev "${words[cword - 1]}"); } [[ $vwords ]] && { upvars+=("$vwords"); upargs+=(-a${#words[@]} $vwords "${words[@]}"); } @@ -479,7 +480,7 @@ _get_cword() # @deprecated Use `_get_comp_words_by_ref cur prev' instead # @see _get_comp_words_by_ref() # -_get_pword() +_get_pword() { if [[ $COMP_CWORD -ge 1 ]]; then _get_cword "${@:-}" 1 @@ -508,7 +509,7 @@ __ltrim_colon_completions() { if [[ "$1" == *:* && "$COMP_WORDBREAKS" == *:* ]]; then # Remove colon-word prefix from COMPREPLY items - local colon_word=${1%${1##*:}} + local colon_word=${1%"${1##*:}"} local i=${#COMPREPLY[*]} while [[ $((--i)) -ge 0 ]]; do COMPREPLY[$i]=${COMPREPLY[$i]#"$colon_word"} @@ -617,7 +618,7 @@ _split_longopt() } # Complete variables. -# @return True (0) if variables were completed, +# @return True (0) if variables were completed, # False (> 0) if not. _variables() { @@ -642,7 +643,7 @@ _variables() # -o XSPEC Passed to _filedir as first arg for other output redirections # -i XSPEC Passed to _filedir as first arg for stdin redirections # -s Split long options with _split_longopt, implies -n = -# @return True (0) if completion needs further processing, +# @return True (0) if completion needs further processing, # False (> 0) no further processing is necessary. # _init_completion() @@ -755,7 +756,7 @@ _parse_help() local line { case $cmd in -) cat ;; - *) "$( dequote "$cmd" )" ${2:---help} 2>&1 ;; + *) LC_ALL=C "$( dequote "$cmd" )" ${2:---help} 2>&1 ;; esac } \ | while read -r line; do @@ -780,7 +781,7 @@ _parse_usage() local line match option i char { case $cmd in -) cat ;; - *) "$( dequote "$cmd" )" ${2:---usage} 2>&1 ;; + *) LC_ALL=C "$( dequote "$cmd" )" ${2:---usage} 2>&1 ;; esac } \ | while read -r line; do @@ -820,14 +821,19 @@ _mac_addresses() local re='\([A-Fa-f0-9]\{2\}:\)\{5\}[A-Fa-f0-9]\{2\}' local PATH="$PATH:/sbin:/usr/sbin" - # Local interfaces (Linux: HWAddr, FreeBSD: ether) - COMPREPLY+=( $( ifconfig -a 2>/dev/null | sed -ne \ + # Local interfaces + # - ifconfig on Linux: HWaddr or ether + # - ifconfig on FreeBSD: ether + # - ip link: link/ether + COMPREPLY+=( $( { ifconfig -a || ip link show; } 2>/dev/null | sed -ne \ + "s/.*[[:space:]]HWaddr[[:space:]]\{1,\}\($re\)[[:space:]].*/\1/p" -ne \ "s/.*[[:space:]]HWaddr[[:space:]]\{1,\}\($re\)[[:space:]]*$/\1/p" -ne \ - "s/^[[:space:]]\{1,\}ether[[:space:]]\{1,\}\($re\)[[:space:]]*$/\1/p" \ + "s|.*[[:space:]]\(link/\)\{0,1\}ether[[:space:]]\{1,\}\($re\)[[:space:]].*|\2|p" -ne \ + "s|.*[[:space:]]\(link/\)\{0,1\}ether[[:space:]]\{1,\}\($re\)[[:space:]]*$|\2|p" ) ) # ARP cache - COMPREPLY+=( $( arp -an 2>/dev/null | sed -ne \ + COMPREPLY+=( $( { arp -an || ip neigh show; } 2>/dev/null | sed -ne \ "s/.*[[:space:]]\($re\)[[:space:]].*/\1/p" -ne \ "s/.*[[:space:]]\($re\)[[:space:]]*$/\1/p" ) ) @@ -869,10 +875,11 @@ _configured_interfaces() # _ip_addresses() { + local PATH=$PATH:/sbin COMPREPLY+=( $( compgen -W \ - "$( PATH="$PATH:/sbin" LC_ALL=C ifconfig -a | + "$( { LC_ALL=C ifconfig -a || ip addr show; } 2>/dev/null | sed -ne 's/.*addr:\([^[:space:]]*\).*/\1/p' \ - -ne 's/.*inet[[:space:]]\{1,\}\([^[:space:]]*\).*/\1/p' )" \ + -ne 's|.*inet[[:space:]]\{1,\}\([^[:space:]/]*\).*|\1|p' )" \ -- "$cur" ) ) } @@ -889,18 +896,18 @@ _kernel_versions() # _available_interfaces() { - local cmd + local cmd PATH=$PATH:/sbin if [[ ${1:-} == -w ]]; then cmd="iwconfig" elif [[ ${1:-} == -a ]]; then - cmd="ifconfig" + cmd="{ ifconfig || ip link show up; }" else - cmd="ifconfig -a" + cmd="{ ifconfig -a || ip link show; }" fi - COMPREPLY=( $( eval PATH="$PATH:/sbin" $cmd 2>/dev/null | \ - awk '/^[^ \t]/ { print $1 }' ) ) + COMPREPLY=( $( eval $cmd 2>/dev/null | awk \ + '/^[^ \t]/ { if ($1 ~ /^[0-9]+:/) { print $2 } else { print $1 } }' ) ) COMPREPLY=( $( compgen -W '${COMPREPLY[@]/%[[:punct:]]/}' -- "$cur" ) ) } @@ -914,7 +921,7 @@ _ncpus() } # Perform tilde (~) completion -# @return True (0) if completion needs further processing, +# @return True (0) if completion needs further processing, # False (> 0) if tilde is followed by a valid username, completions # are put in COMPREPLY and no further processing is necessary. _tilde() @@ -951,7 +958,7 @@ _tilde() # ~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() { @@ -966,7 +973,7 @@ __expand_tilde_by_ref() # becomes "b". Single quotes prevent eval. # +-----1----+ +---2----+ eval $1="${!1/%\/*}"/'${!1#*/}' - else + else # No, $1 doesn't contain slash eval $1="${!1}" fi @@ -1546,7 +1553,8 @@ _known_hosts_real() # Add hosts reported by ruptime. COMPREPLY+=( $( compgen -W \ - "$( ruptime 2>/dev/null | awk '{ print $1 }' )" -- "$cur" ) ) + "$( ruptime 2>/dev/null | awk '!/^ruptime:/ { print $1 }' )" \ + -- "$cur" ) ) # Add results of normal hostname completion, unless # `COMP_KNOWN_HOSTS_WITH_HOSTFILE' is set to an empty value. @@ -1699,16 +1707,13 @@ _command_offset() fi # restore initial compopts - local opt t - while true; do + local opt + while [[ $cspec == *" -o "* ]]; do # FIXME: should we take "+o opt" into account? - t=${cspec#*-o } - if [[ $t == $cspec ]]; then - break - fi - opt=${t%% *} + cspec=${cspec#*-o } + opt=${cspec%% *} compopt -o $opt - cspec=${t#$opt} + cspec=${cspec#$opt} done else cspec=${cspec#complete} @@ -1789,9 +1794,9 @@ _longopt() complete -F _longopt a2ps awk base64 bash bc bison cat colordiff cp csplit \ cut date df diff dir du enscript env expand fmt fold gperf \ grep grub head indent irb ld ldd less ln ls m4 md5sum mkdir mkfifo mknod \ - mv netstat nl nm objcopy objdump od paste patch pr ptx readelf rm rmdir \ + mv netstat nl nm objcopy objdump od paste pr ptx readelf rm rmdir \ sed seq sha{,1,224,256,384,512}sum shar sort split strip sum tac tail tee \ - texindex touch tr uname unexpand uniq units vdir wc wget who + texindex touch tr uname unexpand uniq units vdir wc who declare -A _xspecs _filedir_xspec() @@ -1799,7 +1804,7 @@ _filedir_xspec() local cur prev words cword _init_completion || return - _expand || return 0 + _tilde "$cur" || return 0 local IFS=$'\n' xspec=${_xspecs[${1##*/}]} tmp local -a toks @@ -1847,7 +1852,7 @@ _install_xspec() } # bzcmp, bzdiff, bz*grep, bzless, bzmore intentionally not here, see Debian: #455510 _install_xspec '!*.?(t)bz?(2)' bunzip2 bzcat pbunzip2 pbzcat lbunzip2 lbzcat -_install_xspec '!*.@(zip|[ejsw]ar|exe|pk3|wsz|zargo|xpi|sxw|o[tx]t|od[fgpst]|epub|apk)' unzip zipinfo +_install_xspec '!*.@(zip|[ejsw]ar|exe|pk3|wsz|zargo|xpi|s[tx][cdiw]|sx[gm]|o[dt][tspgfc]|od[bm]|oxt|epub|apk|do[ct][xm]|p[op]t[mx]|xl[st][xm])' unzip zipinfo _install_xspec '*.Z' compress znew # zcmp, zdiff, z*grep, zless, zmore intentionally not here, see Debian: #455510 _install_xspec '!*.@(Z|[gGd]z|t[ag]z)' gunzip zcat unpigz @@ -1866,6 +1871,7 @@ _install_xspec '!*.[pf]df' acroread gpdf xpdf _install_xspec '!*.@(?(e)ps|pdf)' kpdf _install_xspec '!*.@(okular|@(?(e|x)ps|?(E|X)PS|[pf]df|[PF]DF|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?(2)|FB?(2)|mobi|MOBI|g3|G3|chm|CHM)?(.?(gz|GZ|bz2|BZ2)))' okular _install_xspec '!*.pdf' epdfview +_install_xspec '!*.@(cb[rz7t]|djv?(u)|?(e)ps|pdf)' zathura _install_xspec '!*.@(?(e)ps|pdf)' ps2pdf ps2pdf12 ps2pdf13 ps2pdf14 ps2pdfwr _install_xspec '!*.texi*' makeinfo texi2html _install_xspec '!*.@(?(la)tex|texi|dtx|ins|ltx|dbj)' tex latex slitex jadetex pdfjadetex pdftex pdflatex texi2dvi @@ -1884,7 +1890,7 @@ _install_xspec '!*.@(669|abc|am[fs]|d[bs]m|dmf|far|it|mdl|m[eo]d|mid?(i)|mt[2m]| _install_xspec '*.@(o|so|so.!(conf|*/*)|a|[rs]pm|gif|jp?(e)g|mp3|mp?(e)g|avi|asf|ogg|class)' vi vim gvim rvim view rview rgvim rgview gview emacs xemacs sxemacs kate kwrite _install_xspec '!*.@(zip|z|gz|tgz)' bzme # konqueror not here on purpose, it's more than a web/html browser -_install_xspec '!*.@(?([xX]|[sS])[hH][tT][mM]?([lL]))' netscape mozilla lynx opera galeon dillo elinks amaya firefox mozilla-firefox iceweasel google-chrome chromium-browser epiphany +_install_xspec '!*.@(?([xX]|[sS])[hH][tT][mM]?([lL]))' netscape mozilla lynx galeon dillo elinks amaya firefox mozilla-firefox iceweasel google-chrome chromium-browser epiphany _install_xspec '!*.@(sxw|stw|sxg|sgl|doc?([mx])|dot?([mx])|rtf|txt|htm|html|?(f)odt|ott|odm)' oowriter _install_xspec '!*.@(sxi|sti|pps?(x)|ppt?([mx])|pot?([mx])|?(f)odp|otp)' ooimpress _install_xspec '!*.@(sxc|stc|xls?([bmx])|xlw|xlt?([mx])|[ct]sv|?(f)ods|ots)' oocalc @@ -1900,6 +1906,7 @@ _install_xspec '!*.ly' lilypond ly2dvi _install_xspec '!*.@(dif?(f)|?(d)patch)?(.@([gx]z|bz2|lzma))' cdiff _install_xspec '!@(*.@(ks|jks|jceks|p12|pfx|bks|ubr|gkr|cer|crt|cert|p7b|pkipath|pem|p10|csr|crl)|cacerts)' portecle _install_xspec '!*.@(mp[234c]|og[ag]|@(fl|a)ac|m4[abp]|spx|tta|w?(a)v|wma|aif?(f)|asf|ape)' kid3 kid3-qt +_install_xspec '!*.py' pyflakes unset -f _install_xspec # Minimal completion to use as fallback in _completion_loader. @@ -1918,11 +1925,12 @@ complete -F _minimal '' # set up dynamic completion loading _completion_loader() { - local compdir=./completions - [[ $BASH_SOURCE == */* ]] && compdir="${BASH_SOURCE%/*}/completions" + local compfile=./completions + [[ $BASH_SOURCE == */* ]] && compfile="${BASH_SOURCE%/*}/completions" + compfile+="/${1##*/}" - # Try basename. - . "$compdir/${1##*/}" &>/dev/null && return 124 + # Avoid trying to source dirs; https://bugzilla.redhat.com/903540 + [[ -f "$compfile" ]] && . "$compfile" &>/dev/null && return 124 # Need to define *something*, otherwise there will be no completion at all. complete -F _minimal "$1" && return 124 diff --git a/completions/Makefile.am b/completions/Makefile.am index 0a24d0cd..f312b3a9 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -41,6 +41,7 @@ bashcomp_DATA = a2x \ chkconfig \ chown \ chpasswd \ + chronyc \ chrpath \ chsh \ cksfv \ @@ -75,6 +76,8 @@ bashcomp_DATA = a2x \ dumpe2fs \ e2freefrag \ e2label \ + eject \ + eog \ ether-wake \ evince \ explodepkg \ @@ -84,6 +87,7 @@ bashcomp_DATA = a2x \ fbi \ feh \ file \ + file-roller \ filefrag \ filesnarf \ find \ @@ -105,6 +109,7 @@ bashcomp_DATA = a2x \ gpasswd \ gpg \ gpg2 \ + gphoto2 \ gprof \ groupadd \ groupdel \ @@ -115,6 +120,7 @@ bashcomp_DATA = a2x \ gzip \ hcitool \ hddtemp \ + hexdump \ hid2hci \ hping2 \ htop \ @@ -129,6 +135,7 @@ bashcomp_DATA = a2x \ inject \ insmod \ installpkg \ + interdiff \ invoke-rc.d \ ionice \ ip \ @@ -175,6 +182,10 @@ bashcomp_DATA = a2x \ lpr \ lrzip \ lsof \ + lua \ + luac \ + luseradd \ + luserdel \ lvm \ lzip \ lzma \ @@ -207,29 +218,39 @@ bashcomp_DATA = a2x \ munin-node-configure \ munin-run \ munin-update \ + mussh \ mutt \ mysql \ mysqladmin \ + nc \ ncftp \ nethogs \ newgrp \ newlist \ newusers \ + ngrep \ nmap \ + nmcli \ nslookup \ ntpdate \ openssl \ + opera \ p4 \ pack200 \ passwd \ + patch \ perl \ pgrep \ pidof \ pine \ ping \ pkg-config \ + pkg-get \ pkg_delete \ + pkgadd \ + pkgrm \ pkgtool \ + pkgutil \ plague-client \ pm-hibernate \ pm-is-supported \ @@ -250,6 +271,8 @@ bashcomp_DATA = a2x \ pwd \ pwdx \ pwgen \ + pydoc \ + pylint \ python \ qdbus \ qemu \ @@ -288,6 +311,7 @@ bashcomp_DATA = a2x \ smbclient \ snownews \ sqlite3 \ + ss \ ssh \ ssh-add \ ssh-copy-id \ @@ -295,8 +319,10 @@ bashcomp_DATA = a2x \ sshmitm \ sshow \ strace \ + strings \ su \ sudo \ + svcadm \ svk \ sync_members \ sysbench \ @@ -306,8 +332,8 @@ bashcomp_DATA = a2x \ tcpkill \ tcpnice \ tracepath \ + tshark \ tune2fs \ - udevadm \ umount \ umount.linux \ unace \ @@ -328,10 +354,12 @@ bashcomp_DATA = a2x \ vpnc \ watch \ webmitm \ + wget \ wine \ withlist \ wodim \ wol \ + wsimport \ wtf \ wvdial \ xfreerdp \ @@ -345,13 +373,14 @@ bashcomp_DATA = a2x \ xrandr \ xrdb \ xsltproc \ + xxd \ xz \ xzdec \ ypmatch \ yum-arch EXTRA_DIST = $(bashcomp_DATA) \ - _mock _modules _subversion _yum _yum-utils + _mock _modules _subversion _udevadm _yum _yum-utils CLEANFILES = \ aclocal-1.11 \ @@ -374,7 +403,9 @@ CLEANFILES = \ ciptool \ civclient \ civserver \ + clzip \ co \ + colormake \ compare \ compgen \ composite \ @@ -404,6 +435,7 @@ CLEANFILES = \ gpc \ hciattach \ hciconfig \ + hd \ host \ hping \ hping3 \ @@ -425,6 +457,7 @@ CLEANFILES = \ ldappasswd \ ldapwhoami \ lintian-info \ + lusermod \ lvchange \ lvcreate \ lvdisplay \ @@ -448,6 +481,7 @@ CLEANFILES = \ ncal \ pbzip2 \ pccardctl \ + pdlzip \ perldoc \ phing \ pigz \ @@ -456,6 +490,7 @@ CLEANFILES = \ pkg_deinstall \ pkg_info \ pkill \ + plzip \ pm-suspend \ pm-suspend-hybrid \ pmake \ @@ -475,6 +510,7 @@ CLEANFILES = \ pvs \ pvscan \ pxz \ + pydoc3 \ python2 \ python3 \ quotacheck \ @@ -515,6 +551,7 @@ CLEANFILES = \ vgchange \ vgck \ vgconvert \ + vgcreate \ vgdisplay \ vgexport \ vgextend \ @@ -533,7 +570,7 @@ CLEANFILES = \ xvnc4viewer \ ypcat -symlinks: $(targetdir) +symlinks: $(targetdir) $(DATA) for file in aclocal-1.11 ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) aclocal $(targetdir)/$$file ; \ @@ -632,6 +669,10 @@ symlinks: $(targetdir) rm -f $(targetdir)/$$file && \ $(LN_S) hcitool $(targetdir)/$$file ; \ done + for file in hd ; do \ + rm -f $(targetdir)/$$file && \ + $(LN_S) hexdump $(targetdir)/$$file ; \ + done for file in hping hping3 ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) hping2 $(targetdir)/$$file ; \ @@ -665,16 +706,24 @@ symlinks: $(targetdir) rm -f $(targetdir)/$$file && \ $(LN_S) lintian $(targetdir)/$$file ; \ done + for file in lusermod ; do \ + rm -f $(targetdir)/$$file && \ + $(LN_S) luseradd $(targetdir)/$$file ; \ + done for file in lvmdiskscan pvscan pvs pvdisplay pvchange pvcreate pvmove \ pvremove vgscan vgs vgdisplay vgchange vgremove vgrename \ - vgreduce vgextend vgimport vgexport vgck vgconvert \ + vgreduce vgextend vgimport vgexport vgck vgconvert vgcreate \ vgcfgbackup vgcfgrestore vgmerge vgsplit vgmknodes lvscan lvs \ lvdisplay lvchange lvcreate lvremove lvrename lvreduce \ lvresize lvextend ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) lvm $(targetdir)/$$file ; \ done - for file in gmake gnumake pmake ; do \ + for file in clzip pdlzip plzip ; do \ + rm -f $(targetdir)/$$file && \ + $(LN_S) lzip $(targetdir)/$$file ; \ + done + for file in colormake gmake gnumake pmake ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) make $(targetdir)/$$file ; \ done @@ -743,6 +792,10 @@ symlinks: $(targetdir) rm -f $(targetdir)/$$file && \ $(LN_S) puppet $(targetdir)/$$file ; \ done + for file in pydoc3 ; do \ + rm -f $(targetdir)/$$file && \ + $(LN_S) pydoc $(targetdir)/$$file ; \ + done for file in python2 python3 ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) python $(targetdir)/$$file ; \ diff --git a/completions/Makefile.in b/completions/Makefile.in index 8c8824e4..fef6ebc6 100644 --- a/completions/Makefile.in +++ b/completions/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.5 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -212,6 +212,7 @@ bashcomp_DATA = a2x \ chkconfig \ chown \ chpasswd \ + chronyc \ chrpath \ chsh \ cksfv \ @@ -246,6 +247,8 @@ bashcomp_DATA = a2x \ dumpe2fs \ e2freefrag \ e2label \ + eject \ + eog \ ether-wake \ evince \ explodepkg \ @@ -255,6 +258,7 @@ bashcomp_DATA = a2x \ fbi \ feh \ file \ + file-roller \ filefrag \ filesnarf \ find \ @@ -276,6 +280,7 @@ bashcomp_DATA = a2x \ gpasswd \ gpg \ gpg2 \ + gphoto2 \ gprof \ groupadd \ groupdel \ @@ -286,6 +291,7 @@ bashcomp_DATA = a2x \ gzip \ hcitool \ hddtemp \ + hexdump \ hid2hci \ hping2 \ htop \ @@ -300,6 +306,7 @@ bashcomp_DATA = a2x \ inject \ insmod \ installpkg \ + interdiff \ invoke-rc.d \ ionice \ ip \ @@ -346,6 +353,10 @@ bashcomp_DATA = a2x \ lpr \ lrzip \ lsof \ + lua \ + luac \ + luseradd \ + luserdel \ lvm \ lzip \ lzma \ @@ -378,29 +389,39 @@ bashcomp_DATA = a2x \ munin-node-configure \ munin-run \ munin-update \ + mussh \ mutt \ mysql \ mysqladmin \ + nc \ ncftp \ nethogs \ newgrp \ newlist \ newusers \ + ngrep \ nmap \ + nmcli \ nslookup \ ntpdate \ openssl \ + opera \ p4 \ pack200 \ passwd \ + patch \ perl \ pgrep \ pidof \ pine \ ping \ pkg-config \ + pkg-get \ pkg_delete \ + pkgadd \ + pkgrm \ pkgtool \ + pkgutil \ plague-client \ pm-hibernate \ pm-is-supported \ @@ -421,6 +442,8 @@ bashcomp_DATA = a2x \ pwd \ pwdx \ pwgen \ + pydoc \ + pylint \ python \ qdbus \ qemu \ @@ -459,6 +482,7 @@ bashcomp_DATA = a2x \ smbclient \ snownews \ sqlite3 \ + ss \ ssh \ ssh-add \ ssh-copy-id \ @@ -466,8 +490,10 @@ bashcomp_DATA = a2x \ sshmitm \ sshow \ strace \ + strings \ su \ sudo \ + svcadm \ svk \ sync_members \ sysbench \ @@ -477,8 +503,8 @@ bashcomp_DATA = a2x \ tcpkill \ tcpnice \ tracepath \ + tshark \ tune2fs \ - udevadm \ umount \ umount.linux \ unace \ @@ -499,10 +525,12 @@ bashcomp_DATA = a2x \ vpnc \ watch \ webmitm \ + wget \ wine \ withlist \ wodim \ wol \ + wsimport \ wtf \ wvdial \ xfreerdp \ @@ -516,13 +544,14 @@ bashcomp_DATA = a2x \ xrandr \ xrdb \ xsltproc \ + xxd \ xz \ xzdec \ ypmatch \ yum-arch EXTRA_DIST = $(bashcomp_DATA) \ - _mock _modules _subversion _yum _yum-utils + _mock _modules _subversion _udevadm _yum _yum-utils CLEANFILES = \ aclocal-1.11 \ @@ -545,7 +574,9 @@ CLEANFILES = \ ciptool \ civclient \ civserver \ + clzip \ co \ + colormake \ compare \ compgen \ composite \ @@ -575,6 +606,7 @@ CLEANFILES = \ gpc \ hciattach \ hciconfig \ + hd \ host \ hping \ hping3 \ @@ -596,6 +628,7 @@ CLEANFILES = \ ldappasswd \ ldapwhoami \ lintian-info \ + lusermod \ lvchange \ lvcreate \ lvdisplay \ @@ -619,6 +652,7 @@ CLEANFILES = \ ncal \ pbzip2 \ pccardctl \ + pdlzip \ perldoc \ phing \ pigz \ @@ -627,6 +661,7 @@ CLEANFILES = \ pkg_deinstall \ pkg_info \ pkill \ + plzip \ pm-suspend \ pm-suspend-hybrid \ pmake \ @@ -646,6 +681,7 @@ CLEANFILES = \ pvs \ pvscan \ pxz \ + pydoc3 \ python2 \ python3 \ quotacheck \ @@ -686,6 +722,7 @@ CLEANFILES = \ vgchange \ vgck \ vgconvert \ + vgcreate \ vgdisplay \ vgexport \ vgextend \ @@ -914,7 +951,7 @@ uninstall-am: uninstall-bashcompDATA uninstall-bashcompDATA -symlinks: $(targetdir) +symlinks: $(targetdir) $(DATA) for file in aclocal-1.11 ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) aclocal $(targetdir)/$$file ; \ @@ -1013,6 +1050,10 @@ symlinks: $(targetdir) rm -f $(targetdir)/$$file && \ $(LN_S) hcitool $(targetdir)/$$file ; \ done + for file in hd ; do \ + rm -f $(targetdir)/$$file && \ + $(LN_S) hexdump $(targetdir)/$$file ; \ + done for file in hping hping3 ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) hping2 $(targetdir)/$$file ; \ @@ -1046,16 +1087,24 @@ symlinks: $(targetdir) rm -f $(targetdir)/$$file && \ $(LN_S) lintian $(targetdir)/$$file ; \ done + for file in lusermod ; do \ + rm -f $(targetdir)/$$file && \ + $(LN_S) luseradd $(targetdir)/$$file ; \ + done for file in lvmdiskscan pvscan pvs pvdisplay pvchange pvcreate pvmove \ pvremove vgscan vgs vgdisplay vgchange vgremove vgrename \ - vgreduce vgextend vgimport vgexport vgck vgconvert \ + vgreduce vgextend vgimport vgexport vgck vgconvert vgcreate \ vgcfgbackup vgcfgrestore vgmerge vgsplit vgmknodes lvscan lvs \ lvdisplay lvchange lvcreate lvremove lvrename lvreduce \ lvresize lvextend ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) lvm $(targetdir)/$$file ; \ done - for file in gmake gnumake pmake ; do \ + for file in clzip pdlzip plzip ; do \ + rm -f $(targetdir)/$$file && \ + $(LN_S) lzip $(targetdir)/$$file ; \ + done + for file in colormake gmake gnumake pmake ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) make $(targetdir)/$$file ; \ done @@ -1124,6 +1173,10 @@ symlinks: $(targetdir) rm -f $(targetdir)/$$file && \ $(LN_S) puppet $(targetdir)/$$file ; \ done + for file in pydoc3 ; do \ + rm -f $(targetdir)/$$file && \ + $(LN_S) pydoc $(targetdir)/$$file ; \ + done for file in python2 python3 ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) python $(targetdir)/$$file ; \ diff --git a/completions/_mock b/completions/_mock index 020b39b4..c616aed0 100644 --- a/completions/_mock +++ b/completions/_mock @@ -27,7 +27,7 @@ _mock() return 0 ;; -r|--root) - COMPREPLY=( $( compgen -W "$( command ls $cfgdir )" -- $cur ) ) + COMPREPLY=( $( compgen -W "$( command ls $cfgdir )" -- "$cur" ) ) COMPREPLY=( ${COMPREPLY[@]/%.cfg/} ) return 0 ;; diff --git a/completions/_subversion b/completions/_subversion index 103bcb86..2f1752c0 100644 --- a/completions/_subversion +++ b/completions/_subversion @@ -18,9 +18,9 @@ _svn() if [[ $cword -eq 1 ]] ; then if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--version' -- $cur ) ) + COMPREPLY=( $( compgen -W '--version' -- "$cur" ) ) else - COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) + COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi else @@ -196,10 +196,10 @@ _svn() esac options+=" --help --config-dir" - COMPREPLY=( $( compgen -W "$options" -- $cur ) ) + COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) else if [[ "$command" == @(help|h|\?) ]]; then - COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) + COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) else _filedir fi @@ -221,9 +221,9 @@ _svnadmin() if [[ $cword -eq 1 ]] ; then if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--version' -- $cur ) ) + COMPREPLY=( $( compgen -W '--version' -- "$cur" ) ) else - COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) + COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi else case $prev in @@ -232,7 +232,7 @@ _svnadmin() return 0 ;; --fs-type) - COMPREPLY=( $( compgen -W 'fsfs bdb' -- $cur ) ) + COMPREPLY=( $( compgen -W 'fsfs bdb' -- "$cur" ) ) return 0 ;; esac @@ -269,10 +269,10 @@ _svnadmin() esac options+=" --help" - COMPREPLY=( $( compgen -W "$options" -- $cur ) ) + COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) else if [[ "$command" == @(help|h|\?) ]]; then - COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) + COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) else _filedir fi @@ -294,9 +294,9 @@ _svnlook() if [[ $cword -eq 1 ]] ; then if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--version' -- $cur ) ) + COMPREPLY=( $( compgen -W '--version' -- "$cur" ) ) else - COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) + COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) fi else local command=${words[1]} @@ -327,10 +327,10 @@ _svnlook() esac options+=" --help" - COMPREPLY=( $( compgen -W "$options" -- $cur ) ) + COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) else if [[ "$command" == @(help|h|\?) ]]; then - COMPREPLY=( $( compgen -W "$commands" -- $cur ) ) + COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) else _filedir fi diff --git a/completions/udevadm b/completions/_udevadm index e8db7142..51ec0e5d 100644 --- a/completions/udevadm +++ b/completions/_udevadm @@ -1,5 +1,8 @@ # udevadm(8) completion -*- shell-script -*- +# Use of this file is deprecated. Upstream completion is available in +# systemd >= 196, use that instead. + _udevadm() { local cur prev words cword split diff --git a/completions/_yum b/completions/_yum index 9860c540..7b3f76a4 100644 --- a/completions/_yum +++ b/completions/_yum @@ -75,22 +75,22 @@ _yum() case $prev in list) - COMPREPLY=( $( compgen -W 'all available updates \ - installed extras obsoletes recent' -- $cur ) ) + COMPREPLY=( $( compgen -W 'all available updates installed extras + obsoletes recent' -- "$cur" ) ) ;; clean) - COMPREPLY=( $( compgen -W 'packages headers metadata \ - cache dbcache all' -- $cur ) ) + COMPREPLY=( $( compgen -W 'packages headers metadata cache dbcache + all' -- "$cur" ) ) ;; repolist) - COMPREPLY=( $( compgen -W 'all enabled disabled' -- $cur ) ) + COMPREPLY=( $( compgen -W 'all enabled disabled' -- "$cur" ) ) ;; localinstall|localupdate) # TODO: should not match *src.rpm _filedir rpm ;; -d|-e) - COMPREPLY=( $( compgen -W '{0..10}' -- $cur ) ) + COMPREPLY=( $( compgen -W '{0..10}' -- "$cur" ) ) ;; -c) _filedir @@ -99,20 +99,21 @@ _yum() _filedir -d ;; --enablerepo) - COMPREPLY=( $( compgen -W '$( _yum_repolist disabled )' -- $cur ) ) + COMPREPLY=( $( compgen -W '$( _yum_repolist disabled )' \ + -- "$cur" ) ) ;; --disablerepo) - COMPREPLY=( $( compgen -W '$( _yum_repolist enabled )' -- $cur ) ) + COMPREPLY=( $( compgen -W '$( _yum_repolist enabled )' -- "$cur" ) ) ;; --disableexcludes) COMPREPLY=( $( compgen -W '$( _yum_repolist all ) all main' \ - -- $cur ) ) + -- "$cur" ) ) ;; --enableplugin|--disableplugin) - COMPREPLY=( $( compgen -W '$( _yum_plugins )' -- $cur )) + COMPREPLY=( $( compgen -W '$( _yum_plugins )' -- "$cur" ) ) ;; --color) - COMPREPLY=( $( compgen -W 'always auto never' -- $cur )) + COMPREPLY=( $( compgen -W 'always auto never' -- "$cur" ) ) ;; -R|-x|--exclude) # argument required but no completions available @@ -123,11 +124,11 @@ _yum() 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 ) ) + 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 diff --git a/completions/acpi b/completions/acpi index ccc5b635..16ae0d6e 100644 --- a/completions/acpi +++ b/completions/acpi @@ -15,8 +15,7 @@ _acpi() ;; esac - [[ $cur == -* ]] && \ - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) } && complete -F _acpi acpi diff --git a/completions/add_members b/completions/add_members index 3a6661c2..70b916be 100644 --- a/completions/add_members +++ b/completions/add_members @@ -11,7 +11,7 @@ _add_members() return 0 ;; -w|-a|--welcome-msg|--admin-notify) - COMPREPLY=( $( compgen -W 'y n' -- "$cur") ) + COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; esac @@ -19,9 +19,8 @@ _add_members() $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--regular-members-file \ - --digest-members-file --welcome-msg \ - --admin-notify --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--regular-members-file --digest-members-file + --welcome-msg --admin-notify --help' -- "$cur" ) ) else _xfunc list_lists _mailman_lists fi diff --git a/completions/apt-build b/completions/apt-build index 8e593131..3812b20d 100644 --- a/completions/apt-build +++ b/completions/apt-build @@ -40,13 +40,13 @@ _apt_build() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --show-upgraded -u --build-dir \ - --repository-dir --build-only --build-command --reinstall \ - --rebuild --remove-builddep --no-wrapper --purge --patch \ - --patch-strip -p --yes -y --version -v --no-source' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--help --show-upgraded -u --build-dir + --repository-dir --build-only --build-command --reinstall --rebuild + --remove-builddep --no-wrapper --purge --patch --patch-strip -p + --yes -y --version -v --no-source' -- "$cur" ) ) else - COMPREPLY=( $( compgen -W 'update upgrade install remove source \ + COMPREPLY=( $( compgen -W 'update upgrade install remove source dist-upgrade world clean info clean-build update-repository' \ -- "$cur" ) ) fi diff --git a/completions/apt-cache b/completions/apt-cache index 3e2ca0db..085a964d 100644 --- a/completions/apt-cache +++ b/completions/apt-cache @@ -51,18 +51,16 @@ _apt_cache() if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-h -v -p -s -q -i -f -a -g -c \ - -o --help --version --pkg-cache --src-cache \ - --quiet --important --full --all-versions \ - --no-all-versions --generate --no-generate \ - --names-only --all-names --recurse \ - --config-file --option --installed' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '-h -v -p -s -q -i -f -a -g -c -o --help + --version --pkg-cache --src-cache --quiet --important --full + --all-versions --no-all-versions --generate --no-generate + --names-only --all-names --recurse --config-file --option + --installed' -- "$cur" ) ) else - COMPREPLY=( $( compgen -W 'add gencaches show showpkg showsrc \ - stats dump dumpavail unmet search search \ - depends rdepends pkgnames dotty xvcg \ - policy madison' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'add gencaches show showpkg showsrc stats + dump dumpavail unmet search search depends rdepends pkgnames + dotty xvcg policy madison' -- "$cur" ) ) fi diff --git a/completions/apt-get b/completions/apt-get index 43170c22..8fe36f13 100644 --- a/completions/apt-get +++ b/completions/apt-get @@ -53,20 +53,19 @@ _apt_get() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-d -f -h -v -m -q -s -y -u -t -b -c -o \ - --download-only --fix-broken --help --version --ignore-missing \ - --fix-missing --no-download --quiet --simulate --just-print \ - --dry-run --recon --no-act --yes --assume-yes --show-upgraded \ - --only-source --compile --build --ignore-hold --target-release \ - --no-upgrade --force-yes --print-uris --purge --reinstall \ - --list-cleanup --default-release --trivial-only --no-remove \ - --diff-only --no-install-recommends --tar-only --config-file \ + COMPREPLY=( $( compgen -W '-d -f -h -v -m -q -s -y -u -t -b -c -o + --download-only --fix-broken --help --version --ignore-missing + --fix-missing --no-download --quiet --simulate --just-print + --dry-run --recon --no-act --yes --assume-yes --show-upgraded + --only-source --compile --build --ignore-hold --target-release + --no-upgrade --force-yes --print-uris --purge --reinstall + --list-cleanup --default-release --trivial-only --no-remove + --diff-only --no-install-recommends --tar-only --config-file --option --auto-remove' -- "$cur" ) ) else - COMPREPLY=( $( compgen -W 'update upgrade dselect-upgrade \ - dist-upgrade install remove purge source build-dep \ - download changelog \ - check clean autoclean autoremove' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'update upgrade dselect-upgrade + dist-upgrade install remove purge source build-dep download + changelog check clean autoclean autoremove' -- "$cur" ) ) fi return 0 diff --git a/completions/aptitude b/completions/aptitude index 1afd738d..3bcfa5cf 100644 --- a/completions/aptitude +++ b/completions/aptitude @@ -18,13 +18,11 @@ _aptitude() local cur prev words cword _init_completion || return - local dashoptions - dashoptions='-S -u -i -h --help --version -s --simulate -d \ - --download-only -P --prompt -y --assume-yes -F \ - --display-format -O --sort -w --width -f -r -g \ - --with-recommends -R -G --without-recommends -t \ - --target-release -V --show-versions -D --show-deps\ - -Z -v --verbose --purge-unused --schedule-only' + local dashoptions='-S -u -i -h --help --version -s --simulate -d + --download-only -P --prompt -y --assume-yes -F --display-format -O + --sort -w --width -f -r -g --with-recommends -R -G --without-recommends + -t --target-release -V --show-versions -D --show-deps -Z -v --verbose + --purge-unused --schedule-only' local special i for (( i=0; i < ${#words[@]}-1; i++ )); do @@ -76,12 +74,11 @@ _aptitude() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W "$dashoptions" -- "$cur" ) ) else - COMPREPLY=( $( compgen -W 'update upgrade safe-upgrade forget-new \ - 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 \ - add-user-tag remove-user-tag versions' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'update upgrade safe-upgrade forget-new + 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 add-user-tag + remove-user-tag versions' -- "$cur" ) ) fi return 0 diff --git a/completions/arch b/completions/arch index 3bb5f571..74e9adec 100644 --- a/completions/arch +++ b/completions/arch @@ -10,7 +10,7 @@ _arch() case $prev in -w|-g|-d|--welcome-msg|--goodbye-msg|--digest) - COMPREPLY=( $( compgen -W 'y n' -- "$cur") ) + COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; -d|--file) @@ -22,8 +22,8 @@ _arch() $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--wipe --start --end --quiet \ - --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--wipe --start --end --quiet --help' \ + -- "$cur" ) ) else local args=$cword for (( i=1; i < cword; i++ )); do diff --git a/completions/arpspoof b/completions/arpspoof index 9c1b99f5..cf9c497a 100644 --- a/completions/arpspoof +++ b/completions/arpspoof @@ -7,7 +7,7 @@ _arpspoof() case $prev in -i) - _available_interfaces + _available_interfaces -a return 0 ;; -t) diff --git a/completions/aspell b/completions/aspell index a663fa95..b1cd4c5d 100644 --- a/completions/aspell +++ b/completions/aspell @@ -37,7 +37,8 @@ _aspell() return 0 ;; --sug-mode) - COMPREPLY=( $( compgen -W 'ultra fast normal bad-speller' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'ultra fast normal bad-speller' \ + -- "$cur" ) ) return 0 ;; --keymapping) @@ -58,31 +59,28 @@ _aspell() $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--conf= --conf-dir= --data-dir= --dict-dir= \ - --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= --master= \ - --module --add-module-search-order \ - --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 \ - --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 \ - --dont-tex-check-comments --add-tex-extension \ - --rem-tex-extension --add-sgml-check= --rem-sgml-check= \ - --add-sgml-extension --rem-sgml-extension' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--conf= --conf-dir= --data-dir= --dict-dir= + --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= --master= --module + --add-module-search-order --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 --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 + --dont-tex-check-comments --add-tex-extension --rem-tex-extension + --add-sgml-check= --rem-sgml-check= --add-sgml-extension + --rem-sgml-extension' -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace else - COMPREPLY=( $( compgen -W 'usage help check pipe list \ - config soundslike filter 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 aspell diff --git a/completions/autorpm b/completions/autorpm index 377ac987..616ad8b6 100644 --- a/completions/autorpm +++ b/completions/autorpm @@ -5,7 +5,7 @@ _autorpm() local cur prev words cword _init_completion || return - COMPREPLY=( $( compgen -W '--notty --debug --help --version auto add \ + COMPREPLY=( $( compgen -W '--notty --debug --help --version auto add fullinfo info help install list remove set' -- "$cur" ) ) } && diff --git a/completions/brctl b/completions/brctl index 441aa08f..27207158 100644 --- a/completions/brctl +++ b/completions/brctl @@ -9,10 +9,9 @@ _brctl() case $cword in 1) - COMPREPLY=( $( compgen -W "addbr delbr addif delif \ - setageing setbridgeprio setfd sethello \ - setmaxage setpathcost setportprio show \ - showmacs showstp stp" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "addbr delbr addif delif setageing + setbridgeprio setfd sethello setmaxage setpathcost setportprio + show showmacs showstp stp" -- "$cur" ) ) ;; 2) case $command in diff --git a/completions/btdownloadheadless.py b/completions/btdownloadheadless.py index 60d1962d..dc9789a9 100644 --- a/completions/btdownloadheadless.py +++ b/completions/btdownloadheadless.py @@ -13,13 +13,13 @@ _btdownload() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--max_uploads --keepalive_interval \ - --download_slice_size --request_backlog --max_message_length \ - --ip --minport --maxport --responsefile --url --saveas --timeout \ - --timeout_check_interval --max_slice_length --max_rate_period \ - --bind --upload_rate_fudge --display_interval --rerequest_interval \ - --min_peers --http_timeout --max_initiate --max_allow_in \ - --check_hashes --max_upload_rate --snub_time --spew \ + COMPREPLY=( $( compgen -W '--max_uploads --keepalive_interval + --download_slice_size --request_backlog --max_message_length + --ip --minport --maxport --responsefile --url --saveas --timeout + --timeout_check_interval --max_slice_length --max_rate_period + --bind --upload_rate_fudge --display_interval --rerequest_interval + --min_peers --http_timeout --max_initiate --max_allow_in + --check_hashes --max_upload_rate --snub_time --spew --rarest_first_cutoff --min_uploads --report_hash_failures' \ -- "$cur" ) ) else diff --git a/completions/cardctl b/completions/cardctl index 90837269..5b5bb5d5 100644 --- a/completions/cardctl +++ b/completions/cardctl @@ -6,8 +6,8 @@ _cardctl() _init_completion || return if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W 'status config ident suspend \ - resume reset eject insert scheme' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'status config ident suspend resume reset + eject insert scheme' -- "$cur" ) ) fi } && complete -F _cardctl cardctl pccardctl diff --git a/completions/cfrun b/completions/cfrun index 0be44132..7dd1beff 100644 --- a/completions/cfrun +++ b/completions/cfrun @@ -22,7 +22,7 @@ _cfrun() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-f -h -d -S -T -v' -- $cur ) ) + COMPREPLY=( $( compgen -W '-f -h -d -S -T -v' -- "$cur" ) ) else hostfile=${CFINPUTS:-/var/lib/cfengine/inputs}/cfrun.hosts for (( i=1; i < cword; i++ )); do diff --git a/completions/change_pw b/completions/change_pw index 98852583..abc7d6b1 100644 --- a/completions/change_pw +++ b/completions/change_pw @@ -15,8 +15,8 @@ _change_pw() $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--all --domain --listname \ - --password --quiet --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--all --domain --listname --password --quiet + --help' -- "$cur" ) ) fi } && diff --git a/completions/chgrp b/completions/chgrp index 7355a680..26220d9e 100644 --- a/completions/chgrp +++ b/completions/chgrp @@ -20,9 +20,9 @@ _chgrp() for w in "${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" ) ) + COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes --dereference + --no-dereference --silent --quiet --reference --recursive --verbose + --help --version $opts' -- "$cur" ) ) return 0 fi diff --git a/completions/chown b/completions/chown index f9bd9686..54d89fb8 100644 --- a/completions/chown +++ b/completions/chown @@ -25,8 +25,8 @@ _chown() for w in "${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 \ + 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 diff --git a/completions/chpasswd b/completions/chpasswd index d8a7e62c..499ec93b 100644 --- a/completions/chpasswd +++ b/completions/chpasswd @@ -18,11 +18,8 @@ _chpasswd() $split && return 0 - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace - return 0 - fi + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace } && complete -F _chpasswd chpasswd diff --git a/completions/chronyc b/completions/chronyc new file mode 100644 index 00000000..3544c753 --- /dev/null +++ b/completions/chronyc @@ -0,0 +1,69 @@ +# chronyc(1) completion -*- shell-script -*- + +_chronyc() +{ + local cur prev words cword + _init_completion || return + + case $prev in + --help|-p) + return + ;; + -h) + _known_hosts_real "$cur" + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + return + fi + + local i args=0 + for (( i=1; i < cword; i++ )); do + [[ ${words[i]} != -* && ${words[i-1]} != @(-p|-h) ]] && (( args++ )) + done + + case $args in + 0) + COMPREPLY=( $( compgen -W "$( $1 help 2>/dev/null | \ + awk 'NR > 1 { sub("\\|", " ", $1); print $1 }' )" -- "$cur" ) ) + ;; + 1) + case $prev in + accheck|cmdaccheck|delete|maxdelay|maxdelayratio|\ + maxdelaydevratio|maxpoll|minpoll|minstratum|polltarget) + _known_hosts_real "$cur" + ;; + add) + COMPREPLY=( $( compgen -W 'peer server' -- "$cur" ) ) + ;; + allow|cmdallow|cmddeny|deny) + COMPREPLY=( $( compgen -W 'all' -- "$cur" ) ) + ;; + authhash) + COMPREPLY=( $( compgen -W 'MD5 SHA1' -- "$cur" ) ) + ;; + dns) + COMPREPLY=( $( compgen -W '-n +n -4 -6 -46' -- "$cur" ) ) + ;; + local) + COMPREPLY=( $( compgen -W 'off stratum' -- "$cur" ) ) + ;; + manual) + COMPREPLY=( $( compgen -W 'list on off reset' -- "$cur" ) ) + ;; + sources|sourcestats) + COMPREPLY=( $( compgen -W '-v' -- "$cur" ) ) + ;; + esac + ;; + 2) + [[ $prev == @(peer|server) ]] && _known_hosts_real "$cur" + ;; + esac +} && +complete -F _chronyc chronyc + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/cleanarch b/completions/cleanarch index df18aaf5..7fb05299 100644 --- a/completions/cleanarch +++ b/completions/cleanarch @@ -6,8 +6,8 @@ _cleanarch() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--status --dry-run --quiet \ - --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--status --dry-run --quiet --help' \ + -- "$cur" ) ) fi } && diff --git a/completions/clisp b/completions/clisp index fd19b252..cdbf6bd2 100644 --- a/completions/clisp +++ b/completions/clisp @@ -9,9 +9,9 @@ _clisp() # completing an option (may or may not be separated by a space) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-h --help --version --license -B -K \ - -M -m -L -N -E -q --quiet --silent -w -I -ansi \ - -traditional -p -C -norc -i -c -l -o -x ' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '-h --help --version --license -B -K -M -m -L + -N -E -q --quiet --silent -w -I -ansi -traditional -p -C -norc -i + -c -l -o -x ' -- "$cur" ) ) else _filedir fi diff --git a/completions/clone_member b/completions/clone_member index 74608f96..9dd55fe8 100644 --- a/completions/clone_member +++ b/completions/clone_member @@ -15,8 +15,8 @@ _clone_member() $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--listname --remove --admin \ - --quiet --nomodify --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--listname --remove --admin --quiet + --nomodify --help' -- "$cur" ) ) fi } && diff --git a/completions/complete b/completions/complete index ebf90237..bcac435d 100644 --- a/completions/complete +++ b/completions/complete @@ -7,16 +7,16 @@ _complete() case $prev in -o) - COMPREPLY=( $( compgen -W 'bashdefault default dirnames filenames \ + COMPREPLY=( $( compgen -W 'bashdefault default dirnames filenames nospace plusdirs' -- "$cur" ) ) return 0 ;; -A) - COMPREPLY=( $( compgen -W 'alias arrayvar binding builtin command \ - directory disabled enabled export file function group \ - helptopic hostname job keyword running service setopt shopt \ - signal stopped user variable' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'alias arrayvar binding builtin command + directory disabled enabled export file function group helptopic + hostname job keyword running service setopt shopt signal + stopped user variable' -- "$cur" ) ) return 0 ;; diff --git a/completions/config_list b/completions/config_list index 50fa0500..68ab6cb7 100644 --- a/completions/config_list +++ b/completions/config_list @@ -15,8 +15,8 @@ _config_list() $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--inputfile --outputfile \ - --checkonly --verbose --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--inputfile --outputfile --checkonly + --verbose --help' -- "$cur" ) ) else _xfunc list_lists _mailman_lists fi diff --git a/completions/convert b/completions/convert index c86293a6..ffb320e2 100644 --- a/completions/convert +++ b/completions/convert @@ -4,8 +4,8 @@ _ImageMagick() { case $prev in -channel) - COMPREPLY=( $( compgen -W 'Red Green Blue Opacity \ - Matte Cyan Magenta Yellow Black' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'Red Green Blue Opacity Matte Cyan + Magenta Yellow Black' -- "$cur" ) ) return 0 ;; -colormap) @@ -13,19 +13,19 @@ _ImageMagick() return 0 ;; -colorspace) - COMPREPLY=( $( compgen -W 'GRAY OHTA RGB Transparent \ - XYZ YCbCr YIQ YPbPr YUV CMYK' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'GRAY OHTA RGB Transparent XYZ YCbCr YIQ + YPbPr YUV CMYK' -- "$cur" ) ) return 0 ;; -compose) - COMPREPLY=( $( compgen -W 'Over In Out Atop Xor Plus \ - Minus Add Subtract Difference Multiply Bumpmap\ - Copy CopyRed CopyGreen CopyBlue CopyOpacity' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'Over In Out Atop Xor Plus Minus Add + Subtract Difference Multiply Bumpmap Copy CopyRed CopyGreen + CopyBlue CopyOpacity' -- "$cur" ) ) return 0 ;; -compress) - COMPREPLY=( $( compgen -W 'None BZip Fax Group4 JPEG \ - Lossless LZW RLE Zip' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'None BZip Fax Group4 JPEG Lossless LZW + RLE Zip' -- "$cur" ) ) return 0 ;; -dispose) @@ -34,9 +34,9 @@ _ImageMagick() return 0 ;; -encoding) - COMPREPLY=( $( compgen -W 'AdobeCustom AdobeExpert \ - AdobeStandard AppleRoman BIG5 GB2312 Latin2 \ - None SJIScode Symbol Unicode Wansung' -- "$cur")) + COMPREPLY=( $( compgen -W 'AdobeCustom AdobeExpert AdobeStandard + AppleRoman BIG5 GB2312 Latin2 None SJIScode Symbol Unicode + Wansung' -- "$cur" ) ) return 0 ;; -endian) @@ -44,9 +44,9 @@ _ImageMagick() return 0 ;; -filter) - COMPREPLY=( $( compgen -W 'Point Box Triangle Hermite \ - Hanning Hamming Blackman Gaussian Quadratic \ - Cubic Catrom Mitchell Lanczos Bessel Sinc' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'Point Box Triangle Hermite Hanning + Hamming Blackman Gaussian Quadratic Cubic Catrom Mitchell + Lanczos Bessel Sinc' -- "$cur" ) ) return 0 ;; -format) @@ -56,13 +56,13 @@ _ImageMagick() return 0 ;; -gravity) - COMPREPLY=( $( compgen -W 'Northwest North NorthEast \ - West Center East SouthWest South SouthEast' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'Northwest North NorthEast West Center + East SouthWest South SouthEast' -- "$cur" ) ) return 0 ;; -intent) - COMPREPLY=( $( compgen -W 'Absolute Perceptual \ - Relative Saturation' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'Absolute Perceptual Relative + Saturation' -- "$cur" ) ) return 0 ;; -interlace) @@ -74,7 +74,7 @@ _ImageMagick() return 0 ;; -list) - COMPREPLY=( $( compgen -W 'Delegate Format Magic Module Resource \ + COMPREPLY=( $( compgen -W 'Delegate Format Magic Module Resource Type' -- "$cur" ) ) return 0 ;; @@ -85,18 +85,16 @@ _ImageMagick() return 0 ;; -noise) - COMPREPLY=( $( compgen -W 'Uniform Gaussian Multiplicative \ + COMPREPLY=( $( compgen -W 'Uniform Gaussian Multiplicative Impulse Laplacian Poisson' -- "$cur" ) ) return 0 ;; -preview) - COMPREPLY=( $( compgen -W 'Rotate Shear Roll Hue \ - Saturation Brightness Gamma Spiff \ - Dull Grayscale Quantize Despeckle \ - ReduceNoise AddNoise Sharpen Blur \ - Treshold EdgeDetect Spread Shade \ - Raise Segment Solarize Swirl Implode \ - Wave OilPaint CharcoalDrawing JPEG' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'Rotate Shear Roll Hue Saturation + Brightness Gamma Spiff Dull Grayscale Quantize Despeckle + ReduceNoise AddNoise Sharpen Blur Treshold EdgeDetect Spread + Shade Raise Segment Solarize Swirl Implode Wave OilPaint + CharcoalDrawing JPEG' -- "$cur" ) ) return 0 ;; -mask|-profile|-texture|-tile|-write) @@ -104,13 +102,13 @@ _ImageMagick() return 0 ;; -type) - COMPREPLY=( $( compgen -W 'Bilevel Grayscale Palette PaletteMatte \ - TrueColor TrueColorMatte ColorSeparation ColorSeparationlMatte \ + COMPREPLY=( $( compgen -W 'Bilevel Grayscale Palette PaletteMatte + TrueColor TrueColorMatte ColorSeparation ColorSeparationlMatte Optimize' -- "$cur" ) ) return 0 ;; -units) - COMPREPLY=( $( compgen -W 'Undefined PixelsPerInch \ + COMPREPLY=( $( compgen -W 'Undefined PixelsPerInch PixelsPerCentimeter' -- "$cur" ) ) return 0 ;; @@ -119,8 +117,9 @@ _ImageMagick() return 0 ;; -visual) - COMPREPLY=( $( compgen -W 'StaticGray GrayScale StaticColor \ - PseudoColor TrueColor DirectColor defaut visualid' -- "$cur" )) + COMPREPLY=( $( compgen -W 'StaticGray GrayScale StaticColor + PseudoColor TrueColor DirectColor defaut visualid' \ + -- "$cur" ) ) return 0 ;; esac @@ -138,10 +137,9 @@ _convert() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+adjoin +append +compress \ - +contrast +debug +dither +endian +gamma +label +map \ - +mask +matte +negate +noise +page +raise +render \ - +write' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '+adjoin +append +compress +contrast +debug + +dither +endian +gamma +label +map +mask +matte +negate +noise + +page +raise +render +write' -- "$cur" ) ) else _filedir fi @@ -158,9 +156,8 @@ _mogrify() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+compress +contrast +debug +dither \ - +endian +gamma +label +map +mask +matte +negate +page \ - +raise' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '+compress +contrast +debug +dither +endian + +gamma +label +map +mask +matte +negate +page +raise' -- "$cur" ) ) else _filedir fi @@ -177,9 +174,8 @@ _display() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+compress +contrast +debug +dither \ - +endian +gamma +label +map +matte +negate +page \ - +raise +write' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '+compress +contrast +debug +dither +endian + +gamma +label +map +matte +negate +page +raise +write' -- "$cur" ) ) else _filedir fi @@ -231,8 +227,8 @@ _montage() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+adjoin +compress +debug +dither \ - +endian +gamma +label +matte +page' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '+adjoin +compress +debug +dither +endian + +gamma +label +matte +page' -- "$cur" ) ) else _filedir fi @@ -249,7 +245,7 @@ _composite() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) elif [[ "$cur" == +* ]]; then - COMPREPLY=( $( compgen -W '+compress +debug +dither +endian +label \ + COMPREPLY=( $( compgen -W '+compress +debug +dither +endian +label +matte +negate +page +write' -- "$cur" ) ) else _filedir diff --git a/completions/cpio b/completions/cpio index 45824007..d63d15a9 100644 --- a/completions/cpio +++ b/completions/cpio @@ -1,10 +1,5 @@ # bash completion for cpio -*- shell-script -*- -_cpio_format() -{ - COMPREPLY=( $( compgen -W 'bin odc newc crc tar ustar hpbin hpodc' -- "$cur" ) ) -} - _cpio() { local cur prev words cword split @@ -13,7 +8,8 @@ _cpio() # --name value style option case $prev in -H|--format) - _cpio_format + COMPREPLY=( $( compgen -W \ + 'bin odc newc crc tar ustar hpbin hpodc' -- "$cur" ) ) return 0 ;; -E|-F|-I|--file|--pattern-file) @@ -34,51 +30,42 @@ _cpio() $split && return 0 if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W '-o --create -i --extract -p --pass-through \ - -? --help --license --usage --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '-o --create -i --extract -p --pass-through + -? --help --license --usage --version' -- "$cur" ) ) else case ${words[1]} in -o|--create) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-0 -a -c -v -A -B\ - -L -V -C -H -M -O -F --file --format\ - --message --null --reset-access-time\ - --verbose --dot --append --block-size\ - --dereference --io-size --quiet\ - --force-local --rsh-command --help\ - --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '-0 -a -c -v -A -B -L -V -C -H -M + -O -F --file --format --message --null + --reset-access-time --verbose --dot --append + --block-size --dereference --io-size --quiet + --force-local --rsh-command --help --version' \ + -- "$cur" ) ) fi ;; -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\ - -F --file --make-directories\ - --nonmatching\ - --preserve-modification-time\ - --numeric-uid-gid --rename -t --list\ - --swap-bytes --swap --dot\ - --unconditional --verbose --block-size\ - --swap-halfwords --io-size\ - --pattern-file --format --owner\ - --no-preserve-owner --message\ - --force-local --no-absolute-filenames\ - --sparse --only-verify-crc --quiet\ - --rsh-command --help\ - --to-stdout \ - --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '-b -c -d -f -m -n -r -t -s -u -v + -B -S -V -C -E -H -M -R -I -F --file --make-directories + --nonmatching --preserve-modification-time + --numeric-uid-gid --rename --list --swap-bytes --swap + --dot --unconditional --verbose --block-size + --swap-halfwords --io-size --pattern-file --format + --owner --no-preserve-owner --message --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\ - --make-directories --link --quiet\ - --preserve-modification-time\ - --unconditional --verbose --dot\ - --dereference --owner\ - --no-preserve-owner --sparse --help\ - --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '-0 -a -d -l -m -u -v -L -V -R + --null --reset-access-time --make-directories --link + --quiet --preserve-modification-time --unconditional + --verbose --dot --dereference --owner + --no-preserve-owner --sparse --help --version' \ + -- "$cur" ) ) else _filedir -d fi diff --git a/completions/cppcheck b/completions/cppcheck index bcf937bb..64bb9b02 100644 --- a/completions/cppcheck +++ b/completions/cppcheck @@ -7,7 +7,7 @@ _cppcheck() case $prev in --append|--exitcode-suppressions|--file-list|--rule-file|\ - --suppressions-list|--includes-file|-i) + --suppressions-list|--includes-file|--include|-i) _filedir return ;; @@ -39,8 +39,13 @@ _cppcheck() COMPREPLY=( $( compgen -W "{2..$(_ncpus)}" -- "$cur" ) ) return ;; + --language|-x) + COMPREPLY=( $( compgen -W 'c c++' -- "$cur" ) ) + return + ;; --std) - COMPREPLY=( $( compgen -W 'c99 c++11 posix' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'c89 c99 c11 c++03 c++11 posix' \ + -- "$cur" ) ) return ;; --platform) diff --git a/completions/cryptsetup b/completions/cryptsetup index fb390214..a295a147 100644 --- a/completions/cryptsetup +++ b/completions/cryptsetup @@ -33,9 +33,9 @@ _cryptsetup() COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace else - COMPREPLY=( $( compgen -W 'create remove status resize luksFormat \ - luksOpen luksClose luksSuspend luksResume luksAddKey \ - luksRemoveKey luksKillSlot luksDelKey luksUUID isLuks \ + COMPREPLY=( $( compgen -W 'create remove status resize luksFormat + luksOpen luksClose luksSuspend luksResume luksAddKey + luksRemoveKey luksKillSlot luksDelKey luksUUID isLuks luksDump luksHeaderBackup luksHeaderRestore' -- "$cur" ) ) fi else diff --git a/completions/cvs b/completions/cvs index 4613742a..71277556 100644 --- a/completions/cvs +++ b/completions/cvs @@ -326,7 +326,7 @@ _cvs() fi pwd=$( pwd ) pwd=${pwd##*/} - COMPREPLY=( $( compgen -W '${COMPREPLY[@]} $pwd' -- $cur ) ) + COMPREPLY=( $( compgen -W '${COMPREPLY[@]} $pwd' -- "$cur" ) ) else _cvs_command_options "$1" $mode fi @@ -376,9 +376,9 @@ _cvs() ;; esac - COMPREPLY=( $( compgen -W '$( _cvs_commands ) \ - $( _parse_help "$1" --help-options ) \ - --help --help-commands --help-options --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '$( _cvs_commands ) + $( _parse_help "$1" --help-options ) --help --help-commands + --help-options --version' -- "$cur" ) ) ;; esac diff --git a/completions/dhclient b/completions/dhclient index 10bbbe66..54d89d31 100644 --- a/completions/dhclient +++ b/completions/dhclient @@ -17,8 +17,8 @@ _dhclient() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-p -d -q -1 -r -lf -pf \ - -cf -sf -s -g -n -nw -w' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '-p -d -q -1 -r -lf -pf -cf -sf -s -g -n -nw + -w' -- "$cur" ) ) else _available_interfaces fi diff --git a/completions/dmesg b/completions/dmesg index 7d73bf3a..3d9bc662 100644 --- a/completions/dmesg +++ b/completions/dmesg @@ -22,12 +22,9 @@ _dmesg() ;; esac - if [[ $cur == -* ]]; then - local opts=$( _parse_help "$1" ) - [[ $opts ]] || opts=$( _parse_usage "$1" ) - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) - return - fi + local opts=$( _parse_help "$1" ) + [[ $opts ]] || opts=$( _parse_usage "$1" ) + COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) } && complete -F _dmesg dmesg diff --git a/completions/dnsspoof b/completions/dnsspoof index 39bc47eb..2518af69 100644 --- a/completions/dnsspoof +++ b/completions/dnsspoof @@ -7,7 +7,7 @@ _dnsspoof() case $prev in -i) - _interfaces + _available_interfaces -a return 0 ;; -f) diff --git a/completions/dpkg b/completions/dpkg index b1b34e17..d14e5e3e 100644 --- a/completions/dpkg +++ b/completions/dpkg @@ -111,7 +111,7 @@ _dpkg_reconfigure() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '--frontend --priority --all --unseen-only \ + COMPREPLY=( $(compgen -W '--frontend --priority --all --unseen-only --help --showold --force --terse' -- "$cur" ) ) else COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) ) diff --git a/completions/dselect b/completions/dselect index 9da1e927..ee3cb2a7 100644 --- a/completions/dselect +++ b/completions/dselect @@ -17,11 +17,11 @@ _dselect() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--admindir --help --version --licence \ - --license --expert --debug' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--admindir --help --version --licence + --expert --debug' -- "$cur" ) ) else - COMPREPLY=( $( compgen -W 'access update select install config \ - remove quit' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'access update select install config remove + quit' -- "$cur" ) ) fi return 0 diff --git a/completions/dsniff b/completions/dsniff index 94b34ef6..db9b02ac 100644 --- a/completions/dsniff +++ b/completions/dsniff @@ -6,18 +6,18 @@ _dsniff() _init_completion || return case $prev in - -r|-w|-f) + -r|-w|-f|-p) _filedir return 0 ;; -i) - _interfaces + _available_interfaces -a return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" ) -r -w' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '$( _parse_usage "$1" ) -r -w -p' -- "$cur" ) ) fi } && diff --git a/completions/dumpdb b/completions/dumpdb index 461401c3..f097f895 100644 --- a/completions/dumpdb +++ b/completions/dumpdb @@ -6,8 +6,8 @@ _dumpdb() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--marshal --pickle --noprint \ - --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--marshal --pickle --noprint --help' \ + -- "$cur" ) ) else _filedir fi diff --git a/completions/eject b/completions/eject new file mode 100644 index 00000000..d6b1f6d9 --- /dev/null +++ b/completions/eject @@ -0,0 +1,30 @@ +# bash completion for eject(1) -*- shell-script -*- + +_eject() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -h|--help|-V|--version|-c|--changerslot|-x|--cdspeed) + return + ;; + -a|--auto|-i|--manualeject) + COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + return + elif [[ $prev == @(-d|--default) ]]; then + return + fi + + _cd_devices + _dvd_devices +} && +complete -F _eject eject + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/eog b/completions/eog new file mode 100644 index 00000000..6da35e15 --- /dev/null +++ b/completions/eog @@ -0,0 +1,27 @@ +# eog(1) completion -*- shell-script -*- + +_eog() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + -'?'|--help|--help-all|--help-gtk) + return + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help-all )' \ + -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + fi + + _filedir '@(ani|?(w)bmp|gif|ico|j2k|jp[cefgx2]|jpeg|pcx|pn[gm]|ras|svg?(z)|tga|tif?(f)|x[bp]m)' +} && +complete -F _eog eog + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/ether-wake b/completions/ether-wake index 2142d74e..4957e055 100644 --- a/completions/ether-wake +++ b/completions/ether-wake @@ -7,7 +7,7 @@ _ether_wake() case $prev in -i) - _available_interfaces + _available_interfaces -a return 0 ;; -p) diff --git a/completions/evince b/completions/evince index 9c7d0c3a..8ef75160 100644 --- a/completions/evince +++ b/completions/evince @@ -26,7 +26,7 @@ _evince() return fi - _filedir '@(@(?(e)ps|?(E)PS|[pf]df|[PF]DF|dvi|DVI)?(.gz|.GZ|.bz2|.BZ2)|cb[rz]|djv?(u)|gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx)' + _filedir '@(@(?(e)ps|?(E)PS|[pf]df|[PF]DF|dvi|DVI)?(.gz|.GZ|.bz2|.BZ2|.xz|.XZ)|cb[rz]|djv?(u)|gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx)' } && complete -F _evince evince diff --git a/completions/feh b/completions/feh index 5d66bb10..e53ca2b1 100644 --- a/completions/feh +++ b/completions/feh @@ -7,7 +7,7 @@ _feh() case "$prev" in -B|--image-bg) - COMPREPLY=( $( compgen -W 'default white black' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'checks white black' -- "$cur" ) ) return ;; -f|--filelist|-o|--output|-O|--output-only|-\||--start-at) @@ -81,7 +81,7 @@ _feh() COMPREPLY+=( $( compgen -W 'trans' -- "$cur" ) ) return ;; - -g|--geometry) + -g|--geometry|--max-dimension|--min-dimension) # expect string like 640x480 if [[ $cur && "$cur" != *x* ]]; then COMPREPLY=( x ) diff --git a/completions/file-roller b/completions/file-roller new file mode 100644 index 00000000..c05565d9 --- /dev/null +++ b/completions/file-roller @@ -0,0 +1,41 @@ +# file-roller(1) completion -*- shell-script -*- + +_file_roller() +{ + local cur prev words cword split + _init_completion -s || return + + local exts='@(7z|ace|alz|ar|arj|[bglx]z|bz2|tb?(z)2|cab|cb[rz]|iso?(9660)|Z|t[abglx]z|cpio|deb|[ejrw]ar|exe|?(g)tar|gem|lh[az]|lzh|?(t)lrz|lzma|lzo|wim|swm|rpm|sit|zip|zoo)' + + case $prev in + -'?'|--help|--help-all|--help-gtk|--help-sm-client) + return + ;; + --sm-client-state-file) + _filedir + return + ;; + -a|--add-to) + _filedir "$exts" + return + ;; + -e|--extract-to|--default-dir) + _filedir -d + return + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help-all )' \ + -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + fi + + _filedir "$exts" +} && +complete -F _file_roller file-roller + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/filesnarf b/completions/filesnarf index 07c4c741..dbadd434 100644 --- a/completions/filesnarf +++ b/completions/filesnarf @@ -7,7 +7,7 @@ _snarf() case $prev in -i) - _interfaces + _available_interfaces -a return 0 ;; esac diff --git a/completions/find b/completions/find index 2afb6fc9..1896fc22 100644 --- a/completions/find +++ b/completions/find @@ -56,8 +56,8 @@ _find() return 0 ;; -regextype) - COMPREPLY=( $( compgen -W 'emacs posix-awk posix-basic \ - posix-egrep posix-extended' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'emacs posix-awk posix-basic posix-egrep + posix-extended' -- "$cur" ) ) return 0 ;; esac @@ -77,17 +77,16 @@ _find() fi # complete using basic options - 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" ) ) + 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" ) ) if [[ ${#COMPREPLY[@]} -ne 0 ]]; then # this removes any options from the list of completions that have diff --git a/completions/find_member b/completions/find_member index d306f1be..b1fcaf62 100644 --- a/completions/find_member +++ b/completions/find_member @@ -15,8 +15,8 @@ _find_member() $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--listname --exclude --owners \ - --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--listname --exclude --owners --help' \ + -- "$cur" ) ) fi } && diff --git a/completions/fusermount b/completions/fusermount index fa51b228..e711e791 100644 --- a/completions/fusermount +++ b/completions/fusermount @@ -11,8 +11,8 @@ _fusermount() ;; -u) COMPREPLY=( $( compgen -W "$( awk \ - '{ if ($3 ~ /^fuse\./) print $2 }' /etc/mtab 2>/dev/null )" \ - -- "$cur" ) ) + '{ if ($3 ~ /^fuse(\.|$)/) print $2 }' /etc/mtab \ + 2>/dev/null )" -- "$cur" ) ) return 0 ;; esac diff --git a/completions/gcl b/completions/gcl index 2796ca07..385a2e06 100644 --- a/completions/gcl +++ b/completions/gcl @@ -9,8 +9,8 @@ _gcl() # completing an option (may or may not be separated by a space) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-eval -load -f -batch -dir -libdir \ - -compile -o-file -c-file -h-file -data-file -system-p '-- "$cur" ) ) + COMPREPLY=( $( compgen -W '-eval -load -f -batch -dir -libdir -compile + -o-file -c-file -h-file -data-file -system-p' -- "$cur" ) ) else _filedir fi diff --git a/completions/genisoimage b/completions/genisoimage index 3c966515..1d8f0401 100644 --- a/completions/genisoimage +++ b/completions/genisoimage @@ -27,37 +27,7 @@ _mkisofs() esac if [[ "$cur" == -* ]]; then - 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 \ - -icon-position -root-info -prep-boot \ - -input-hfs-charset -output-hfs-charset \ - -hfs-unlock -hfs-bless -hfs-parms --cap \ - --netatalk --double --ethershare --ushare \ - --exchange --sgi --xinet --macbin --single \ - --dave --sfm --osx-double --osx-hfs' -- "$cur" )) + COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) else _filedir fi diff --git a/completions/getent b/completions/getent index 1bb12f52..2e99f524 100644 --- a/completions/getent +++ b/completions/getent @@ -68,8 +68,8 @@ _getent() COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace elif [[ -z $db ]]; then - COMPREPLY=( $( compgen -W 'passwd group hosts services protocols \ - networks ahosts ahostsv4 ahostsv6 aliases ethers netgroup rpc \ + COMPREPLY=( $( compgen -W 'passwd group hosts services protocols + networks ahosts ahostsv4 ahostsv6 aliases ethers netgroup rpc shadow gshadow' -- "$cur" ) ) fi } && diff --git a/completions/gkrellm b/completions/gkrellm index f7979b96..db439ebd 100644 --- a/completions/gkrellm +++ b/completions/gkrellm @@ -32,10 +32,7 @@ _gkrellm() ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - fi - + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) } && complete -F _gkrellm gkrellm gkrellm2 diff --git a/completions/gnatmake b/completions/gnatmake index e807d923..458ad070 100644 --- a/completions/gnatmake +++ b/completions/gnatmake @@ -8,17 +8,14 @@ _gnatmake() if [[ "$cur" == -* ]]; then # relevant (and less relevant ;-) )options completion - COMPREPLY=( $( compgen -W '-a -c -f -i -j -k -m -M -n -o \ - -q -s -v -z -aL -A -aO -aI -I -I- -L -nostdinc \ - -nostdlib -cargs -bargs -largs -fstack-check \ - -fno-inline -g -O1 -O0 -O2 -O3 -gnata -gnatA \ - -gnatb -gnatc -gnatd -gnatD -gnate -gnatE \ - -gnatf -gnatF -gnatg -gnatG -gnath -gnati \ - -gnatk -gnatl -gnatL -gnatm -gnatn -gnato \ - -gnatO -gnatp -gnatP -gnatq -gnatR -gnats \ - -gnatt -gnatT -gnatu -gnatU -gnatv -gnatws \ - -gnatwe -gnatwl -gnatwu -gnatW -gnatx -gnatX \ - -gnaty -gnatz -gnatZ -gnat83' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '-a -c -f -i -j -k -m -M -n -o -q -s -v -z + -aL -A -aO -aI -I -I- -L -nostdinc -nostdlib -cargs -bargs -largs + -fstack-check -fno-inline -g -O1 -O0 -O2 -O3 -gnata -gnatA -gnatb + -gnatc -gnatd -gnatD -gnate -gnatE -gnatf -gnatF -gnatg -gnatG + -gnath -gnati -gnatk -gnatl -gnatL -gnatm -gnatn -gnato -gnatO + -gnatp -gnatP -gnatq -gnatR -gnats -gnatt -gnatT -gnatu -gnatU + -gnatv -gnatws -gnatwe -gnatwl -gnatwu -gnatW -gnatx -gnatX -gnaty + -gnatz -gnatZ -gnat83' -- "$cur" ) ) else # source file completion _filedir '@(adb|ads)' diff --git a/completions/gpg b/completions/gpg index f7efad3a..91436f7a 100644 --- a/completions/gpg +++ b/completions/gpg @@ -10,7 +10,7 @@ _gpg() _filedir return 0 ;; - --export|--sign-key|--lsignkey|--nrsignkey|--nrlsignkey|--editkey) + --export|--sign-key|--lsign-key|--nrsign-key|--nrlsign-key|--edit-key) # return list of public keys COMPREPLY=( $( compgen -W "$( gpg --list-keys 2>/dev/null | \ sed -ne 's@^pub.*/\([^ ]*\).*$@\1@p' \ @@ -19,11 +19,11 @@ _gpg() ;; -r|--recipient) COMPREPLY=( $( compgen -W "$( gpg --list-keys 2>/dev/null | \ - sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" )) + sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" ) ) if [[ -e ~/.gnupg/gpg.conf ]]; then COMPREPLY+=( $( compgen -W "$( sed -ne \ 's@^[ \t]*group[ \t][ \t]*\([^=]*\).*$@\1@p' \ - ~/.gnupg/gpg.conf )" -- "$cur") ) + ~/.gnupg/gpg.conf )" -- "$cur" ) ) fi return 0 ;; diff --git a/completions/gpg2 b/completions/gpg2 index 85e9f38c..3efc2dbb 100644 --- a/completions/gpg2 +++ b/completions/gpg2 @@ -23,11 +23,11 @@ _gpg2() ;; -r|--recipient) COMPREPLY=( $( compgen -W "$( gpg2 --list-keys 2>/dev/null | \ - sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" )) + sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" ) ) if [[ -e ~/.gnupg/gpg.conf ]]; then COMPREPLY+=( $( compgen -W "$( sed -ne \ 's@^[ \t]*group[ \t][ \t]*\([^=]*\).*$@\1@p' \ - ~/.gnupg/gpg.conf)" -- "$cur")) + ~/.gnupg/gpg.conf)" -- "$cur" ) ) fi return 0 ;; diff --git a/completions/gphoto2 b/completions/gphoto2 new file mode 100644 index 00000000..02ddf785 --- /dev/null +++ b/completions/gphoto2 @@ -0,0 +1,51 @@ +# bash completion for gphoto2(1) -*- shell-script -*- + +_gphoto2() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + --debug-logfile) + _filedir + return 0 + ;; + --hook-script) + _filedir + return 0 + ;; + --filename) + _filedir + return 0 + ;; + -u|--upload-file) + _filedir + return 0 + ;; + --port) + COMPREPLY=( $(compgen -W "$( gphoto2 --list-ports 2>/dev/null | \ + tail -n +4 | awk '{ print $1 }' )" -- "$cur") ) + return 0 + ;; + --camera) + local IFS=$'\n' + COMPREPLY=( $(compgen -W "$( gphoto2 --list-cameras 2>/dev/null | \ + tail -n +3 | awk -F'"' '{ print $2 }' )" -- "$cur") ) + return 0 + ;; + --get-config|--set-config|--set-config-index|--set-config-value) + COMPREPLY=( $(compgen -W "$( gphoto2 --list-config 2>/dev/null \ + )" -- "$cur") ) + return 0 + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + return 0 + fi + +} && +complete -F _gphoto2 gphoto2 + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/groupmems b/completions/groupmems index 627f8e01..9c993eb7 100644 --- a/completions/groupmems +++ b/completions/groupmems @@ -14,12 +14,13 @@ _groupmems() COMPREPLY=( $( compgen -g -- "$cur" ) ) return 0 ;; + -R|--root) + _filedir -d + return 0 + ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - return 0 - fi + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) } && complete -F _groupmems groupmems diff --git a/completions/hcitool b/completions/hcitool index 0a743e48..b650e205 100644 --- a/completions/hcitool +++ b/completions/hcitool @@ -16,9 +16,9 @@ _bluetooth_devices() _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" ) ) + 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() @@ -55,9 +55,9 @@ _hcitool() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$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" ) ) + 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 @@ -126,15 +126,15 @@ _sdptool() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) else - COMPREPLY=( $( compgen -W 'search browse records add \ - del get setattr setseq' -- "$cur" ) ) + 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" ) ) + COMPREPLY=( $( compgen -W '--bdaddr --tree --raw --xml' \ + -- "$cur" ) ) else _bluetooth_services fi @@ -155,8 +155,8 @@ _sdptool() ;; get) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--bdaddr \ - --tree --raw --xml' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--bdaddr --tree --raw --xml' \ + -- "$cur" ) ) fi ;; esac @@ -210,8 +210,8 @@ _rfcomm() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) else - COMPREPLY=( $( compgen -W 'show connect listen watch \ - bind release' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'show connect listen watch bind + release' -- "$cur" ) ) fi else _count_args @@ -249,8 +249,8 @@ _ciptool() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) else - COMPREPLY=( $( compgen -W 'show search connect release \ - loopback' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'show search connect release loopback' \ + -- "$cur" ) ) fi else case $arg in @@ -284,8 +284,8 @@ _dfutool() _count_args case $args in 1) - COMPREPLY=( $( compgen -W 'verify modify \ - upgrade archive' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'verify modify upgrade archive' \ + -- "$cur" ) ) ;; 2) _filedir @@ -306,13 +306,11 @@ _hciconfig() 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" ) ) + 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 @@ -325,8 +323,8 @@ _hciconfig() lm) _count_args if [[ $args -eq 2 ]]; then - COMPREPLY=( $( compgen -W 'MASTER \ - SLAVE NONE ACCEPT' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'MASTER SLAVE NONE ACCEPT' \ + -- "$cur" ) ) fi ;; ptype) @@ -353,17 +351,16 @@ _hciattach() case $args in 1) COMPREPLY=( $( printf '%s\n' /dev/tty* ) ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]} \ + COMPREPLY=( $( compgen -W '${COMPREPLY[@]} ${COMPREPLY[@]#/dev/}' -- "$cur" ) ) ;; 2) - COMPREPLY=( $( compgen -W 'any ericsson digi \ - xircom csr bboxes swave bcsp 0x0105 \ - 0x080a 0x0160 0x0002' -- "$cur" ) ) + 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" ) ) + COMPREPLY=( $( compgen -W '9600 19200 38400 57600 115200 230400 + 460800 921600' -- "$cur" ) ) ;; 4) COMPREPLY=( $( compgen -W 'flow noflow' -- "$cur" ) ) diff --git a/completions/hexdump b/completions/hexdump new file mode 100644 index 00000000..c566f9d6 --- /dev/null +++ b/completions/hexdump @@ -0,0 +1,29 @@ +# hexdump(1) completion -*- shell-script -*- + +_hexdump() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -V|-e|-n|-s) + return + ;; + -f) + _filedir + return + ;; + esac + + if [[ $cur == -* ]]; then + local opts="$( _parse_help "$1" )" + [[ $opts ]] || opts="$( _parse_usage "$1" )" + COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) + return + fi + + _filedir +} && +complete -F _hexdump hexdump hd + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/hid2hci b/completions/hid2hci index 4e2ef039..d840166a 100644 --- a/completions/hid2hci +++ b/completions/hid2hci @@ -6,8 +6,8 @@ _hid2hci() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --quiet -0 --tohci -1 \ - --tohid' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--help --quiet -0 --tohci -1 --tohid' \ + -- "$cur" ) ) fi } && complete -F _hid2hci hid2hci diff --git a/completions/hwclock b/completions/hwclock index e9d77aa2..9f8f9b15 100644 --- a/completions/hwclock +++ b/completions/hwclock @@ -11,12 +11,12 @@ _hwclock() ;; -f|--rtc|--adjfile) _filedir + return ;; esac - [[ $cur == -* ]] && \ - COMPREPLY=( $( PATH="$PATH:/sbin" - compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + COMPREPLY=( + $( PATH="$PATH:/sbin" compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) } && complete -F _hwclock hwclock diff --git a/completions/installpkg b/completions/installpkg index 956f5d0c..cdaf816c 100644 --- a/completions/installpkg +++ b/completions/installpkg @@ -21,8 +21,8 @@ _installpkg() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--warn --md5sum --root --infobox --terse \ - --menu --ask --priority --tagfile' -- "$cur") ) + COMPREPLY=( $( compgen -W '--warn --md5sum --root --infobox --terse + --menu --ask --priority --tagfile' -- "$cur" ) ) return 0 fi diff --git a/completions/interdiff b/completions/interdiff new file mode 100644 index 00000000..8b07572f --- /dev/null +++ b/completions/interdiff @@ -0,0 +1,33 @@ +# interdiff(1) completion -*- shell-script -*- + +_interdiff() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + -U|--unified|-p|--strip-match|-d|--drop-context) + return + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + fi + + local exts='@(?(d)patch|dif?(f))' word + for word in ${words[@]}; do + if [[ $word == -@(z|-decompress) ]]; then + exts+='?(.@(gz|bz2))' + break + fi + done + _filedir "$exts" +} && +complete -F _interdiff interdiff + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/ip b/completions/ip index 08ee74fe..b073c36f 100644 --- a/completions/ip +++ b/completions/ip @@ -1,5 +1,12 @@ # ip(8) completion -*- shell-script -*- +_iproute2_etc() +{ + COMPREPLY+=( $( compgen -W \ + "$( awk '!/#/ { print $2 }' /etc/iproute2/$1 2>/dev/null )" \ + -- "$cur" ) ) +} + _ip() { local cur prev words cword @@ -96,7 +103,14 @@ _ip() fi ;; show) - [[ $cword -eq $subcword+1 ]] && _available_interfaces + if [[ $cword -eq $subcword+1 ]]; then + _available_interfaces + COMPREPLY+=( $( compgen -W 'dev group up' -- "$cur" ) ) + elif [[ $prev == dev ]]; then + _available_interfaces + elif [[ $prev == group ]]; then + _iproute2_etc group + fi ;; *) [[ $cword -eq $subcword ]] && \ @@ -115,7 +129,16 @@ _ip() # TODO ;; show|flush) - # TODO + if [[ $cword -eq $subcword+1 ]]; then + _available_interfaces + COMPREPLY+=( $( compgen -W 'dev scope to label dynamic + permanent tentative deprecated dadfailed temporary + primary secondary up' -- "$cur" ) ) + elif [[ $prev == dev ]]; then + _available_interfaces + elif [[ $prev == scope ]]; then + _iproute2_etc rt_scopes + fi ;; *) [[ $cword -eq $subcword ]] && \ @@ -159,9 +182,11 @@ _ip() rule) case $subcmd in - list|add|del|flush) + add|del) # TODO ;; + flush|show|list|lst) + ;; *) [[ $cword -eq $subcword ]] && \ COMPREPLY=( $( compgen -W 'help list add del flush' \ @@ -204,7 +229,9 @@ _ip() tunnel) case $subcmd in - add|change|del|show|prl|6rd) + show) + ;; + add|change|del|prl|6rd) # TODO ;; *) diff --git a/completions/ipsec b/completions/ipsec index a586a786..b1161b0a 100644 --- a/completions/ipsec +++ b/completions/ipsec @@ -19,22 +19,21 @@ _ipsec_freeswan() _init_completion || return if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W 'auto barf eroute klipsdebug look manual \ - pluto ranbits rsasigkey setup showdefaults showhostkey spi spigrp \ + COMPREPLY=( $( compgen -W 'auto barf eroute klipsdebug look manual + pluto ranbits rsasigkey setup showdefaults showhostkey spi spigrp tncfg whack' -- "$cur" ) ) return 0 fi case ${words[1]} in auto) - COMPREPLY=( $( compgen -W '--asynchronous --up --add --delete \ - --replace --down --route --unroute \ - --ready --status --rereadsecrets' \ - -- "$cur" ) ) + 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" ) ) + COMPREPLY=( $( compgen -W '--up --down --route --unroute --union' \ + -- "$cur" ) ) ;; ranbits) COMPREPLY=( $( compgen -W '--quick --continuous --bytes' \ @@ -56,14 +55,14 @@ _ipsec_strongswan() _init_completion || return if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W 'down irdumm leases listaacerts listacerts \ - listalgs listall listcacerts listcainfos listcards listcerts \ + COMPREPLY=( $( compgen -W 'down irdumm leases listaacerts listacerts + listalgs listall listcacerts listcainfos listcards listcerts listcrls listgroups listocsp listocspcerts listpubkeys openac pki - pluto pool purgecerts purgecrls purgeike purgeocsp ready reload \ - rereadaacerts rereadacerts rereadall rereadcacerts rereadcrls \ - rereadgroups rereadocspcerts rereadsecrets restart route scdecrypt \ - scencrypt scepclient secrets start starter status statusall stop \ - stroke unroute uci up update version whack --confdir --copyright \ + pluto pool purgecerts purgecrls purgeike purgeocsp ready reload + rereadaacerts rereadacerts rereadall rereadcacerts rereadcrls + rereadgroups rereadocspcerts rereadsecrets restart route scdecrypt + scencrypt scepclient secrets start starter status statusall stop + stroke unroute uci up update version whack --confdir --copyright --directory --help --version --versioncode' -- "$cur" ) ) return 0 fi @@ -77,11 +76,11 @@ _ipsec_strongswan() COMPREPLY=( $( compgen -W '--utc' -- "$cur" ) ) ;; restart|start) - COMPREPLY=( $( compgen -W '--attach-gdb --auto-update --debug \ + COMPREPLY=( $( compgen -W '--attach-gdb --auto-update --debug --debug-all --debug-more --nofork' -- "$cur" ) ) ;; pki) - COMPREPLY=( $( compgen -W '--gen --issue --keyid --print --pub \ + COMPREPLY=( $( compgen -W '--gen --issue --keyid --print --pub --req --self --signcrl --verify' -- "$cur" ) ) ;; pool) diff --git a/completions/iptables b/completions/iptables index 5c4e0736..0d54afbd 100644 --- a/completions/iptables +++ b/completions/iptables @@ -25,31 +25,31 @@ _iptables() ;; -j) if [[ "$table" == "-t filter" || -z "$table" ]]; then - COMPREPLY=( $( compgen -W 'ACCEPT DROP LOG ULOG REJECT \ + COMPREPLY=( $( compgen -W 'ACCEPT DROP LOG ULOG REJECT `iptables $table -nL | sed -ne "$chain" \ -e "s/INPUT|OUTPUT|FORWARD|PREROUTING|POSTROUTING//"`' -- \ "$cur" ) ) elif [[ $table == "-t nat" ]]; then - COMPREPLY=( $( compgen -W 'ACCEPT DROP LOG ULOG REJECT \ - MIRROR SNAT DNAT MASQUERADE `iptables $table -nL | \ + COMPREPLY=( $( compgen -W 'ACCEPT DROP LOG ULOG REJECT MIRROR SNAT + DNAT MASQUERADE `iptables $table -nL | \ sed -ne "$chain" -e "s/OUTPUT|PREROUTING|POSTROUTING//"`' \ -- "$cur" ) ) elif [[ $table == "-t mangle" ]]; then - COMPREPLY=( $( compgen -W 'ACCEPT DROP LOG ULOG REJECT \ - MARK TOS `iptables $table -nL | sed -ne "$chain" \ + COMPREPLY=( $( compgen -W 'ACCEPT DROP LOG ULOG REJECT MARK TOS + `iptables $table -nL | sed -ne "$chain" \ -e "s/INPUT|OUTPUT|FORWARD|PREROUTING|POSTROUTING//"`' -- \ "$cur" ) ) fi ;; *) if [[ "$cur" == -* ]]; then - 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 \ - --out-interface --table --verbose --line-numbers --exact \ - --fragment --modprobe --set-counters --version' -- "$cur") ) + 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 --out-interface --table + --verbose --line-numbers --exact --fragment --modprobe + --set-counters --version' -- "$cur" ) ) fi ;; esac diff --git a/completions/ipv6calc b/completions/ipv6calc index 102f8327..5db7271f 100644 --- a/completions/ipv6calc +++ b/completions/ipv6calc @@ -28,14 +28,13 @@ _ipv6calc() $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" ) ) + 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 diff --git a/completions/iwconfig b/completions/iwconfig index 899f1493..36213d2c 100644 --- a/completions/iwconfig +++ b/completions/iwconfig @@ -7,8 +7,8 @@ _iwconfig() case $prev in mode) - COMPREPLY=( $( compgen -W 'managed ad-hoc master \ - repeater secondary monitor' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'managed ad-hoc master repeater secondary + monitor' -- "$cur" ) ) return 0 ;; essid) @@ -80,8 +80,8 @@ _iwconfig() _available_interfaces -w fi else - COMPREPLY=( $( compgen -W 'essid nwid mode freq channel sens mode \ - ap nick rate rts frag enc key power txpower commit' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'essid nwid mode freq channel sens mode ap + nick rate rts frag enc key power txpower commit' -- "$cur" ) ) fi } && diff --git a/completions/iwlist b/completions/iwlist index 7819b04d..78c15b71 100644 --- a/completions/iwlist +++ b/completions/iwlist @@ -12,9 +12,9 @@ _iwlist() _available_interfaces -w fi else - COMPREPLY=( $( compgen -W 'scan scanning freq frequency \ - channel rate bit bitrate key enc encryption power \ - txpower retry ap accesspoint peers event' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'scan scanning freq frequency channel rate + bit bitrate key enc encryption power txpower retry ap accesspoint + peers event' -- "$cur" ) ) fi } && complete -F _iwlist iwlist diff --git a/completions/jar b/completions/jar index f16d7f70..8af86a17 100644 --- a/completions/jar +++ b/completions/jar @@ -15,7 +15,7 @@ _jar() _filedir ;; *f) - _filedir '@([ejsw]ar|zip|apk)' + _filedir_xspec unzip ;; *) _filedir diff --git a/completions/jarsigner b/completions/jarsigner index 02befae7..c1c72af7 100644 --- a/completions/jarsigner +++ b/completions/jarsigner @@ -42,9 +42,9 @@ _jarsigner() 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 \ + COMPREPLY=( $( compgen -W '-keystore -storepass -storetype + -keypass -sigfile -signedjar -digestalg -sigalg -verify + -verbose -certs -tsa -tsacert -altsigner -altsignerpath -protected -providerName -providerClass -providerArg' \ -- "$cur" ) ) fi diff --git a/completions/kcov b/completions/kcov index ebbd803c..86d2d10c 100644 --- a/completions/kcov +++ b/completions/kcov @@ -11,15 +11,30 @@ _kcov() return ;; --sort-type|-s) - COMPREPLY=( $( compgen -W 'filename percentage' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'filename percentage lines uncovered' \ + -- "$cur" ) ) return ;; --include-path|--exclude-path) _filedir return ;; - --limits|-l|--title|-t|--include-pattern|--exclude-pattern|\ - --path-strip-level) + --limits|-l) + split=false + if [[ "$cur" == ?*,* ]]; then + prev="${cur%,*}" + cur="${cur##*,}" + split=true + fi + COMPREPLY=( $( compgen -W "{0..100}" -- "$cur" ) ) + if $split; then + COMPREPLY=( ${COMPREPLY[@]/#/"$prev,"} ) + else + compopt -o nospace + fi + return + ;; + --title|-t|--include-pattern|--exclude-pattern|--path-strip-level) # argument required but no completions available return ;; diff --git a/completions/koji b/completions/koji index f4bdeacf..bd6cb2fd 100644 --- a/completions/koji +++ b/completions/koji @@ -162,7 +162,7 @@ _koji() latest-by-tag) _koji_package "$1" ;; - latest-pkg|list-groups|list-tag-inheritance|show-groups|wait-repo) + latest-pkg|list-groups|list-tag-inheritance|show-groups) case $nth in 1) _koji_tag "$1" @@ -217,6 +217,19 @@ _koji() taginfo) _koji_tag "$1" ;; + wait-repo) + case $nth in + 1) + for (( i=commandix+1; i < cword; i++ )); do + if [[ ${words[i]} == --target ]]; then + _koji_target "$1" + return + fi + done + _koji_tag "$1" + ;; + esac + ;; esac return fi diff --git a/completions/ktutil b/completions/ktutil index e0bd60bf..88eb5275 100644 --- a/completions/ktutil +++ b/completions/ktutil @@ -14,8 +14,8 @@ _heimdal_realms() _heimdal_encodings() { - COMPREPLY=( $( compgen -W 'des-cbc-mcrc des-cbc-md4 des-cbc-md5 \ - des3-cbc-sha1 arcfour-hmac-md5 aes128-cts-hmac-sha1-96 \ + COMPREPLY=( $( compgen -W 'des-cbc-mcrc des-cbc-md4 des-cbc-md5 + des3-cbc-sha1 arcfour-hmac-md5 aes128-cts-hmac-sha1-96 aes256-cts-hmac-sha1-96' -- "$cur" ) ) } @@ -51,7 +51,7 @@ _ktutil() $split && return 0 - commands='add change copy get list remove rename purge srvconvert \ + commands='add change copy get list remove rename purge srvconvert srv2keytab srvcreate key2srvtab' for (( i=1; i < cword; i++ )); do @@ -71,14 +71,14 @@ _ktutil() if [[ "$cur" == -* ]]; then case $command in add) - options='-p --principal -V -e --enctype -w --password -r \ + options='-p --principal -V -e --enctype -w --password -r --random -s --no-salt -h --hex' ;; change) options='-r --realm -a --admin-server -s --server-port' ;; get) - options='-p --principal -e --enctype -r --realm -a \ + options='-p --principal -e --enctype -r --realm -a --admin-server -s server --server-port' ;; list) diff --git a/completions/larch b/completions/larch index f6f796b2..79716a5f 100644 --- a/completions/larch +++ b/completions/larch @@ -30,7 +30,7 @@ _larch() distribution-name notify my-notifier mail-new-categories \ mail-new-branches mail-new-versions mail-new-revisions \ notify-library notify-browser push-new-revisions sendmail-mailx' \ - "$cur" )) + "$cur" ) ) fi return 0 diff --git a/completions/lastlog b/completions/lastlog index 8663afd7..a8724029 100644 --- a/completions/lastlog +++ b/completions/lastlog @@ -17,11 +17,8 @@ _lastlog() $split && return 0 - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace - return 0 - fi + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace } && complete -F _lastlog lastlog diff --git a/completions/ldapvi b/completions/ldapvi index f2d2c293..9c9b6491 100644 --- a/completions/ldapvi +++ b/completions/ldapvi @@ -11,8 +11,8 @@ _ldapvi() return 0 ;; -Y|--sasl-mech) - COMPREPLY=( $( compgen -W 'EXTERNAL GSSAPI DIGEST-MD5 \ - CRAM-MD5 PLAIN ANONYMOUS' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 + PLAIN ANONYMOUS' -- "$cur" ) ) return 0 ;; --bind) @@ -20,7 +20,7 @@ _ldapvi() return 0 ;; --bind-dialog) - COMPREPLY=( $( compgen -W 'never auto always' -- $cur ) ) + COMPREPLY=( $( compgen -W 'never auto always' -- "$cur" ) ) return 0 ;; --scope) @@ -37,8 +37,7 @@ _ldapvi() return 0 ;; --tls) - COMPREPLY=( $( compgen -W 'never allow try strict' \ - -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'never allow try strict' -- "$cur" ) ) return 0 ;; esac diff --git a/completions/lilo b/completions/lilo index f81f049a..3073183c 100644 --- a/completions/lilo +++ b/completions/lilo @@ -33,16 +33,16 @@ _lilo() ;; -T) # topic completion - COMPREPLY=( $( compgen -W 'help ChRul EBDA geom geom= \ - table= video' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'help ChRul EBDA geom geom= table= + video' -- "$cur" ) ) return 0 ;; esac if [[ "$cur" == -* ]]; then # relevant options completion - COMPREPLY=( $( compgen -W '-A -b -c -C -d -f -g -i -I -l -L -m \ - -M -p -P -q -r -R -s -S -t -T -u -U -v -V -w -x -z' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '-A -b -c -C -d -f -g -i -I -l -L -m -M -p -P + -q -r -R -s -S -t -T -u -U -v -V -w -x -z' -- "$cur" ) ) fi } && complete -F _lilo lilo diff --git a/completions/links b/completions/links index 5adc7de3..abb19900 100644 --- a/completions/links +++ b/completions/links @@ -10,12 +10,12 @@ _links() COMPREPLY=( $( compgen -W '--help' -- "$cur" ) ) ;; -*) - COMPREPLY=( $( compgen -W '-async-dns -max-connections \ - -max-connections-to-host -retries -receive-timeout \ - -unrestartable-receive-timeout -format-cache-size \ - -memory-cache-size -http-proxy -ftp-proxy -download-dir \ - -assume-codepage -anonymous -dump -no-connect \ - -source -version -help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '-async-dns -max-connections + -max-connections-to-host -retries -receive-timeout + -unrestartable-receive-timeout -format-cache-size + -memory-cache-size -http-proxy -ftp-proxy -download-dir + -assume-codepage -anonymous -dump -no-connect -source -version + -help' -- "$cur" ) ) ;; *) if [[ -r ~/.links/links.his ]]; then diff --git a/completions/lintian b/completions/lintian index 8e470758..1c9eaa6e 100644 --- a/completions/lintian +++ b/completions/lintian @@ -82,17 +82,16 @@ _lintian() local action lint_actions general_opts behaviour_opts \ configuration_opts selection_opts - lint_actions="--setup-lab --remove-lab --check --check-part --tags \ - --tags-from-file --ftp-master-rejects --dont-check-part \ - --unpack --remove" + 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 \ - --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" + behaviour_opts="--info --display-info --display-experimental --pedantic + --display-level --suppress-tags --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 @@ -126,8 +125,8 @@ _lintian() case "$cur" in --*) - COMPREPLY=($(compgen -W "$lint_actions $general_opts \ - $behaviour_opts $configuration_opts" -- "$cur")) + COMPREPLY=($(compgen -W "$lint_actions $general_opts + $behaviour_opts $configuration_opts" -- "$cur")) ;; *,) # If we're here, the user is trying to complete on diff --git a/completions/lisp b/completions/lisp index 941eae44..45cd4e6f 100644 --- a/completions/lisp +++ b/completions/lisp @@ -9,8 +9,8 @@ _lisp() # completing an option (may or may not be separated by a space) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-core -lib -batch -quit -edit -eval -init \ - -dynamic-space-size -hinit -noinit -nositeinit -load -slave ' \ + COMPREPLY=( $( compgen -W '-core -lib -batch -quit -edit -eval -init + -dynamic-space-size -hinit -noinit -nositeinit -load -slave' \ -- "$cur" ) ) else _filedir diff --git a/completions/list_lists b/completions/list_lists index 8ef2156a..04471e1e 100644 --- a/completions/list_lists +++ b/completions/list_lists @@ -11,8 +11,8 @@ _list_lists() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--advertised --virtual-host-overview \ - --bare --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--advertised --virtual-host-overview --bare + --help' -- "$cur" ) ) fi } && diff --git a/completions/list_members b/completions/list_members index b6262b7c..d432b36c 100644 --- a/completions/list_members +++ b/completions/list_members @@ -11,12 +11,12 @@ _list_members() return 0 ;; -d|--digest) - COMPREPLY=( $( compgen -W 'mime plain' -- "$cur") ) + COMPREPLY=( $( compgen -W 'mime plain' -- "$cur" ) ) return 0 ;; -n|--nomail) COMPREPLY=( $( compgen -W 'byadmin byuser bybounce unknown' \ - -- "$cur") ) + -- "$cur" ) ) return 0 ;; esac @@ -24,8 +24,8 @@ _list_members() $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--output --regular --digest \ - --nomail --fullnames --preserve --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--output --regular --digest --nomail + --fullnames --preserve --help' -- "$cur" ) ) else _xfunc list_lists _mailman_lists fi diff --git a/completions/list_owners b/completions/list_owners index e4d67505..a780265b 100644 --- a/completions/list_owners +++ b/completions/list_owners @@ -6,8 +6,8 @@ _list_owners() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--with-listnames --moderators \ - --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--with-listnames --moderators --help' \ + -- "$cur" ) ) else _xfunc list_lists _mailman_lists fi diff --git a/completions/lua b/completions/lua new file mode 100644 index 00000000..83dc7368 --- /dev/null +++ b/completions/lua @@ -0,0 +1,23 @@ +# lua(1) completion -*- shell-script -*- + +_lua() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -e|-l|-v|-) + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W "$( _parse_help "$1" )" -- "$cur" ) ) + return + fi + + _filedir 'l@(ua|?(ua)c)' +} && +complete -F _lua lua + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/luac b/completions/luac new file mode 100644 index 00000000..a0330735 --- /dev/null +++ b/completions/luac @@ -0,0 +1,27 @@ +# luac(1) completion -*- shell-script -*- + +_luac() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -v|-) + return + ;; + -o) + _filedir + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W "$( _parse_help "$1" )" -- "$cur" ) ) + return + fi + + _filedir lua +} && +complete -F _luac luac + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/luseradd b/completions/luseradd new file mode 100644 index 00000000..e5b00c3c --- /dev/null +++ b/completions/luseradd @@ -0,0 +1,40 @@ +# luseradd(1) and lusermod(1) completion -*- shell-script -*- + +_luseradd() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + -\?|--help|--usage|-c|--gecos|-u|--uid|-l|--login|-P|--plainpassword|\ + -p|--password|--commonname|--givenname|--surname|--roomnumber|\ + --telephonenumber|--homephone) + return + ;; + -d|--directory|-k|--skeleton) + _filedir -d + return + ;; + -s|--shell) + _shells + return + ;; + -g|--gid) + _gids + return + ;; + esac + + $split && return + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + fi + + [[ ${1##*/} == luseradd ]] || COMPREPLY=( $( compgen -u -- "$cur" ) ) +} && +complete -F _luseradd luseradd lusermod + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/luserdel b/completions/luserdel new file mode 100644 index 00000000..05faaac2 --- /dev/null +++ b/completions/luserdel @@ -0,0 +1,23 @@ +# luserdel(1) completion -*- shell-script -*- + +_luserdel() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -\?|--help|--usage) + return + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + return + fi + + COMPREPLY=( $( compgen -u -- "$cur" ) ) +} && +complete -F _luserdel luserdel + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/lvm b/completions/lvm index b657e0bd..ba0720ed 100644 --- a/completions/lvm +++ b/completions/lvm @@ -1,45 +1,54 @@ # bash completion for lvm -*- shell-script -*- -_volumegroups() +_lvm_volumegroups() { COMPREPLY=( $(compgen -W "$( vgscan 2>/dev/null | \ sed -n -e 's|.*Found.*"\(.*\)".*$|\1|p' )" -- "$cur" ) ) } -_physicalvolumes() +_lvm_physicalvolumes() { COMPREPLY=( $(compgen -W "$( pvscan 2>/dev/null | \ sed -n -e 's|^.*PV \(.*\) VG.*$|\1|p' )" -- "$cur" ) ) } -_logicalvolumes() +_lvm_logicalvolumes() { COMPREPLY=( $(compgen -W "$( lvscan 2>/dev/null | \ sed -n -e "s|^.*'\(.*\)'.*$|\1|p" )" -- "$cur" ) ) + if [[ $cur == /dev/mapper/* ]]; then + _filedir + local i + for i in ${!COMPREPLY[@]}; do + [[ ${COMPREPLY[i]} == */control ]] && unset COMPREPLY[i] + done + fi } -_units() +_lvm_units() { COMPREPLY=( $( compgen -W 'h s b k m g t H K M G T' -- "$cur" ) ) } -_sizes() +_lvm_sizes() { COMPREPLY=( $( compgen -W 'k K m M g G t T' -- "$cur" ) ) } -_args() +# @param $1 glob matching args known to take an argument +_lvm_count_args() { args=0 + local offset=1 if [[ "${words[0]}" == lvm ]]; then offset=2 - else - offset=1 fi + local i prev=${words[$offset-1]} for (( i=$offset; i < cword; i++ )); do - if [[ "${words[i]}" != -* ]]; then + if [[ "${words[i]}" != -* && $prev != $1 ]]; then args=$(($args + 1)) fi + prev=${words[i]} done } @@ -60,9 +69,9 @@ _pvscan() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--debug --exported --novolumegroup \ - --help --ignorelockingfailure --partial --short --uuid \ - --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--debug --exported --novolumegroup --help + --ignorelockingfailure --partial --short --uuid --verbose + --version' -- "$cur" ) ) fi } && complete -F _pvscan pvscan @@ -74,14 +83,12 @@ _pvs() 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 \ - pv_pe_alloc_count' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'pv_fmt pv_uuid pv_size pv_free pv_used + pv_name pv_attr pv_pe_count pv_pe_alloc_count' -- "$cur" ) ) return 0 ;; --units) - _units + _lvm_units return 0 ;; esac @@ -89,7 +96,7 @@ _pvs() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _physicalvolumes + _lvm_physicalvolumes fi } && complete -F _pvs pvs @@ -101,7 +108,7 @@ _pvdisplay() case $prev in --units) - _units + _lvm_units return 0 ;; esac @@ -109,7 +116,7 @@ _pvdisplay() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _physicalvolumes + _lvm_physicalvolumes fi } && complete -F _pvdisplay pvdisplay @@ -129,7 +136,7 @@ _pvchange() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _physicalvolumes + _lvm_physicalvolumes fi } && complete -F _pvchange pvchange @@ -153,7 +160,7 @@ _pvcreate() return 0 ;; --metadatasize|--setphysicalvolumesize) - _sizes + _lvm_sizes return 0 ;; esac @@ -161,7 +168,7 @@ _pvcreate() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _physicalvolumes + _lvm_physicalvolumes fi } && complete -F _pvcreate pvcreate @@ -177,16 +184,16 @@ _pvmove() return 0 ;; -n|--name) - _logicalvolumes + _lvm_logicalvolumes return 0 esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--abort --autobackup \ - --background --debug --force --help --interval --test --verbose \ - --version --name' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--abort --autobackup --background --debug + --force --help --interval --test --verbose --version --name' \ + -- "$cur" ) ) else - _physicalvolumes + _lvm_physicalvolumes fi } && complete -F _pvmove pvmove @@ -199,7 +206,7 @@ _pvremove() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _physicalvolumes + _lvm_physicalvolumes fi } && complete -F _pvremove pvremove @@ -222,15 +229,14 @@ _vgs() 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 \ - max_lv max_pv pv_count lv_count snap_count \ - vg_seqno' -- "$cur" ) ) + 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 + max_lv max_pv pv_count lv_count snap_count vg_seqno' \ + -- "$cur" ) ) return 0 ;; --units) - _units + _lvm_units return 0 ;; esac @@ -238,7 +244,7 @@ _vgs() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _volumegroups + _lvm_volumegroups fi } && complete -F _vgs vgs @@ -250,7 +256,7 @@ _vgdisplay() case $prev in --units) - _units + _lvm_units return 0 ;; esac @@ -258,7 +264,7 @@ _vgdisplay() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _volumegroups + _lvm_volumegroups fi } && complete -F _vgdisplay vgdisplay @@ -276,13 +282,12 @@ _vgchange() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--autobackup --alloc \ - --partial --debug --help --ignorelockingfailure \ - --test --uuid --verbose --version \ - --available --resizeable --logicalvolume \ - --addtag --deltag' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--autobackup --alloc --partial --debug + --help --ignorelockingfailure --test --uuid --verbose --version + --available --resizeable --logicalvolume --addtag --deltag' \ + -- "$cur" ) ) else - _volumegroups + _lvm_volumegroups fi } && complete -F _vgchange vgchange @@ -302,22 +307,22 @@ _vgcreate() return 0 ;; -s|--physicalextentsize) - _sizes + _lvm_sizes return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--autobackup --addtag --alloc \ - --debug --help --maxlogicalvolumes --metadatatype \ - --maxphysicalvolumes --physicalextentsize --test \ - --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--autobackup --addtag --alloc --debug --help + --maxlogicalvolumes --metadatatype --maxphysicalvolumes + --physicalextentsize --test --verbose --version' -- "$cur" ) ) else - _args + local args + _lvm_count_args @(-A|--autobackup|-M|--metadatatype|-s|--physicalextentsize) if [[ $args -eq 0 ]]; then - _volumegroups + _lvm_volumegroups else - _physicalvolumes + _lvm_physicalvolumes fi fi } && @@ -331,7 +336,7 @@ _vgremove() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _volumegroups + _lvm_volumegroups fi } && complete -F _vgremove vgremove @@ -351,7 +356,7 @@ _vgrename() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _volumegroups + _lvm_volumegroups fi } && complete -F _vgrename vgrename @@ -372,11 +377,12 @@ _vgreduce() COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _args + local args + _lvm_count_args @(-A|--autobackup) if [[ $args -eq 0 ]]; then - _volumegroups + _lvm_volumegroups else - _physicalvolumes + _lvm_physicalvolumes fi fi } && @@ -393,7 +399,7 @@ _vgextend() return 0 ;; -L|--size) - _sizes + _lvm_sizes return 0 ;; esac @@ -401,11 +407,12 @@ _vgextend() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _args + local args + _lvm_count_args @(-A|--autobackup|-L|--size) if [[ $args -eq 0 ]]; then - _volumegroups + _lvm_volumegroups else - _physicalvolumes + _lvm_physicalvolumes fi fi } && @@ -419,7 +426,7 @@ _vgport() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _volumegroups + _lvm_volumegroups fi } && complete -F _vgport vgimport vgexport @@ -432,7 +439,7 @@ _vgck() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _volumegroups + _lvm_volumegroups fi } && complete -F _vgck vgck @@ -452,7 +459,7 @@ _vgconvert() return 0 ;; --metadatasize) - _sizes + _lvm_sizes return 0 ;; esac @@ -460,7 +467,7 @@ _vgconvert() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _volumegroups + _lvm_volumegroups fi } && complete -F _vgconvert vgconvert @@ -480,7 +487,7 @@ _vgcfgbackup() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _volumegroups + _lvm_volumegroups fi } && complete -F _vgcfgbackup vgcfgbackup @@ -500,7 +507,7 @@ _vgcfgrestore() return 0 ;; -n|--name) - _volumegroups + _lvm_volumegroups return 0 ;; esac @@ -508,7 +515,7 @@ _vgcfgrestore() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _volumegroups + _lvm_volumegroups fi } && complete -F _vgcfgrestore vgcfgrestore @@ -528,7 +535,7 @@ _vgmerge() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _volumegroups + _lvm_volumegroups fi } && complete -F _vgmerge vgmerge @@ -550,15 +557,15 @@ _vgsplit() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--autobackup --debug \ - --help --list --metadatatype --test \ - --verbose --version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--autobackup --debug --help --list + --metadatatype --test --verbose --version' -- "$cur" ) ) else - _args + local args + _lvm_count_args @(-A|--autobackup|-M|--metadatatype) if [[ $args -eq 0 || $args -eq 1 ]]; then - _volumegroups + _lvm_volumegroups else - _physicalvolumes + _lvm_physicalvolumes fi fi } && @@ -572,7 +579,7 @@ _vgmknodes() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _volumegroups + _lvm_volumegroups fi } && complete -F _vgmknodes vgmknodes @@ -595,13 +602,13 @@ _lvs() 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" ) ) + 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" ) ) return 0 ;; --units) - _units + _lvm_units return 0 ;; esac @@ -609,7 +616,7 @@ _lvs() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _logicalvolumes + _lvm_logicalvolumes fi } && complete -F _lvs lvs @@ -621,7 +628,7 @@ _lvdisplay() case $prev in --units) - _units + _lvm_units return 0 ;; esac @@ -629,7 +636,7 @@ _lvdisplay() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _logicalvolumes + _lvm_logicalvolumes fi } && complete -F _lvdisplay lvdisplay @@ -640,7 +647,7 @@ _lvchange() _init_completion || return case $prev in - -a|-A|-C|-M|--available|--autobackup|--continguous|--persistent) + -a|-A|-C|-M|--available|--autobackup|--contiguous|--persistent) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; @@ -653,7 +660,7 @@ _lvchange() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _logicalvolumes + _lvm_logicalvolumes fi } && complete -F _lvchange lvchange @@ -664,12 +671,12 @@ _lvcreate() _init_completion || return case $prev in - -A|-C|-M|-Z|--autobackup|--continguous|--persistent|--zero) + -A|-C|-M|-Z|--autobackup|--contiguous|--persistent|--zero) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; -L|--size) - _sizes + _lvm_sizes return 0 ;; -p|--permission) @@ -677,7 +684,7 @@ _lvcreate() return 0 ;; -n|--name) - _logicalvolumes + _lvm_logicalvolumes return 0 ;; esac @@ -685,11 +692,12 @@ _lvcreate() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _args + local args + _lvm_count_args @(-A|-C|-M|-Z|--autobackup|--contiguous|--persistent|--zero|-L|--size|-p|--permission|-n|--name) if [[ $args -eq 0 ]]; then - _volumegroups + _lvm_volumegroups else - _physicalvolumes + _lvm_physicalvolumes fi fi } && @@ -710,7 +718,7 @@ _lvremove() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _logicalvolumes + _lvm_logicalvolumes fi } && complete -F _lvremove lvremove @@ -730,7 +738,7 @@ _lvrename() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _logicalvolumes + _lvm_logicalvolumes fi } && complete -F _lvrename lvrename @@ -746,7 +754,7 @@ _lvreduce() return 0 ;; -L|--size) - _sizes + _lvm_sizes return 0 ;; esac @@ -754,7 +762,7 @@ _lvreduce() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _logicalvolumes + _lvm_logicalvolumes fi } && complete -F _lvreduce lvreduce @@ -770,7 +778,7 @@ _lvresize() return 0 ;; -L|--size) - _sizes + _lvm_sizes return 0 ;; esac @@ -778,11 +786,12 @@ _lvresize() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _args + local args + _lvm_count_args @(-A|--autobackup|-L|--size) if [[ $args -eq 0 ]]; then - _logicalvolumes + _lvm_logicalvolumes else - _physicalvolumes + _lvm_physicalvolumes fi fi } && @@ -799,7 +808,7 @@ _lvextend() return 0 ;; -L|--size) - _sizes + _lvm_sizes return 0 ;; esac @@ -807,11 +816,12 @@ _lvextend() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _args + local args + _lvm_count_args @(-A|--autobackup|-L|--size) if [[ $args -eq 0 ]]; then - _logicalvolumes + _lvm_logicalvolumes else - _physicalvolumes + _lvm_physicalvolumes fi fi } && @@ -823,17 +833,13 @@ _lvm() _init_completion || return if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W 'dumpconfig help lvchange \ - lvcreate lvdisplay lvextend lvmchange \ - lvmdiskscan lvmsadc lvmsar lvreduce \ - lvremove lvrename lvresize lvs lvscan \ - pvchange pvcreate pvdata pvdisplay pvmove \ - pvremove pvresize pvs pvscan vgcfgbackup \ - vgcfgrestore vgchange vgck vgconvert \ - vgcreate vgdisplay vgexport vgextend \ - vgimport vgmerge vgmknodes vgreduce \ - vgremove vgrename vgs vgscan vgsplit \ - version' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'dumpconfig help lvchange lvcreate lvdisplay + lvextend lvmchange lvmdiskscan lvmsadc lvmsar lvreduce lvremove + lvrename lvresize lvs lvscan pvchange pvcreate pvdata pvdisplay + pvmove pvremove pvresize pvs pvscan vgcfgbackup vgcfgrestore + vgchange vgck vgconvert vgcreate vgdisplay vgexport vgextend + vgimport vgmerge vgmknodes vgreduce vgremove vgrename vgs vgscan + vgsplit version' -- "$cur" ) ) else case ${words[1]} in pvchange) diff --git a/completions/lzip b/completions/lzip index 9df55382..ae35b9d4 100644 --- a/completions/lzip +++ b/completions/lzip @@ -9,12 +9,16 @@ _lzip() case $prev in -h|--help|-V|--version|-b|--member-size|-m|--match-length|\ - -s|--dictionary-size|-S|--volume-size) + -s|--dictionary-size|-S|--volume-size|-B|--data-size) return ;; -d|--decompress) decompress=true ;; + -n|--threads) + COMPREPLY=( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) ) + return + ;; -o|--output) _filedir return @@ -26,6 +30,7 @@ _lzip() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) {-1..-9}' \ -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace return fi @@ -39,6 +44,6 @@ _lzip() COMPREPLY=( $( compgen -f -X "*.lz" -- "$cur" ) \ $( compgen -d -- "$cur" ) ) } && -complete -F _lzip lzip +complete -F _lzip clzip lzip pdlzip plzip # ex: ts=4 sw=4 et filetype=sh diff --git a/completions/lzma b/completions/lzma index d377d15f..30566ed0 100644 --- a/completions/lzma +++ b/completions/lzma @@ -7,10 +7,10 @@ _lzma() _init_completion || return if [[ "$cur" == -* ]]; then - 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" ) ) + 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 diff --git a/completions/lzop b/completions/lzop index a5084bb0..e23d5410 100644 --- a/completions/lzop +++ b/completions/lzop @@ -20,13 +20,13 @@ _lzop() esac if [[ "$cur" == -* ]]; then - 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" ) ) + 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 diff --git a/completions/macof b/completions/macof index b81b630a..264f1c9d 100644 --- a/completions/macof +++ b/completions/macof @@ -7,7 +7,7 @@ _macof() case $prev in -i) - _interfaces + _available_interfaces -a return 0 ;; esac diff --git a/completions/mailmanctl b/completions/mailmanctl index 4a49668f..5e6ed2ee 100644 --- a/completions/mailmanctl +++ b/completions/mailmanctl @@ -6,7 +6,7 @@ _mailmanctl() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--no-restart --run-as-user \ + COMPREPLY=( $( compgen -W '--no-restart --run-as-user --stale-lock-cleanup --quiet --help' -- "$cur" ) ) else COMPREPLY=( $( compgen -W 'start stop restart reopen' -- "$cur" ) ) diff --git a/completions/make b/completions/make index 1aec3489..b4ad9e73 100644 --- a/completions/make +++ b/completions/make @@ -1,11 +1,81 @@ # bash completion for GNU make -*- shell-script -*- +function _make_target_extract_script() +{ + local mode="$1" + shift + + local prefix="$1" + local prefix_pat=$( printf "%s\n" "$prefix" | \ + sed 's/[][\,.*^$(){}?+|/]/\\&/g' ) + local basename=${prefix##*/} + local dirname_len=$(( ${#prefix} - ${#basename} )) + + if [[ $mode == -d ]]; then + # display mode, only output current path component to the next slash + local output="\2" + else + # completion mode, output full path to the next slash + local output="\1\2" + fi + + cat <<EOF + /^# Make data base/,/^# Files/d # skip until files section + /^# Not a target/,/^$/ d # skip not target blocks + /^${prefix_pat}/,/^$/! d # skip anything user dont want + + # The stuff above here describes lines that are not + # explicit targets or not targets other than special ones + # The stuff below here decides whether an explicit target + # should be output. + + /^# File is an intermediate prerequisite/ { + s/^.*$//;x # unhold target + d # delete line + } + + /^$/ { # end of target block + x # unhold target + /^$/d # dont print blanks + s,^(.{${dirname_len}})(.{${#basename}}[^:/]*/?)[^:]*:.*$,${output},p + d # hide any bugs + } + + /^[^#\t:%]+:/ { # found target block + + /^\.PHONY:/ d # special target + /^\.SUFFIXES:/ d # special target + /^\.DEFAULT:/ d # special target + /^\.PRECIOUS:/ d # special target + /^\.INTERMEDIATE:/ d # special target + /^\.SECONDARY:/ d # special target + /^\.SECONDEXPANSION:/ d # special target + /^\.DELETE_ON_ERROR:/ d # special target + /^\.IGNORE:/ d # special target + /^\.LOW_RESOLUTION_TIME:/ d # special target + /^\.SILENT:/ d # special target + /^\.EXPORT_ALL_VARIABLES:/ d # special target + /^\.NOTPARALLEL:/ d # special target + /^\.ONESHELL:/ d # special target + /^\.POSIX:/ d # special target + /^\.NOEXPORT:/ d # special target + /^\.MAKE:/ d # special target + + /^[^a-zA-Z0-9]/ d # convention for hidden tgt + + h # hold target + d # delete line + } + +EOF +} + _make() { local cur prev words cword split _init_completion -s || return - local file makef makef_dir="." makef_inc i + local file makef makef_dir=( "-C" "." ) makef_inc i case $prev in -f|--file|--makefile|-o|--old-file|--assume-old|-W|--what-if|\ @@ -49,7 +119,7 @@ _make() for (( i=0; i < ${#words[@]}; i++ )); do if [[ ${words[i]} == -@(C|-directory) ]]; then # eval for tilde expansion - eval makef_dir=${words[i+1]} + eval makef_dir=( -C "${words[i+1]}" ) break fi done @@ -59,21 +129,32 @@ _make() for (( i=0; i < ${#words[@]}; i++ )); do if [[ ${words[i]} == -@(f|-?(make)file) ]]; then # eval for tilde expansion - eval makef=${words[i+1]} + eval makef=( -f "${words[i+1]}" ) break fi done - [[ -n $makef ]] && makef="-f ${makef}" - [[ -n $makef_dir ]] && makef_dir="-C ${makef_dir}" + # recognise that possible completions are only going to be displayed + # so only the base name is shown + local mode=-- + if (( COMP_TYPE != 9 )); then + mode=-d # display-only mode + fi + + local reset=$( set +o | grep -F posix ); set +o posix # for <(...) + COMPREPLY=( $( LC_ALL=C \ + make -npq "${makef[@]}" "${makef_dir[@]}" .DEFAULT 2>/dev/null | \ + sed -nrf <(_make_target_extract_script $mode "$cur") ) ) + $reset - COMPREPLY=( $( compgen -W "$( make -qp $makef $makef_dir 2>/dev/null | \ - awk -F':' '/^[a-zA-Z0-9][^$#\/\t=]*:([^=]|$)/ \ - {split($1,A,/ /);for(i in A)print A[i]}' )" \ - -- "$cur" ) ) + if [[ $mode != -d ]]; then + # Completion will occur if there is only one suggestion + # so set options for completion based on the first one + [[ $COMPREPLY == */ ]] && compopt -o nospace + fi fi } && -complete -F _make make gmake gnumake pmake +complete -F _make make gmake gnumake pmake colormake # ex: ts=4 sw=4 et filetype=sh diff --git a/completions/makepkg b/completions/makepkg index c24c9cc4..3aa836e5 100644 --- a/completions/makepkg +++ b/completions/makepkg @@ -13,8 +13,8 @@ _makepkg() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-l --linkadd -p --prepend \ - -c --chown' -- "$cur") ) + COMPREPLY=( $( compgen -W '-l --linkadd -p --prepend -c --chown' \ + -- "$cur" ) ) return 0 fi diff --git a/completions/man b/completions/man index 0c3769d5..6e42f85f 100644 --- a/completions/man +++ b/completions/man @@ -8,10 +8,9 @@ _man() local cur prev words cword split _init_completion -s -n : || return - local sect manpath manext mansect - - manext="@([0-9lnp]|[0-9][px]|man|3?(gl|pm))?(.@([gx]z|bz2|lzma|Z))" - mansect="@([0-9lnp]|[0-9][px]|3?(gl|pm))" + local comprsuffix=".@([glx]z|bz2|lzma|Z)" + local manext="@([0-9lnp]|[0-9][px]|man|3?(gl|pm))?($comprsuffix)" + local mansect="@([0-9lnp]|[0-9][px]|3?(gl|pm))" case $prev in -C|--config-file) @@ -19,7 +18,7 @@ _man() return ;; -l|--local-file) - _filedir $manext + _filedir "$manext" return ;; -M|--manpath) @@ -27,6 +26,7 @@ _man() return ;; -P|--pager) + compopt -o filenames COMPREPLY=( $( compgen -c -- "$cur" ) ) return ;; @@ -52,10 +52,11 @@ _man() # file based completion if parameter looks like a path if [[ "$cur" == @(*/|[.~])* ]]; then - _filedir $manext + _filedir "$manext" return 0 fi + local manpath if [[ $OSTYPE == *@(darwin|linux|freebsd|cygwin)* ]] || _userland GNU; then manpath=$( manpath 2>/dev/null || command man --path ) else @@ -68,6 +69,7 @@ _man() fi # determine manual section to search + local sect [[ "$prev" == $mansect ]] && sect=$prev || sect='*' manpath=$manpath: @@ -82,14 +84,14 @@ _man() # weed out directory path names and paths to man pages COMPREPLY=( ${COMPREPLY[@]##*/?(:)} ) # strip suffix from man pages - COMPREPLY=( ${COMPREPLY[@]%.@([gx]z|bz2|lzma|Z)} ) + COMPREPLY=( ${COMPREPLY[@]%$comprsuffix} ) COMPREPLY=( $( compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}" ) ) if [[ "$prev" != $mansect ]]; then # File based completion for the rest, prepending ./ if needed # (man 1.6f needs that for man pages in current dir) local i start=${#COMPREPLY[@]} - _filedir $manext + _filedir "$manext" for (( i=$start; i < ${#COMPREPLY[@]}; i++ )); do [[ ${COMPREPLY[i]} == */* ]] || COMPREPLY[i]=./${COMPREPLY[i]} done diff --git a/completions/mdadm b/completions/mdadm index f0e917fd..111a2c35 100644 --- a/completions/mdadm +++ b/completions/mdadm @@ -19,13 +19,13 @@ _mdadm_raid_level() case $mode in create) - COMPREPLY=( $( compgen -W 'linear raid0 0 stripe raid1 1 mirror \ + COMPREPLY=( $( compgen -W 'linear raid0 0 stripe raid1 1 mirror raid4 4 raid5 5 raid6 6 raid10 10 multipath mp faulty' \ -- "$cur" ) ) ;; build) - COMPREPLY=( $( compgen -W 'linear stripe raid0 0 raid1 multipath \ - mp faulty' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'linear stripe raid0 0 raid1 multipath mp + faulty' -- "$cur" ) ) ;; esac } @@ -42,16 +42,16 @@ _mdadm_raid_layout() case $level in raid5) - COMPREPLY=( $( compgen -W 'left-asymmetric left-symmetric \ + COMPREPLY=( $( compgen -W 'left-asymmetric left-symmetric right-asymmetric right-symmetric la ra ls rs' -- "$cur" ) ) ;; raid10) COMPREPLY=( $( compgen -W 'n o p' -- "$cur" ) ) ;; faulty) - COMPREPLY=( $( compgen -W 'write-transient wt read-transient rt \ - write-persistent wp read-persistent rp write-all read-fixable \ - rf clear flush none' -- $cur ) ) + COMPREPLY=( $( compgen -W 'write-transient wt read-transient rt + write-persistent wp read-persistent rp write-all read-fixable + rf clear flush none' -- "$cur" ) ) ;; esac } @@ -63,7 +63,7 @@ _mdadm_auto_flag() _mdadm_update_flag() { - COMPREPLY=( $( compgen -W 'sparc2.2 summaries uuid name homehost resync \ + COMPREPLY=( $( compgen -W 'sparc2.2 summaries uuid name homehost resync byteorder super-minor' -- "$cur" ) ) } @@ -98,45 +98,44 @@ _mdadm() $split && return 0 - local options - options='--help --help-options --version --verbose --quiet \ - --brief --force --config= --scan --metadata= --homehost=' + local options='--help --help-options --version --verbose --quiet --brief + --force --config= --scan --metadata= --homehost=' if [[ "$cur" == -* ]]; then if [[ $cword -eq 1 ]] ; then - COMPREPLY=( $( compgen -W "$options --assemble --build \ - --create --monitor --grow" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "$options --assemble --build --create + --monitor --grow" -- "$cur" ) ) else case ${words[cword-1]} in -A|--assemble) - COMPREPLY=( $( compgen -W "$options --uuid= \ - --super-minor= --name= --force --run \ - --no-degraded --auto= --bitmap= --backup-file= \ - --update= --auto-update-homehost" -- "$cur" ) ) + 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 --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" ) ) + 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 --mail --program \ - --alert --syslog --delay --daemonise \ - --pid-file --oneshot --test" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "$options --mail --program + --alert --syslog --delay --daemonise --pid-file + --oneshot --test" -- "$cur" ) ) ;; /dev/*|--add|--fail|--remove) - COMPREPLY=( $( compgen -W "$options --add --re-add \ + COMPREPLY=( $( compgen -W "$options --add --re-add --remove --fail --set-faulty" -- "$cur" ) ) ;; *) - COMPREPLY=( $( compgen -W "$options --query --detail \ - --examine --sparc2.2 --examine-bitmap --run \ - --stop --readonly --readwrite \ - --zero-superblock --test" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "$options --query --detail + --examine --sparc2.2 --examine-bitmap --run --stop + --readonly --readwrite --zero-superblock --test" \ + -- "$cur" ) ) ;; esac fi diff --git a/completions/mdtool b/completions/mdtool index 43358865..879dabf6 100644 --- a/completions/mdtool +++ b/completions/mdtool @@ -42,9 +42,9 @@ _mdtool() ;; "setup") # TODO: at least return filenames after these options. - COMPREPLY=( $( compgen -W 'install i uninstall u check-install \ - ci update up list l list-av la list-update lu rep-add ra \ - rep-remove rr rep-update ru rep-list rl reg-update \ + COMPREPLY=( $( compgen -W 'install i uninstall u check-install + ci update up list l list-av la list-update lu rep-add ra + rep-remove rr rep-update ru rep-list rl reg-update reg-build rgu info rep-build rb pack p help h dump-file' \ -- "$cur" ) ) return 0 @@ -52,7 +52,7 @@ _mdtool() esac fi - COMPREPLY=( $( compgen -W 'gsetup build dbgen project-export \ + COMPREPLY=( $( compgen -W 'gsetup build dbgen project-export generate-makefiles gettext-update setup -q' -- "$cur" ) ) return 0 diff --git a/completions/mii-diag b/completions/mii-diag index 5e94877f..2743d9d0 100644 --- a/completions/mii-diag +++ b/completions/mii-diag @@ -7,9 +7,8 @@ _mii_diag() case $prev in -F|-A|--advertise|--fixed-speed) - COMPREPLY=( $( compgen -W '100baseT4 100baseTx \ - 100baseTx-FD 100baseTx-HD 10baseT 10baseT-FD \ - 10baseT-HD' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '100baseT4 100baseTx 100baseTx-FD + 100baseTx-HD 10baseT 10baseT-FD 10baseT-HD' -- "$cur" ) ) return 0 ;; esac diff --git a/completions/mii-tool b/completions/mii-tool index effaa1db..facebe4a 100644 --- a/completions/mii-tool +++ b/completions/mii-tool @@ -7,12 +7,12 @@ _mii_tool() case $prev in -F|--force) - COMPREPLY=( $( compgen -W '100baseTx-FD 100baseTx-HD \ - 10baseT-FD 10baseT-HD' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '100baseTx-FD 100baseTx-HD 10baseT-FD + 10baseT-HD' -- "$cur" ) ) return 0 ;; -A|--advertise) - COMPREPLY=( $( compgen -W '100baseT4 100baseTx-FD 100baseTx-HD \ + COMPREPLY=( $( compgen -W '100baseT4 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD' -- "$cur" ) ) return 0 ;; diff --git a/completions/minicom b/completions/minicom index cad90926..d168ce44 100644 --- a/completions/minicom +++ b/completions/minicom @@ -24,8 +24,8 @@ _minicom() if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-s -o -m -M -z -l -L -w -a -t \ - -c -S -d -p -C -T -7 -8' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '-s -o -m -M -z -l -L -w -a -t -c -S -d -p -C + -T -7 -8' -- "$cur" ) ) return 0 else local confdir diff --git a/completions/modinfo b/completions/modinfo index 2a359871..f0016843 100644 --- a/completions/modinfo +++ b/completions/modinfo @@ -9,7 +9,7 @@ _modinfo() -F|--field) COMPREPLY=( $( compgen -W 'alias author depends description filename firmware license parm srcversion staging vermagic - version' -- "$(echo "$cur" | tr '[:upper:]' '[:lower:]')" ) ) + version' -- "${cur,,}" ) ) return ;; -k) diff --git a/completions/modprobe b/completions/modprobe index cf35f4b9..b59e4dca 100644 --- a/completions/modprobe +++ b/completions/modprobe @@ -77,6 +77,20 @@ _modprobe() -p "$module" 2>/dev/null | cut -d: -f1 )" -- "$cur" ) ) else _modules $version + if [[ $COMPREPLY ]]; then + # filter out already installed modules + local -a mods=( "${COMPREPLY[@]}" ) + _installed_modules "$cur" + for i in ${!mods[@]}; do + for module in ${COMPREPLY[@]}; do + if [[ ${mods[i]} == $module ]]; then + unset mods[i] + break + fi + done + done + COMPREPLY=( "${mods[@]}" ) + fi fi ;; esac diff --git a/completions/mount b/completions/mount index ffe6629a..6818ac39 100644 --- a/completions/mount +++ b/completions/mount @@ -53,7 +53,8 @@ _mount() # probably Cygwin COMPREPLY=( $( compgen -W "$( mount | awk '! /^[ \t]*#/ {if ($3 ~ /\//) print $3}' )" -- "$cur" ) ) else - COMPREPLY=( $( compgen -W "$( awk '! /^[ \t]*#/ {if ($3 ~ /\//) print $3}' /etc/fstab )" -- "$cur" ) ) + # probably BSD + COMPREPLY=( $( compgen -W "$( awk '! /^[ \t]*#/ {if ($2 ~ /\//) print $2}' /etc/fstab )" -- "$cur" ) ) fi } && complete -F _mount -o default -o dirnames mount diff --git a/completions/mount.linux b/completions/mount.linux index 20a3d6a0..ddb9180e 100644 --- a/completions/mount.linux +++ b/completions/mount.linux @@ -15,11 +15,11 @@ _mount() cur="${cur##*,}" split=true fi - COMPREPLY=( $(compgen -W 'auto adfs affs autofs btrfs cifs coda - cramfs debugfs devpts efs ext2 ext3 ext4 fuse hfs hfsplus hpfs - iso9660 jffs2 jfs minix msdos ncpfs nfs nfs4 ntfs ntfs-3g proc - qnx4 ramfs reiserfs romfs squashfs smbfs sysv tmpfs ubifs udf - ufs umsdos usbfs vfat xfs' -- "$cur") ) + COMPREPLY=( $( compgen -W 'auto adfs affs autofs btrfs cifs coda + cramfs davfs debugfs devpts efs ext2 ext3 ext4 fuse hfs hfsplus + hpfs iso9660 jffs2 jfs minix msdos ncpfs nfs nfs4 ntfs ntfs-3g + proc qnx4 ramfs reiserfs romfs squashfs smbfs sysv tmpfs ubifs + udf ufs umsdos usbfs vfat xfs' -- "$cur" ) ) _fstypes $split && COMPREPLY=( ${COMPREPLY[@]/#/$prev,} ) return @@ -72,15 +72,14 @@ _mount() # no completion if $cur is opt=smth [[ "$cur" == *=* ]] && return # mount options - COMPREPLY=( $(compgen -W 'loop async {,no}atime {,no}auto + COMPREPLY=( $(compgen -W 'loop {,a}sync {,no}atime {,no}auto {,fs,def,root}context= defaults {,no}dev {,no}diratime dirsync {,no}exec group {,no}iversion {,no}mand _netdev nofail {,no}relatime {,no}strictatime {,no}suid owner remount ro rw - sync {,no}user users' -- "$cur") ) + {,no}user users' -- "$cur") ) case "$fstype" in adfs|auto) - COMPREPLY+=( $(compgen -W 'uid= gid= {own,oth}mask=' -- \ - "$cur") ) + COMPREPLY+=( $(compgen -W '{u,g}id= {own,oth}mask=' -- "$cur") ) ;;& affs|auto) COMPREPLY+=( $(compgen -W '{u,g}id= set{u,g}id= mode= protect @@ -97,10 +96,14 @@ _mount() cifs|auto) COMPREPLY+=( $(compgen -W 'user= password= credentials= {u,g}id= force{u,g}id port= servern= netbiosname= {file,dir}_mode= - ip= domain= guest iocharset ro rw {,no}setuids {,no,dyn}perm + ip= domain= guest iocharset {,no}setuids {,no,dyn}perm directio {,no}mapchars {,no}intr hard soft noacl nocase sec= nobrl sfu {,no}serverino nounix nouser_xattr {r,w}size= - rwpidforward backup{u,g}id' -- "$cur") ) + rwpidforward backup{u,g}id cache=' -- "$cur") ) + ;;& + davfs|auto) + COMPREPLY+=( $(compgen -W 'conf= {file,dir}_mode= {u,g}id= + username=' -- "$cur") ) ;;& ext[2-4]|auto) COMPREPLY+=( $(compgen -W '{,no}acl bsddf minixdf check= debug @@ -117,7 +120,7 @@ _mount() nobarrier inode_readahead= stripe= {,no}delalloc abort {max,min}_batch_time= journal_ioprio= {,no}auto_da_alloc {,no}discard nouid32 resize {,no}block_validity - dioread_{,no}lock i_version' -- "$cur") ) + dioread_{,no}lock max_dir_size_kb= i_version' -- "$cur") ) ;;& msdos|umsdos|vfat|auto) COMPREPLY+=( $(compgen -W 'blocksize= {u,g}id= {u,d,f}mask= @@ -135,16 +138,31 @@ _mount() iocharset= utf8' -- "$cur") ) ;;& jffs2|auto) - COMPREPLY+=( $(compgen -W 'compr=' -- "$cur") ) + COMPREPLY+=( $(compgen -W 'compr= rp_size=' -- "$cur") ) ;;& jfs|auto) COMPREPLY+=( $(compgen -W 'iocharset= resize= {,no}integrity errors= {,no,usr,grp}quota' -- "$cur") ) ;;& + nfs|nfs4|auto) + COMPREPLY+=( $(compgen -W 'soft hard timeo= retrans= {r,w}size= + {,no}ac acreg{min,max}= acdir{min,max}= actimeo= bg fg + retry= sec= {,no}sharecache {,no}resvport lookupcache= + proto= port= {,no}intr {,no}cto {,nfs}vers= ' -- "$cur") ) + ;;& + nfs|auto) + COMPREPLY+=( $(compgen -W 'udp tcp rdma mount{port,proto,host}= + mountvers= namlen={,no}lock {,no}acl {,no}rdirplus + {,no}fsc' -- "$cur") ) + ;;& + nfs4|auto) + COMPREPLY+=( $(compgen -W 'clientaddr= {,no}migration' \ + -- "$cur") ) + ;;& ntfs-3g) COMPREPLY+=( $(compgen -W '{u,g}id= {u,f,d}mask= usermapping= - permissions inherit ro locale= force {,no}recover - ignore_case remove_hiberfile {,no,rel}atime show_sys_files + permissions inherit locale= force {,no}recover + ignore_case remove_hiberfile show_sys_files hide_{hid,dot}_files windows_names allow_other max_read= silent no_def_opts streams_interface= user_xattr efs_raw {,no}compression debug no_detach' -- "$cur") ) @@ -172,11 +190,11 @@ _mount() ;;& xfs|auto) COMPREPLY+=( $(compgen -W 'allocsize= {,no}attr2 barrier dmapi - {,no}grpid {bsd,sysv}groups ihashsize= {,no}ikeep inode64 - {,no}largeio logbufs= logbsize= logdev= rtdev= mtpt= noalign - noatime norecovery nouuid osyncisosync {u,g,p}qnoenforce - {,u,usr,g,grp,p,prj}quota sunit= swidth= swalloc' \ - -- "$cur") ) + {,no}grpid {bsd,sysv}groups ihashsize= {,no}ikeep + inode{32,64} {,no}largeio logbufs= logbsize= logdev= + rtdev= mtpt= noalign norecovery nouuid osyncisosync + {u,g,p}qnoenforce {,u,usr,g,grp,p,prj}quota sunit= swidth= + swalloc' -- "$cur") ) ;;& esac # COMP_WORDBREAKS is a real pain in the ass diff --git a/completions/mplayer b/completions/mplayer index ba8e3e90..88e9dc7d 100644 --- a/completions/mplayer +++ b/completions/mplayer @@ -55,6 +55,16 @@ _mplayer() done ) ) return 0 ;; + -subcp|-msgcharset) + local cp + cp=( $( iconv --list 2>/dev/null | sed -e "s@//@@;" 2>/dev/null ) ) + if [[ "$cur" == "${cur,,}" ]]; then + COMPREPLY=( $( compgen -W '${cp[@],,}' -- "$cur" ) ) + else + COMPREPLY=( $( compgen -W '${cp[@]^^}' -- "$cur" ) ) + fi + return 0 + ;; -ifo) _filedir ifo return 0 @@ -93,6 +103,10 @@ _mplayer() _filedir return 0 ;; + -bluray-device) + _filedir -d + return 0 + ;; -mixer|-dvdauth|-fb|-zrdev) cur=${cur:=/dev/} _filedir @@ -105,42 +119,49 @@ _mplayer() return 0 ;; -autoq|-autosync|-loop|-menu-root|-speed|-sstep|-aid|-alang| \ - -bandwidth|-cache|-chapter| \ - -dvd|-dvdangle|-fps|-frames|-mc|-passwd|-user|-sb|-srate|-ss|-vcd| \ + -bandwidth|-bluray-angle|-bluray-chapter|-cache|-chapter|-dvd-speed| \ + -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| \ -monitor-dotclock|-monitor-[hv]freq|-panscan| \ -saturation|-xineramascreen|-zrcrop|-zrnorm|-zrquality| \ - -zr[xy]doff|-zr[vh]dec|-aspect|-pp|-x|-y|-xy|-z|-stereo| \ + -zr[xy]doff|-zr[vh]dec|-pp|-x|-y|-xy|-z|-stereo| \ -audio-density|-audio-delay|-audio-preload|-endpos|-osdlevel| \ - -ffourcc|-sws|-channels|-skiplimit|-format|-ofps|-aadriver| \ + -ffourcc|-sws|-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| \ + -sub-bg-alpha|-sub-bg-color|-subdelay|-subfps|-subpos| \ + -subalign|-subwidth|-subfont-blur|-subfont-outline| \ -subfont-autoscale|-subfont-encoding|-subfont-osd-scale| \ - -subfont-osd-text) + -subfont-text-scale) + return 0 + ;; + -channels) + COMPREPLY=( $( compgen -W '2 4 6 8' -- "$cur" ) ) return 0 ;; - -monitoraspect) - COMPREPLY=( $( compgen -W '4:3 16:9 16:10' -- "$cur" ) ) + -aspect|-monitoraspect) + COMPREPLY=( $( compgen -W '1:1 3:2 4:3 5:4 14:9 14:10 16:9 16:10 + 2.35:1' -- "$cur" ) ) __ltrim_colon_completions "$cur" return 0 ;; -lavdopts) - COMPREPLY=( $( compgen -W 'bitexact bug= debug= ec= er= fast gray idct= lowres= sb= st= skiploopfilter= skipidct= skipframe= threads= vismv= vstats' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'bitexact bug= debug= ec= er= fast gray + idct= lowres= sb= st= skiploopfilter= skipidct= skipframe= + threads= vismv= vstats' -- "$cur" ) ) return 0 ;; -lavcopts) - COMPREPLY=( $( compgen -W 'vcodec= vqmin= vqscale= vqmax= mbqmin= \ - mbqmax= vqdiff= vmax_b_frames= vme= vhq v4mv keyint= \ - vb_strategy= vpass= aspect= vbitrate= vratetol= vrc_maxrate= \ - vrc_minrate= vrc_buf_size= vb_qfactor= vi_qfactor= vb_qoffset= \ - vi_qoffset= vqblur= vqcomp= vrc_eq= vrc_override= \ - vrc_init_cplx= vqsquish= vlelim= vcelim= vstrict= vdpart \ - vpsize= gray vfdct= idct= lumi_mask= dark_mask= tcplx_mask= \ - scplx_mask= naq ildct format= pred qpel precmp= cmp= subcmp= \ - predia= dia= trell last_pred= preme= subq= psnr mpeg_quant aic \ + COMPREPLY=( $( compgen -W 'vcodec= vqmin= vqscale= vqmax= mbqmin= + mbqmax= vqdiff= vmax_b_frames= vme= vhq v4mv keyint= + vb_strategy= vpass= aspect= vbitrate= vratetol= vrc_maxrate= + vrc_minrate= vrc_buf_size= vb_qfactor= vi_qfactor= vb_qoffset= + vi_qoffset= vqblur= vqcomp= vrc_eq= vrc_override= + vrc_init_cplx= vqsquish= vlelim= vcelim= vstrict= vdpart + vpsize= gray vfdct= idct= lumi_mask= dark_mask= tcplx_mask= + 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 ;; @@ -150,7 +171,7 @@ _mplayer() return 0 ;; -jpeg) - COMPREPLY=( $( compgen -W 'noprogressive progressive nobaseline \ + COMPREPLY=( $( compgen -W 'noprogressive progressive nobaseline baseline optimize= smooth= quality= outdir=' -- "$cur" ) ) return 0 ;; @@ -159,26 +180,26 @@ _mplayer() return 0 ;; -xvidencopts) - COMPREPLY=( $( compgen -W 'pass= bitrate= fixed_quant= me_quality= \ - 4mv rc_reaction_delay_factor= rc_averaging_period= rc_buffer= \ - quant_range= min_key_interval= max_key_interval= mpeg_quant \ - mod_quant lumi_mask hintedme hintfile debug keyframe_boost= \ + COMPREPLY=( $( compgen -W 'pass= bitrate= fixed_quant= me_quality= + 4mv rc_reaction_delay_factor= rc_averaging_period= rc_buffer= + quant_range= min_key_interval= max_key_interval= mpeg_quant + mod_quant lumi_mask hintedme hintfile debug keyframe_boost= kfthreshold= kfreduction=' -- "$cur" ) ) return 0 ;; -divx4opts) - COMPREPLY=( $( compgen -W 'br= key= deinterlace q= min_quant= \ - max_quant= rc_period= rc_reaction_period= crispness= \ + COMPREPLY=( $( compgen -W 'br= key= deinterlace q= min_quant= + max_quant= rc_period= rc_reaction_period= crispness= rc_reaction_ratio= pass= vbrpass= help' -- "$cur" ) ) return 0 ;; -info) - COMPREPLY=( $( compgen -W 'name= artist= genre= subject= \ + COMPREPLY=( $( compgen -W 'name= artist= genre= subject= copyright= srcform= comment= help' -- "$cur" ) ) return 0 ;; -lameopts) - COMPREPLY=( $( compgen -W 'vbr= abr cbr br= q= aq= ratio= vol= \ + COMPREPLY=( $( compgen -W 'vbr= abr cbr br= q= aq= ratio= vol= mode= padding= fast preset= help' -- "$cur" ) ) return 0 ;; @@ -188,28 +209,28 @@ _mplayer() return 0 ;; -rawvideo) - COMPREPLY=( $( compgen -W 'on fps= sqcif qcif cif 4cif pal ntsc w= \ + COMPREPLY=( $( compgen -W 'on fps= sqcif qcif cif 4cif pal ntsc w= h= y420 yv12 yuy2 y8 format= size=' -- "$cur" ) ) return 0 ;; -aop) - COMPREPLY=( $( compgen -W 'list= delay= format= fout= volume= mul= \ + COMPREPLY=( $( compgen -W 'list= delay= format= fout= volume= mul= softclip' -- "$cur" ) ) return 0 ;; -dxr2) - COMPREPLY=( $( compgen -W 'ar-mode= iec958-encoded iec958-decoded \ - mute ucode= 75ire bw color interlaced macrovision= norm= \ - square-pixel ccir601-pixel cr-left= cr-right= cr-top= cr-bot= \ - ck-rmin= ck-gmin= ck-bmin= ck-rmax= ck-gmax= ck-bmax= ck-r= \ - ck-g= ck-b= ignore-cache= ol-osd= olh-cor= olw-cor= olx-cor= \ - oly-cor= overlay overlay-ratio= update-cache' -- "$cur" )) + COMPREPLY=( $( compgen -W 'ar-mode= iec958-encoded iec958-decoded + mute ucode= 75ire bw color interlaced macrovision= norm= + square-pixel ccir601-pixel cr-left= cr-right= cr-top= cr-bot= + ck-rmin= ck-gmin= ck-bmin= ck-rmax= ck-gmax= ck-bmax= ck-r= + ck-g= ck-b= ignore-cache= ol-osd= olh-cor= olw-cor= olx-cor= + oly-cor= overlay overlay-ratio= update-cache' -- "$cur" ) ) return 0 ;; -tv) - COMPREPLY=( $( compgen -W 'on noaudio driver= device= input= freq= \ - outfmt= width= height= buffersize= norm= channel= chanlist= \ - audiorate= forceaudio alsa amode= forcechan= adevice= audioid= \ + COMPREPLY=( $( compgen -W 'on noaudio driver= device= input= freq= + outfmt= width= height= buffersize= norm= channel= chanlist= + audiorate= forceaudio alsa amode= forcechan= adevice= audioid= volume= bass= treble= balance= fps= channels= immediatemode=' \ -- "$cur" ) ) return 0 @@ -219,22 +240,16 @@ _mplayer() return 0 ;; -cdda) - COMPREPLY=( $( compgen -W 'speed= paranoia= generic-dev= \ - sector-size= overlap= toc-bias toc-offset= skip noskip' \ + COMPREPLY=( $( compgen -W 'speed= paranoia= generic-dev= + sector-size= overlap= toc-bias toc-offset= skip noskip' \ -- "$cur" ) ) return 0 ;; -input) - COMPREPLY=( $( compgen -W 'conf= ar-delay ar-rate keylist cmdlist \ + COMPREPLY=( $( compgen -W 'conf= ar-delay ar-rate keylist cmdlist js-dev file' -- "$cur" ) ) return 0 ;; - -af) - COMPREPLY=( $( compgen -W 'resample resample= channels channels= \ - format format= volume volume= delay delay= pan pan= sub sub= \ - surround surround=' -- "$cur" ) ) - return 0 - ;; -af-adv) COMPREPLY=( $( compgen -W 'force= list=' -- "$cur" ) ) return 0 @@ -264,7 +279,7 @@ _mplayer() -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]|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]|3gpp?(2)|mpc|MPC|flac|FLAC|vro|VRO|divx|DIVX|aif?(f)|AIF?(F)|m2t?(s)|M2T?(S)|vdr|VDR|xvid|XVID|ape|APE|gif|GIF|nut|NUT|bik|BIK|webm|WEBM|amr|AMR|awb|AWB|iso|ISO)?(.part)' + _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]|3gpp?(2)|mpc|MPC|flac|FLAC|vro|VRO|divx|DIVX|aif?(f)|AIF?(F)|m2t?(s)|M2T?(S)|vdr|VDR|xvid|XVID|ape|APE|gif|GIF|nut|NUT|bik|BIK|webm|WEBM|amr|AMR|awb|AWB|iso|ISO|opus|OPUS)?(.part)' ;; esac diff --git a/completions/msynctool b/completions/msynctool index db48e1b7..28a0163a 100644 --- a/completions/msynctool +++ b/completions/msynctool @@ -32,10 +32,10 @@ _msynctool() ;; esac - COMPREPLY=( $( compgen -W '--listgroups --listplugins --listobjects \ - --showformats --showgroup --sync --filter-objtype --slow-sync \ - --wait --multi --addgroup --delgroup --addmember --configure \ - --manual --configdir --conflict' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--listgroups --listplugins --listobjects + --showformats --showgroup --sync --filter-objtype --slow-sync --wait + --multi --addgroup --delgroup --addmember --configure --manual + --configdir --conflict' -- "$cur" ) ) } && complete -F _msynctool msynctool diff --git a/completions/munin-update b/completions/munin-update index f92f2f19..c035ec7b 100644 --- a/completions/munin-update +++ b/completions/munin-update @@ -17,9 +17,9 @@ _munin_update() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--force-root --[no]force-root \ - --service --host --config --help --debug --nodebug \ - --fork --nofork --stdout --nostdout --timeout' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--force-root --noforce-root --service --host + --config --help --debug --nodebug --fork --nofork --stdout + --nostdout --timeout' -- "$cur" ) ) fi } && complete -F _munin_update munin-update diff --git a/completions/mussh b/completions/mussh new file mode 100644 index 00000000..a7bf2997 --- /dev/null +++ b/completions/mussh @@ -0,0 +1,52 @@ +# mussh(1) completion -*- shell-script -*- + +_mussh() +{ + local cur prev words cword + _init_completion || return + + case $prev in + --help|-V|-m|-t) + return + ;; + -d) + COMPREPLY=( $( compgen -W '{0..2}' -- "$cur" ) ) + return + ;; + -v) + COMPREPLY=( $( compgen -W '{0..3}' -- "$cur" ) ) + return + ;; + -i|-H|-C) + _filedir + return + ;; + -o|-po) + _xfunc ssh _ssh_options + return + ;; + -l|-L) + COMPREPLY=( $( compgen -u -- "$cur" ) ) + return + ;; + -s) + _shells + return + ;; + -p|-h) + [[ $cur == *@* ]] && _user_at_host || _known_hosts_real -a "$cur" + return + ;; + -c) + compopt -o filenames + COMPREPLY+=( $( compgen -c -- "$cur" ) ) + return + ;; + esac + + [[ $cur != -* ]] || \ + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) +} && +complete -F _mussh mussh + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/mutt b/completions/mutt index acab9c86..3dc82a92 100644 --- a/completions/mutt +++ b/completions/mutt @@ -143,8 +143,8 @@ _mutt() 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" ) ) + 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 ;; *) diff --git a/completions/mysqladmin b/completions/mysqladmin index fd8c3186..bdc07eb2 100644 --- a/completions/mysqladmin +++ b/completions/mysqladmin @@ -42,10 +42,9 @@ _mysqladmin() COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - COMPREPLY+=( \ - $( 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 \ + COMPREPLY+=( $( 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" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace diff --git a/completions/nc b/completions/nc new file mode 100644 index 00000000..055924c9 --- /dev/null +++ b/completions/nc @@ -0,0 +1,48 @@ +# nc(1) completion -*- shell-script -*- + +_nc() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -h|-I|-i|-O|-P|-p|-V|-w) + return + ;; + -s) + _ip_addresses + return + ;; + -T) + COMPREPLY=( $( compgen -W 'critical inetcontrol lowdelay netcontrol + throughput reliability ef af{11..43} cs{0..7}' -- "$cur" ) ) + return + ;; + -X) + COMPREPLY=( $( compgen -W '4 5 connect' -- "$cur" ) ) + return + ;; + -x) + _known_hosts_real "$cur" + return + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + return + fi + + # Complete 1st non-option arg only + local i + for (( i=1; i < cword; i++ )); do + [[ ${words[i]} != -* && \ + ${words[i-1]} != @(-I|-i|-O|-P|-p|-s|-T|-V|-w|-X|-x) ]] && \ + return + done + + _known_hosts_real "$cur" +} && +complete -F _nc nc + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/ncftp b/completions/ncftp index 57347e0e..0d32cfe2 100644 --- a/completions/ncftp +++ b/completions/ncftp @@ -5,6 +5,17 @@ _ncftp() local cur prev words cword _init_completion || return + case $prev in + -u|-p|-P|-j|-F) + return + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + return + fi + if [[ $cword -eq 1 && -f ~/.ncftp/bookmarks ]]; then COMPREPLY=( $( compgen -W '$( sed -ne "s/^\([^,]\{1,\}\),.*$/\1/p" \ ~/.ncftp/bookmarks )' -- "$cur" ) ) diff --git a/completions/ngrep b/completions/ngrep new file mode 100644 index 00000000..7c867649 --- /dev/null +++ b/completions/ngrep @@ -0,0 +1,37 @@ +# ngrep(8) completion -*- shell-script -*- + +_ngrep() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -h|-V|-n|-A|-s|-S|-c|-P) + return + ;; + -I|-O) + _filedir pcap + return + ;; + -d) + _available_interfaces -a + return + ;; + -W) + COMPREPLY=( $( compgen -W 'normal byline single none' -- "$cur" ) ) + return + ;; + -F) + _filedir + return + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + return + fi +} && +complete -F _ngrep ngrep + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/nmap b/completions/nmap index 89769bfb..6fbdb073 100644 --- a/completions/nmap +++ b/completions/nmap @@ -15,7 +15,7 @@ _nmap() return 0 ;; -e) - _available_interfaces + _available_interfaces -a return 0 ;; -b|--dns-servers) @@ -25,22 +25,22 @@ _nmap() 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" ) ) + 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 diff --git a/completions/nmcli b/completions/nmcli new file mode 100644 index 00000000..00628b41 --- /dev/null +++ b/completions/nmcli @@ -0,0 +1,199 @@ +# nmcli completion -*- shell-script -*- + +_nmcli_list() +{ + COMPREPLY=( $( compgen -W '$1' -- "$cur" ) ) +} + +_nmcli_con_id() +{ + local IFS=$'\n' + COMPREPLY=( $( compgen -W "$(nmcli con list 2>/dev/null | \ + tail -n +2 | awk -F ' {2,}' '{print $1 }')" -- "$cur" ) ) +} + +_nmcli_con_uuid() +{ + COMPREPLY=( $( compgen -W "$(nmcli con list 2>/dev/null | \ + tail -n +2 | awk -F ' {2,}' '{print $2}')" -- "$cur" ) ) +} + +_nmcli_ap_ssid() +{ + local IFS=$'\n' + COMPREPLY=( $( compgen -W "$(nmcli dev wifi list 2>/dev/null | \ + tail -n +2 | awk -F ' {2,}' '{print $1}')" -- "$cur" ) ) +} + +_nmcli_ab_bssid() +{ + COMPREPLY=( $( compgen -W "$(nmcli dev wifi list 2>/dev/null | \ + tail -n +2 | awk -F ' {2,}' '{print $2}')" -- "$cur" ) ) +} + +_nmcli() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -m|--mode) + COMPREPLY=( $( compgen -W 'tabular multiline' -- "$cur" ) ) + return 0 + ;; + -f|--fields) + COMPREPLY=( $( compgen -W 'all common' -- "$cur" ) ) + return 0 + ;; + -e|--escape) + _nmcli_list "yes no" + return 0 + ;; + id) + _nmcli_con_id + return 0 + ;; + uuid) + _nmcli_con_uuid + return 0 + ;; + iface) + _available_interfaces + return 0 + ;; + bssid) + _nmcli_ab_bssid + return 0 + ;; + wep-key-type) + _nmcli_list "key phrase" + return 0 + ;; + esac + + if [[ $cword -eq 1 ]] ; then + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--terse --pretty --mode --fields + --escape --version --help' -- "$cur" ) ) + else + COMPREPLY=( $( compgen -W "nm con dev" -- "$cur" ) ) + fi + else + local object=${words[1]} + local command=${words[2]} + + case $object in + nm) + case $command in + enable) + _nmcli_list "true false" + return 0 + ;; + sleep) + _nmcli_list "true false" + return 0 + ;; + wifi) + _nmcli_list "on off" + return 0 + ;; + wwan) + _nmcli_list "on off" + return 0 + ;; + wimax) + _nmcli_list "on off" + return 0 + ;; + esac + + COMPREPLY=( $( compgen -W 'status permissions enable sleep + wifi wwan wimax' -- "$cur" ) ) + ;; + con) + case $command in + list) + COMPREPLY=( $( compgen -W 'id uuid' -- "$cur" ) ) + return 0 + ;; + up) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--nowait --timeout' \ + -- "$cur" ) ) + else + COMPREPLY=( $( compgen -W 'id uuid iface ap nsp' \ + -- "$cur" ) ) + fi + return 0 + ;; + down) + COMPREPLY=( $( compgen -W 'id uuid' -- "$cur" ) ) + return 0 + ;; + delete) + COMPREPLY=( $( compgen -W 'id uuid' -- "$cur" ) ) + return 0 + ;; + esac + + COMPREPLY=( $( compgen -W 'list status up down delete' \ + -- "$cur" ) ) + ;; + dev) + case $command in + list) + COMPREPLY=( $( compgen -W 'iface' -- "$cur" ) ) + return 0 + ;; + disconnect) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--nowait --timeout' \ + -- "$cur" ) ) + else + COMPREPLY=( $( compgen -W 'iface' -- "$cur" ) ) + fi + return 0 + ;; + wifi) + local subcommand=${words[3]} + + case $subcommand in + list) + COMPREPLY=( $( compgen -W 'iface bssid' \ + -- "$cur" ) ) + return 0 + ;; + connect) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--private + --nowait --timeout' -- "$cur" ) ) + else + if [[ "$prev" == "connect" ]]; then + _nmcli_ap_ssid + else + COMPREPLY=( $( compgen -W 'password + wep-key-type iface bssid name' \ + -- "$cur" ) ) + fi + fi + return 0 + ;; + esac + + COMPREPLY=( $( compgen -W 'list connect' -- "$cur" ) ) + return 0 + ;; + esac + + COMPREPLY=( $( compgen -W 'status list disconnect wifi' \ + -- "$cur" ) ) + ;; + esac + + fi + + return 0 +} && +complete -F _nmcli nmcli + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/nslookup b/completions/nslookup index 8285ee1a..88af1d5b 100644 --- a/completions/nslookup +++ b/completions/nslookup @@ -68,7 +68,10 @@ _host() if [[ $cur == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + return fi + + _known_hosts_real "$cur" } && complete -F _host host diff --git a/completions/ntpdate b/completions/ntpdate index e09a2dfb..dab38477 100644 --- a/completions/ntpdate +++ b/completions/ntpdate @@ -18,7 +18,7 @@ _ntpdate() COMPREPLY=( $( compgen -W '{1..8}' -- "$cur" ) ) return 0 ;; - + -a|-e|-o|-t) return 0 ;; diff --git a/completions/openssl b/completions/openssl index b63d215d..997fe1ec 100644 --- a/completions/openssl +++ b/completions/openssl @@ -33,20 +33,17 @@ _openssl() local commands command options formats - commands='asn1parse ca ciphers crl crl2pkcs7 dgst dh dhparam dsa \ - dsaparam ec ecparam enc engine errstr gendh gendsa genrsa \ - nseq ocsp passwd pkcs12 pkcs7 pkcs8 prime rand req rsa \ - rsautl s_client s_server s_time sess_id smime speed spkac \ - verify version x509 md2 md4 md5 rmd160 sha sha1 aes-128-cbc \ - aes-128-ecb aes-192-cbc aes-192-ecb aes-256-cbc aes-256-ecb \ - base64 bf bf-cbc bf-cfb bf-ecb bf-ofb camellia-128-cbc \ - camellia-128-ecb camellia-192-cbc camellia-192-ecb \ - camellia-256-cbc camellia-256-ecb cast cast-cbc cast5-cbc \ - cast5-cfb cast5-ecb cast5-ofb des des-cbc des-cfb des-ecb \ - des-ede des-ede-cbc des-ede-cfb des-ede-ofb des-ede3 \ - des-ede3-cbc des-ede3-cfb des-ede3-ofb des-ofb des3 desx rc2 \ - rc2-40-cbc rc2-64-cbc rc2-cbc rc2-cfb rc2-ecb rc2-ofb rc4 \ - rc4-40' + commands='asn1parse ca ciphers crl crl2pkcs7 dgst dh dhparam dsa dsaparam + ec ecparam enc engine errstr gendh gendsa genrsa nseq ocsp passwd + pkcs12 pkcs7 pkcs8 prime rand req rsa rsautl s_client s_server s_time + sess_id smime speed spkac verify version x509 md2 md4 md5 rmd160 sha + sha1 aes-128-cbc aes-128-ecb aes-192-cbc aes-192-ecb aes-256-cbc + aes-256-ecb base64 bf bf-cbc bf-cfb bf-ecb bf-ofb camellia-128-cbc + camellia-128-ecb camellia-192-cbc camellia-192-ecb camellia-256-cbc + camellia-256-ecb cast cast-cbc cast5-cbc cast5-cfb cast5-ecb cast5-ofb + des des-cbc des-cfb des-ecb des-ede des-ede-cbc des-ede-cfb des-ede-ofb + des-ede3 des-ede3-cbc des-ede3-cfb des-ede3-ofb des-ofb des3 desx rc2 + rc2-40-cbc rc2-64-cbc rc2-cbc rc2-cfb rc2-ecb rc2-ofb rc4 rc4-40' if [[ $cword -eq 1 ]]; then COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) @@ -69,7 +66,8 @@ _openssl() _openssl_sections return 0 ;; - -inform|-outform|-keyform|-certform|-CAform|-CAkeyform|-dkeyform|-dcertform) + -inform|-outform|-keyform|-certform|-CAform|-CAkeyform|-dkeyform|\ + -dcertform) formats='DER PEM' case $command in x509) @@ -87,8 +85,7 @@ _openssl() return 0 ;; -starttls) - COMPREPLY=( $( compgen -W 'smtp pop3 imap ftp' \ - -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'smtp pop3 imap ftp' -- "$cur" ) ) return 0 ;; -cipher) @@ -102,48 +99,47 @@ _openssl() # possible options for the command case $command in asn1parse) - options='-inform -in -out -noout -offset -length -i -oid \ + options='-inform -in -out -noout -offset -length -i -oid -strparse' ;; ca) - options='-verbose -config -name -gencrl -revoke \ - -crl_reason -crl_hold -crl_compromise \ - -crl_CA_compromise -crldays -crlhours -crlexts \ - -startdate -enddate -days -md -policy -keyfile -key \ - -passin -cert -selfsig -in -out -notext -outdir \ - -infiles -spkac -ss_cert -preserveDN -noemailDN \ - -batch -msie_hack -extensions -extfile -engine \ - -subj -utf8 -multivalue-rdn' + options='-verbose -config -name -gencrl -revoke -crl_reason + -crl_hold -crl_compromise -crl_CA_compromise -crldays + -crlhours -crlexts -startdate -enddate -days -md + -policy -keyfile -key -passin -cert -selfsig -in -out + -notext -outdir -infiles -spkac -ss_cert -preserveDN + -noemailDN -batch -msie_hack -extensions -extfile + -engine -subj -utf8 -multivalue-rdn' ;; ciphers) options='-v -ssl2 -ssl3 -tls1' ;; crl) - options='-inform -outform -text -in -out -noout -hash \ + options='-inform -outform -text -in -out -noout -hash -issuer -lastupdate -nextupdate -CAfile -CApath' ;; crl2pkcs7) options='-inform -outform -in -out -print_certs' ;; dgst) - options='-md5 -md4 -md2 -sha1 -sha -mdc2 -ripemd160 -dss1 \ - -c -d -hex -binary -out -sign -verify -prverify \ + options='-md5 -md4 -md2 -sha1 -sha -mdc2 -ripemd160 -dss1 + -c -d -hex -binary -out -sign -verify -prverify -signature' ;; dsa) - options='-inform -outform -in -passin -out -passout -des \ + options='-inform -outform -in -passin -out -passout -des -des3 -idea -text -noout -modulus -pubin -pubout' ;; dsaparam) - options='-inform -outform -in -out -noout -text -C -rand \ + options='-inform -outform -in -out -noout -text -C -rand -genkey' ;; enc) - options='-ciphername -in -out -pass -e -d -a -A -k -kfile \ + options='-ciphername -in -out -pass -e -d -a -A -k -kfile -S -K -iv -p -P -bufsize -debug' ;; dhparam) - options='-inform -outform -in -out -dsaparam -noout -text \ + options='-inform -outform -in -out -dsaparam -noout -text -C -2 -5 -rand' ;; gendsa) @@ -153,75 +149,74 @@ _openssl() options='-out -passout -des -des3 -idea -f4 -3 -rand' ;; pkcs7) - options='-inform -outform -in -out -print_certs -text \ + options='-inform -outform -in -out -print_certs -text -noout' ;; rand) options='-out -rand -base64' ;; req) - options='-inform -outform -in -passin -out -passout -text \ - -noout -verify -modulus -new -rand -newkey -newkey \ - -nodes -key -keyform -keyout -md5 -sha1 -md2 -mdc2 \ - -config -x509 -days -asn1-kludge -newhdr -extensions \ + options='-inform -outform -in -passin -out -passout -text + -noout -verify -modulus -new -rand -newkey -newkey + -nodes -key -keyform -keyout -md5 -sha1 -md2 -mdc2 + -config -x509 -days -asn1-kludge -newhdr -extensions -reqexts section' ;; rsa) - options='-inform -outform -in -passin -out -passout \ - -sgckey -des -des3 -idea -text -noout -modulus -check \ + options='-inform -outform -in -passin -out -passout + -sgckey -des -des3 -idea -text -noout -modulus -check -pubin -pubout -engine' ;; rsautl) - options='-in -out -inkey -pubin -certin -sign -verify \ + options='-in -out -inkey -pubin -certin -sign -verify -encrypt -decrypt -pkcs -ssl -raw -hexdump -asn1parse' ;; s_client) - options='-connect -verify -cert -certform -key -keyform \ - -pass -CApath -CAfile -reconnect -pause -showcerts \ - -debug -msg -nbio_test -state -nbio -crlf -ign_eof \ - -quiet -ssl2 -ssl3 -tls1 -no_ssl2 -no_ssl3 -no_tls1 \ - -bugs -cipher -starttls -engine -tlsextdebug \ + options='-connect -verify -cert -certform -key -keyform + -pass -CApath -CAfile -reconnect -pause -showcerts + -debug -msg -nbio_test -state -nbio -crlf -ign_eof + -quiet -ssl2 -ssl3 -tls1 -no_ssl2 -no_ssl3 -no_tls1 + -bugs -cipher -starttls -engine -tlsextdebug -no_ticket -sess_out -sess_in -rand' ;; s_server) - options='-accept -context -verify -Verify -crl_check \ - -crl_check_all -cert -certform -key -keyform -pass \ - -dcert -dcertform -dkey -dkeyform -dpass -dhparam \ - -nbio -nbio_test -crlf -debug -msg -state -CApath \ - -CAfile -nocert -cipher -quiet -no_tmp_rsa -ssl2 \ - -ssl3 -tls1 -no_ssl2 -no_ssl3 -no_tls1 -no_dhe \ - -bugs -hack -www -WWW -HTTP -engine -tlsextdebug \ + options='-accept -context -verify -Verify -crl_check + -crl_check_all -cert -certform -key -keyform -pass + -dcert -dcertform -dkey -dkeyform -dpass -dhparam + -nbio -nbio_test -crlf -debug -msg -state -CApath + -CAfile -nocert -cipher -quiet -no_tmp_rsa -ssl2 + -ssl3 -tls1 -no_ssl2 -no_ssl3 -no_tls1 -no_dhe + -bugs -hack -www -WWW -HTTP -engine -tlsextdebug -no_ticket -id_prefix -rand' ;; s_time) - options='-connect -www -cert -key -CApath -CAfile -reuse \ + options='-connect -www -cert -key -CApath -CAfile -reuse -new -verify -nbio -time -ssl2 -ssl3 -bugs -cipher' ;; sess_id) - options='-inform -outform -in -out -text -noout -context \ - ID' + options='-inform -outform -in -out -text -noout -context ID' ;; smime) - options='-encrypt -decrypt -sign -verify -pk7out -des \ - -des3 -rc2-40 -rc2-64 -rc2-128 -aes128 -aes192 -aes256 \ - -in -certfile -signer -recip -inform -passin -inkey \ - -out -outform -content -to -from -subject -text -rand' + options='-encrypt -decrypt -sign -verify -pk7out -des -des3 + -rc2-40 -rc2-64 -rc2-128 -aes128 -aes192 -aes256 -in + -certfile -signer -recip -inform -passin -inkey -out + -outform -content -to -from -subject -text -rand' ;; speed) options='-engine' ;; verify) - options='-CApath -CAfile -purpose -untrusted -help \ + options='-CApath -CAfile -purpose -untrusted -help -issuer_checks -verbose -certificates' ;; x509) - options='-inform -outform -keyform -CAform -CAkeyform -in \ - -out -serial -hash -subject_hash -issuer_hash -subject \ - -issuer -nameopt -email -startdate -enddate -purpose \ - -dates -modulus -fingerprint -alias -noout -trustout \ - -clrtrust -clrreject -addtrust -addreject -setalias \ - -days -set_serial -signkey -x509toreq -req -CA -CAkey \ - -CAcreateserial -CAserial -text -C -md2 -md5 -sha1 \ + options='-inform -outform -keyform -CAform -CAkeyform -in + -out -serial -hash -subject_hash -issuer_hash -subject + -issuer -nameopt -email -startdate -enddate -purpose + -dates -modulus -fingerprint -alias -noout -trustout + -clrtrust -clrreject -addtrust -addreject -setalias + -days -set_serial -signkey -x509toreq -req -CA -CAkey + -CAcreateserial -CAserial -text -C -md2 -md5 -sha1 -mdc2 -clrext -extfile -extensions -engine' ;; md5|md4|md2|sha1|sha|mdc2|ripemd160) @@ -231,9 +226,9 @@ _openssl() COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) else if [[ "$command" == speed ]]; then - COMPREPLY=( $( compgen -W 'md2 mdc2 md5 hmac sha1 rmd160 \ - idea-cbc rc2-cbc rc5-cbc bf-cbc des-cbc des-ede3 rc4 \ - rsa512 rsa1024 rsa2048 rsa4096 dsa512 dsa1024 dsa2048 idea \ + COMPREPLY=( $( compgen -W 'md2 mdc2 md5 hmac sha1 rmd160 + idea-cbc rc2-cbc rc5-cbc bf-cbc des-cbc des-ede3 rc4 + rsa512 rsa1024 rsa2048 rsa4096 dsa512 dsa1024 dsa2048 idea rc2 des rsa blowfish' -- "$cur" ) ) else _filedir diff --git a/completions/opera b/completions/opera new file mode 100644 index 00000000..6cbfbacf --- /dev/null +++ b/completions/opera @@ -0,0 +1,46 @@ +# opera(1) completion -*- shell-script -*- + +_opera() +{ + local cur prev words cword + _init_completion || return + + case "$prev" in + ?(-)-widget|?(-)-urllist|?(-)-uiparserlog|?(-)-uiwidgetsparserlog|\ + ?(-)-profilinglog) + _filedir + return + ;; + ?(-)-[psb]d) + _filedir -d + return + ;; + ?(-)-remote) + COMPREPLY=( $( compgen -W 'openURL\\( openFile\\( openM2\\( + openComposer\\( addBookmark\\( raise\\(\\) lower\\(\\)' \ + -- "$cur" ) ) + [[ $COMPREPLY == *\( ]] && compopt -o nospace + return + ;; + ?(-)-windowname) + COMPREPLY=( $( compgen -W 'first last opera{1..9}' -- "$cur" ) ) + return + ;; + ?(-)-geometry|?(-)-window|?(-)-display|?(-)-urllistloadtimeout|\ + ?(-)-delaycustomizations|?(-)-dialogtest|?(-)-inidialogtest|\ + ?(-)-gputest) + # argument required but no completions available + return + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + fi + + _filedir '@(?([xX]|[sS])[hH][tT][mM]?([lL]))' +} && complete -F _opera opera + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/p4 b/completions/p4 index d0d984b2..4e47267f 100644 --- a/completions/p4 +++ b/completions/p4 @@ -19,9 +19,9 @@ _p4() elif [[ $cword -eq 2 ]]; then case $prev in help) - COMPREPLY=( $( compgen -W "simple commands \ - environment filetypes jobview revisions \ - usage views $p4commands" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "simple commands environment + filetypes jobview revisions usage views $p4commands" \ + -- "$cur" ) ) ;; admin) COMPREPLY=( $( compgen -W "checkpoint stop" -- "$cur" ) ) @@ -34,7 +34,7 @@ _p4() -t) case ${words[$cword-2]} in add|edit|reopen) - COMPREPLY=( $( compgen -W "$p4filetypes" -- "$cur") ) + COMPREPLY=( $( compgen -W "$p4filetypes" -- "$cur" ) ) ;; *) ;; diff --git a/completions/pack200 b/completions/pack200 index 6be2dc88..fa6b1c78 100644 --- a/completions/pack200 +++ b/completions/pack200 @@ -55,13 +55,12 @@ _pack200() 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 \ - --repack' -- "$cur" ) ) + 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 --repack' -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace else _filedir 'pack?(.gz)' diff --git a/completions/patch b/completions/patch new file mode 100644 index 00000000..e8da15a9 --- /dev/null +++ b/completions/patch @@ -0,0 +1,70 @@ +# patch(1) completion -*- shell-script -*- + +_patch() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + -p|--strip|-D|--ifdef|-B|--prefix|-Y|--basename-prefix|-z|--suffix|\ + -g|--get) + return + ;; + -F|--fuzz) + COMPREPLY=( $( compgen -W '{0..3}' -- "$cur" ) ) + return + ;; + -i|--input) + _filedir '@(?(d)patch|dif?(f))' + return + ;; + -o|--output|-r|--reject-file) + [[ ! $cur || $cur == - ]] && COMPREPLY=( - ) + _filedir + return + ;; + --quoting-style) + COMPREPLY=( $( compgen -W 'literal shell shell-always c escape' \ + -- "$cur" ) ) + return + ;; + -V|--version-control) + COMPREPLY=( $( compgen -W 'simple numbered existing' -- "$cur" ) ) + return + ;; + -d|--directory) + _filedir -d + return + ;; + --reject-format) + COMPREPLY=( $( compgen -W 'context unified' -- "$cur" ) ) + return + ;; + --read-only) + COMPREPLY=( $( compgen -W 'ignore warn fail' -- "$cur" ) ) + return + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + fi + + local args + _count_args + case $args in + 1) + _filedir + ;; + 2) + _filedir '@(?(d)patch|dif?(f))' + ;; + esac +} && +complete -F _patch patch + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/perl b/completions/perl index 8b296377..4bcc9b02 100644 --- a/completions/perl +++ b/completions/perl @@ -73,8 +73,8 @@ _perl() 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 diff --git a/completions/pkg-config b/completions/pkg-config index 0156c0dd..f861c30e 100644 --- a/completions/pkg-config +++ b/completions/pkg-config @@ -6,11 +6,23 @@ _pkg_config() _init_completion -s || return case $prev in - --variable|--define-variable|--atleast-version|--atleast-pkgconfig-version| \ + --define-variable|--atleast-version|--atleast-pkgconfig-version| \ --exact-version|--max-version) # argument required but no completions available return 0 ;; + --variable) + local i + for (( i=1; i < ${#words[@]}; i++ )); do + if [[ ${words[i]} != -* ]]; then + COMPREPLY=( $( compgen -W \ + '$( "$1" ${words[i]} --print-variables 2>/dev/null )' \ + -- "$cur" ) ) + break + fi + done + return 0 + ;; -\?|--help|--version|--usage) # all other arguments are noop with these return 0 diff --git a/completions/pkg-get b/completions/pkg-get new file mode 100644 index 00000000..bf66fcc8 --- /dev/null +++ b/completions/pkg-get @@ -0,0 +1,75 @@ +# pkg-get.completion completion -*- shell-script -*- +# +# Copyright 2006 Yann Rouillard <yann@opencsw.org> + +_have pkg-get && +_pkg-get_get_catalog_file() +{ + local url="$1" + local catalog_file i conffile + + for file in /etc/opt/csw/pkg-get.conf /opt/csw/etc/pkg-get.conf /etc/pkg-get.conf; do + if [[ -f $file ]]; then + conffile="$file" + break + fi + done + conffile="${conffile:-/opt/csw/etc/pkg-get.conf}" + + if [[ -z "$url" ]]; then + url=$(awk -F= ' $1=="url" { print $2 }' $conffile) + fi + + catalog_file="${url##*//}" + catalog_file="${catalog_file%%/*}" + catalog_file="/var/pkg-get/catalog-$catalog_file" + + echo "$catalog_file" +} && +_pkg-get() +{ + local cur prev file catalog_file url command + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + + if [[ "${prev}" = "-s" ]]; then + return 1 + fi + + i=${#COMP_WORDS[*]} + while [[ $i -gt 0 ]]; do + i=$((i-1)) + if [[ "${COMP_WORDS[$i]}" = "-s" ]]; then + url="${COMP_WORDS[$((i+1))]}" + fi + if [[ "${COMP_WORDS[$i]}" == @(available|-a|describe|-D|download|-d|install|-i|list|updatecatalog|-U|upgrade|-u) ]]; then + command="${COMP_WORDS[$i]}" + fi + done + + if [[ -n "$command" ]]; then + if [[ "$command" == @(describe|-D|download|-d|install|-i) ]]; then + catalog_file=$(_pkg-get_get_catalog_file "$url") + if [[ -f $catalog_file ]]; then + local packages_list=$(awk ' $0 ~ /BEGIN PGP SIGNATURE/ { exit } $1 ~ /^Hash:/ || $1 ~ /^ *(-|#|$)/ { next } { print $1 }' $catalog_file) + COMPREPLY=( $(compgen -W "${packages_list}" -- ${cur}) ) + fi + fi + return 0 + fi + + if [[ ${cur} == -* ]] ; then + local opts="-c -d -D -f -i -l -s -S -u -U -v" + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + return 0 + else + local commands="available describe download install list \ + updatecatalog upgrade" + COMPREPLY=( $(compgen -W "${commands}" -- ${cur}) ) + return 0 + fi +} && +complete -F _pkg-get pkg-get + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/pkgadd b/completions/pkgadd new file mode 100644 index 00000000..28098815 --- /dev/null +++ b/completions/pkgadd @@ -0,0 +1,59 @@ +# pkgadd completion -*- shell-script -*- +# +# Copyright 2006 Yann Rouillard <yann@opencsw.org> + +_pkgadd () +{ + local cur prev words cword + _init_completion -n : || return + + # if a device directory was given + # we must complete with the package + # available in this directory + local device=/var/spool/pkg; + local i=$cword + while [[ $((i--)) -gt 0 ]]; do + case "${words[$i]}" in + -d) + device="${words[$((i+1))]}"; + break + ;; + esac; + done; + + case $prev in + -d) + _filedir pkg + _filedir -d + ;; + -a|-r|-V) + _filedir + ;; + -k|-s|-R) + _filedir -d + ;; + -P|-k|-x) + ;; + *) + if [[ ${cur} == -* ]] ; then + local opts="-a -A -d -k -n -M -P -r -R -s -v -V -x" + COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) + else + local pkginst_list + if [[ -d $device ]]; then + for filedir in $(/bin/ls -1 $device); do + if [[ -d "$device/$filedir" ]] && [[ -f "$device/$filedir/pkginfo" ]]; then + pkginst_list+=( ${pkginst_list[@]:-} "$filedir" ) + fi + done + pkginst_list="${pkginst_list[@]}" + else + pkginst_list=$(strings $(dequote $device) | grep "^PKG=" | sort -u | cut -d= -f2) + fi + COMPREPLY=( $(compgen -W "$pkginst_list" -- ${cur}) ) + fi + esac +} && +complete -F _pkgadd pkgadd + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/pkgrm b/completions/pkgrm new file mode 100644 index 00000000..24d2a398 --- /dev/null +++ b/completions/pkgrm @@ -0,0 +1,50 @@ +# pkgrm completion -*- shell-script -*- +# +# Copyright 2006 Yann Rouillard <yann@opencsw.org> + +_have pkgrm && +_pkgrm () +{ + local cur prev words cword + _init_completion || return + + # if a spool directory was given + # we must complete with the package + # available in this directory + local spool=/var/sadm/pkg; + local i=$cword + while [[ $((i--)) -gt 0 ]]; do + i=$((i-1)); + case "${words[$i]}" in + -s) + spool="${words[$((i+1))]}"; + break + ;; + esac; + done; + + case $prev in + -a | -V) + _filedir + ;; + -s | -R) + _filedir -d + ;; + -Y) + ;; + *) + if [[ ${cur} == -* ]]; then + local opts="-a -A -n -M -R -s -v -V -Y"; + COMPREPLY=($(compgen -W "${opts}" -- ${cur})); + return 0; + else + COMPREPLY=($(compgen -W "$(/bin/ls -1 $spool)" -- ${cur})); + return 0; + fi + ;; + esac +} && +complete -F _pkgrm pkgrm + +# ex: ts=4 sw=4 et filetype=sh + diff --git a/completions/pkgtool b/completions/pkgtool index f7291dbd..5adcbaf0 100644 --- a/completions/pkgtool +++ b/completions/pkgtool @@ -25,7 +25,7 @@ _pkgtool() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--sets --ignore-tagfiles --tagfile \ + COMPREPLY=( $( compgen -W '--sets --ignore-tagfiles --tagfile --source-mounted --source_dir --target_dir --source_device' \ -- "$cur" ) ) return 0 diff --git a/completions/pkgutil b/completions/pkgutil new file mode 100644 index 00000000..06bbeaf0 --- /dev/null +++ b/completions/pkgutil @@ -0,0 +1,96 @@ +# pkgutil completion -*- shell-script -*- +# Copyright 2006 Yann Rouillard <yann@opencsw.org> + +_pkgutil_url2catalog() +{ + local filename="$1" + + filename="${filename##*://}" + filename="${filename//\//_}" + filename="/var/opt/csw/pkgutil/catalog.${filename}_$(uname -p)_$(uname -r)" + + echo "$filename" +} + +_pkgutil() +{ + local cur prev words cword + _init_completion -n : || return + + local command catalog_files configuration_files + declare -a configuration_files=("/opt/csw/etc/pkgutil.conf" "/etc/opt/csw/pkgutil.conf") + declare -a catalog_files=() + + i=$cword + while [[ $((i--)) -gt 1 ]]; do + if [[ "${words[$i]}" = @(-t|--temp) ]]; then + local url="${words[$((i+1))]}" + local catalog=$(_pkgutil_url2catalog "$url") + catalog_files=("$catalog") + elif [[ "${words[$i]}" = @(--config) ]]; then + configuration_files=( "$(dequote ${words[$((i+1))]})" ) + elif [[ "${words[$i]}" == @(-i|--install|-u|--upgrade|-r|--remove|-d|--download|-a|--available|-c|--compare|-U|--catalog|-S|--stream) ]]; then + command="${words[$i]}" + fi + done + + if [[ "$prev" = @(-W|--workdir|-P|--pkgdir|-R|--rootpath) ]]; then + _filedir -d + return 0 + fi + + if [[ "$prev" = @(-o|--output|--config) ]]; then + _filedir + return 0 + fi + + if [[ "$prev" = @(-p|--param) ]]; then + compopt -o nospace + COMPREPLY=( $(compgen -W "mirror: pkgaddopts: pkgrmopts: wgetopts: use_gpg: use_md5: pkgliststyle: maxpkglist: noncsw: stop_on_hook_soft_error: exclude_pattern: gpg_homedir: root_path: deptree_filter_common: show_current: catalog_not_cached: catalog_update:" -- $cur) ) + return 0 + fi + + if [[ "$prev" = @(-T|--target) ]]; then + # Work-around bash_completion issue where bash interprets a colon + # as a separator, borrowed from maven completion code which borrowed + # it from darcs completion code :) + local colonprefixes=${cur%"${cur##*:}"} + COMPREPLY=( $(compgen -W "sparc:5.9 sparc:5.10 sparc:5.11 i386:5.9 i386:5.10 i386:5.11" -- $cur) ) + local i=${#COMPREPLY[*]} + while [ $((--i)) -ge 0 ]; do + COMPREPLY[$i]=${COMPREPLY[$i]#"$colonprefixes"} + done + return 0 + fi + + if [[ -n "$command" ]] && [[ ! "$cur" == -* ]]; then + + local mirrors mirror_url + mirrors=$(awk -F= ' $1 ~ /^ *mirror *$/ { print $2 }' ${configuration_files[@]}) + mirrors=${mirrors:-http://mirror.opencsw.org/opencsw/testing} + for mirror_url in $mirrors; do + local catalog=$(_pkgutil_url2catalog "$mirror_url") + catalog_files=( "${catalog_files[@]}" "$catalog" ) + done + + if [[ "$command" == @(--download|-d|--install|-i|--upgrade|-u|s|--stream) ]]; then + local packages_list=$(awk ' $0 ~ /BEGIN PGP SIGNATURE/ { exit } $1 ~ /^Hash:/ || $1 ~ /^ *(-|#|$)/ { next } { print $1 }' "${catalog_files[@]}") + COMPREPLY=( $(compgen -W "${packages_list}" -- $cur) ) + + elif [[ "$command" == @(-r|--remove) ]]; then + local packages_list=$(pkginfo | awk ' $2 ~ /^CSW/ { printf ("%s|",$2) }') + packages_list=${packages_list%|} + packages_list=$(nawk " \$3 ~ /^$packages_list\$/ { print \$1 }" "${catalog_files[@]}") + COMPREPLY=( $(compgen -W "${packages_list}" -- $cur) ) + fi + return 0 + fi + + local commands="-i --install -u --upgrade -r --remove -d --download -U --catalog -a --available --describe -c --compare -C --compare-diff -A --compare-avail -e --email -t --temp -x --exclude -W --workdir -P --pkgdir -R --rootpath --config -y --yes -f --force -n --nomod -N --nodeps -D --debug --trace -h --help -v --version -V --syscheck -l --list -L --listfile -F --findfile --deptree --extract -s --stream -o --output -T --target --single -p --param --parse --cleanup --catinfo" + COMPREPLY=( $(compgen -W "${commands}" -- $cur) ) + return 0 +} + +complete -F _pkgutil pkgutil + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/postfix b/completions/postfix index 7eefccbb..b74bcafe 100644 --- a/completions/postfix +++ b/completions/postfix @@ -21,7 +21,7 @@ _postfix() return 0 fi - COMPREPLY=( $( compgen -W 'check start stop abort flush reload status \ + COMPREPLY=( $( compgen -W 'check start stop abort flush reload status set-permissions upgrade-configuration' -- "$cur" ) ) } && complete -F _postfix postfix diff --git a/completions/puppet b/completions/puppet index 66a81b3b..f24917a7 100644 --- a/completions/puppet +++ b/completions/puppet @@ -20,7 +20,7 @@ _puppet_certs() local puppetca="puppet cert" PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin type puppetca &>/dev/null \ && puppetca=puppetca - + if [[ "$1" = '--all' ]]; then cert_list=$( $puppetca --list --all | sed -e 's/^[+-]\?\s*\(\S\+\)\s\+.*$/\1/' ) else @@ -95,7 +95,7 @@ _puppet() command=apply ;; *) - COMPREPLY=( $( compgen -W 'agent apply cert describe doc \ + COMPREPLY=( $( compgen -W 'agent apply cert describe doc filebucket kick master queue resource' -- "$cur" ) ) return 0 ;; @@ -114,7 +114,7 @@ _puppet() ;; --serve) # From /usr/lib/ruby/1.8/puppet/network/handler/ - COMPREPLY=( $( compgen -W 'ca filebucket fileserver master \ + COMPREPLY=( $( compgen -W 'ca filebucket fileserver master report runner status' -- "$cur" ) ) return 0 ;; @@ -127,10 +127,10 @@ _puppet() return 0 ;; *) - COMPREPLY=( $( compgen -W '--daemonize --no-daemonize \ - --debug --detailed-exitcodes --disable --enable \ - --help --fqdn --logdest --onetime --serve --test \ - --noop --digest --fingerprint --version --verbose \ + COMPREPLY=( $( compgen -W '--daemonize --no-daemonize + --debug --detailed-exitcodes --disable --enable --help + --fqdn --logdest --onetime --serve --test --noop + --digest --fingerprint --version --verbose --waitforcert --no-client' -- "$cur" ) ) return 0 esac @@ -143,15 +143,15 @@ _puppet() ;; *) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --version --debug \ - --verbose --execute --detailed-exitcodes \ + COMPREPLY=( $( compgen -W '--help --version --debug + --verbose --execute --detailed-exitcodes --logdest' -- "$cur" ) ) else _filedir fi return 0 esac - ;; + ;; cert) case $prev in --digest) @@ -182,22 +182,22 @@ _puppet() return 0 ;; *) - COMPREPLY=( $( compgen -W '--clean --generate \ - --help --list --print --fingerprint --revoke \ + COMPREPLY=( $( compgen -W '--clean --generate + --help --list --print --fingerprint --revoke --sign --version --verify' -- "$cur" ) ) return 0 esac esac - ;; + ;; describe) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --short --providers --list \ + COMPREPLY=( $( compgen -W '--help --short --providers --list --meta' -- "$cur" ) ) else _puppet_types fi return 0 - ;; + ;; doc) case $prev in --outputdir) @@ -214,14 +214,14 @@ _puppet() ;; *) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--all --help --outputdir \ + COMPREPLY=( $( compgen -W '--all --help --outputdir --mode --reference --charset --list' -- "$cur" ) ) else _filedir fi return 0 esac - ;; + ;; filebucket) case $prev in --server) @@ -234,9 +234,9 @@ _puppet() ;; *) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --version --debug \ + COMPREPLY=( $( compgen -W '--help --version --debug --verbose --local --remote --server --bucket' \ - -- "$cur" ) ) + -- "$cur" ) ) else COMPREPLY=( $( compgen -W 'backup get restore' \ -- "$cur" ) ) @@ -244,14 +244,14 @@ _puppet() fi return 0 esac - ;; + ;; kick) case $prev in --class) return 0 ;; --host) - _known_hosts_real "$cur" + _known_hosts_real "$cur" return 0 ;; --tag) @@ -259,15 +259,15 @@ _puppet() ;; *) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--all --class --debug \ - --foreground --help --host --no-fqdn \ + COMPREPLY=( $( compgen -W '--all --class --debug + --foreground --help --host --no-fqdn --ignoreschedules --tag --test --ping' -- "$cur" ) ) else _known_hosts_real "$cur" fi return 0 esac - ;; + ;; master) case $prev in --logdest) @@ -275,12 +275,12 @@ _puppet() return 0 ;; *) - COMPREPLY=( $( compgen -W '--daemonize --no-daemonize \ + COMPREPLY=( $( compgen -W '--daemonize --no-daemonize --debug --help --logdest --verbose --version' \ - -- "$cur" ) ) + -- "$cur" ) ) return 0 esac - ;; + ;; queue) case $prev in --logdest) @@ -289,22 +289,22 @@ _puppet() ;; *) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--help --version --debug \ - --verbose --execute --detailed-exitcodes \ + COMPREPLY=( $( compgen -W '--help --version --debug + --verbose --execute --detailed-exitcodes --logdest' -- "$cur" ) ) else _filedir fi return 0 esac - ;; + ;; resource|*) COMPREPLY=( $( compgen -W '--help --version --debug --verbose' \ -- "$cur" ) ) return 0 - ;; + ;; esac } && -complete -F _puppet puppetmasterd puppetd puppetca ralsh puppetrun puppetqd filebucket puppetdoc puppet +complete -F _puppet puppetmasterd puppetd puppetca ralsh puppetrun puppetqd filebucket puppetdoc puppet # ex: ts=4 sw=4 et filetype=sh diff --git a/completions/pwd b/completions/pwd index 8818b49d..ca00a3ff 100644 --- a/completions/pwd +++ b/completions/pwd @@ -11,11 +11,9 @@ _pwd() ;; esac - if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY ]] || \ - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) - fi + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + [[ $COMPREPLY ]] || \ + COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) } && complete -F _pwd pwd diff --git a/completions/pydoc b/completions/pydoc new file mode 100644 index 00000000..2783d174 --- /dev/null +++ b/completions/pydoc @@ -0,0 +1,39 @@ +# pydoc completion -*- shell-script -*- + +_pydoc() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -k|-p) + return + ;; + -w) + _filedir + return + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W \ + '$( "$1" | sed -e "s/^pydoc3\{0,1\} //" | _parse_help - )' \ + -- "$cur" ) ) + return + fi + + COMPREPLY=( $( compgen -W 'keywords topics modules' -- "$cur" ) ) + + local python=python; [[ $1 == *3* ]] && python=python3 + _xfunc python _python_modules $python + + # Note that we don't do "pydoc modules" as it is known to hang on + # some systems; _python_modules tends to work better and faster. + COMPREPLY+=( $( compgen -W \ + '$( $1 keywords topics | sed -e /^Here/d )' -- "$cur" ) ) + + _filedir py +} && +complete -F _pydoc pydoc pydoc3 + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/pylint b/completions/pylint new file mode 100644 index 00000000..8c69dce9 --- /dev/null +++ b/completions/pylint @@ -0,0 +1,66 @@ +# pylint(1) completion -*- shell-script -*- + +_pylint() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + --version|-h|--help|--long-help|--help-msg|--init-hook|--ignore|-e|\ + --enable|-d|--disable|--evaluation|--max-line-length|\ + --max-module-lines|--indent-string|--min-similarity-lines|--max-args|\ + --ignored-argument-names|--max-locals|--max-returns|--max-branchs|\ + --max-statements|--max-parents|--max-attributes|--min-public-methods|\ + --max-public-methods|--required-attributes|--bad-functions|\ + --module-rgx|--const-rgx|--class-rgx|--function-rgx|--method-rgx|\ + --attr-rgx|--argument-rgx|--variable-rgx|--inlinevar-rgx|--good-names|\ + --bad-names|--no-docstring-rgx|--dummy-variables-rgx|\ + --additional-builtins|--notes|--ignored-classes|--generated-members|\ + --overgeneral-exceptions|--ignore-iface-methods|\ + --defining-attr-methods|--valid-classmethod-first-arg|\ + --valid-metaclass-classmethod-first-arg) + return + ;; + --rcfile) + _filedir + return + ;; + --persistent|-i|--include-ids|-s|--symbols|--files-output|-r|\ + --reports|--comment|--ignore-comments|--ignore-docstrings|\ + --ignore-imports|--init-import|--ignore-mixin-members|--zope) + COMPREPLY=( $( compgen -W 'yes no' -- "$cur" ) ) + return + ;; + --load-plugins|--deprecated-modules) + local prefix=; [[ $cur == *,* ]] && prefix="${cur%,*}," + cur="${cur##*,}" + _xfunc python _python_modules + COMPREPLY=( ${COMPREPLY[@]/#/$prefix} ) + return + ;; + -f|--format) + COMPREPLY=( $( compgen -W 'text parseable colorized msvs html' \ + -- "$cur" ) ) + return + ;; + --import-graph|--ext-import-graph|--int-import-graph) + _filedir dot + return + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W \ + '$( _parse_help "$1" --long-help )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + fi + + _xfunc python _python_modules + _filedir py +} && +complete -F _pylint pylint + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/python b/completions/python index 969f3b93..9c7cec13 100644 --- a/completions/python +++ b/completions/python @@ -1,12 +1,22 @@ # bash completion for python -*- shell-script -*- +_python_modules() +{ + COMPREPLY+=( $( compgen -W "$( ${1:-python} -c 'import pkgutil +for mod in pkgutil.iter_modules(): print(mod[1])' )" 2>/dev/null -- "$cur" ) ) +} + _python() { local cur prev words cword _init_completion || return case $prev in - -'?'|-h|--help|-V|--version|-c|-m) + -'?'|-h|--help|-V|--version|-c) + return 0 + ;; + -m) + _python_modules "$1" return 0 ;; -Q) diff --git a/completions/qemu b/completions/qemu index 45a48b9b..3899715a 100644 --- a/completions/qemu +++ b/completions/qemu @@ -20,9 +20,9 @@ _qemu() return 0 ;; -k) - COMPREPLY=( $( compgen -W 'ar de-ch es fo fr-ca hu ja \ - mk no pt-br sv da en-gb et fr fr-ch is lt nl pl\ - ru th de en-us fi fr-be hr it lv nl-be pt sl tr' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'ar de-ch es fo fr-ca hu ja mk no pt-br + sv da en-gb et fr fr-ch is lt nl pl ru th de en-us fi fr-be hr + it lv nl-be pt sl tr' -- "$cur" ) ) return 0 ;; -soundhw) @@ -41,8 +41,8 @@ _qemu() return 0 ;; -usbdevice) - COMPREPLY=( $( compgen -W 'mouse tablet disk: host: \ - serial: braille net' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'mouse tablet disk: host: serial: braille + net' -- "$cur" ) ) return 0 ;; -net) @@ -51,9 +51,8 @@ _qemu() return 0 ;; -serial|-parallel|-monitor) - COMPREPLY=( $( compgen -W 'vc pty none null /dev/ \ - file: stdio pipe: COM udp: tcp: telnet: unix: \ - mon: braille' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'vc pty none null /dev/ file: stdio pipe: + COM udp: tcp: telnet: unix: mon: braille' -- "$cur" ) ) return 0 ;; -redir) @@ -70,8 +69,8 @@ _qemu() return 0 ;; -drive) - COMPREPLY=( $( compgen -S"=" -W 'file if bus unit index media \ - cyls snapshot cache format serial addr' -- "$cur" ) ) + COMPREPLY=( $( compgen -S"=" -W 'file if bus unit index media cyls + snapshot cache format serial addr' -- "$cur" ) ) return 0 ;; -ballon) @@ -88,7 +87,7 @@ _qemu() return 0 ;; -watchdog-action) - COMPREPLY=( $( compgen -W 'reset shutdown poweroff pause debug \ + COMPREPLY=( $( compgen -W 'reset shutdown poweroff pause debug none' -- "$cur" ) ) return 0 ;; diff --git a/completions/qrunner b/completions/qrunner index 3fe5f810..d92c011b 100644 --- a/completions/qrunner +++ b/completions/qrunner @@ -8,8 +8,8 @@ _qrunner() $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--runner --once \ - --list --verbose --subproc --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--runner --once --list --verbose --subproc + --help' -- "$cur" ) ) fi } && diff --git a/completions/querybts b/completions/querybts index a973f743..9e28887a 100644 --- a/completions/querybts +++ b/completions/querybts @@ -8,27 +8,25 @@ _querybts() case $prev in -B|--bts) COMPREPLY=( $( compgen -W "debian guug kde mandrake help" \ - -- "$cur" )) + -- "$cur" ) ) return 0 ;; -u|--ui|--interface) - COMPREPLY=($( compgen -W "newt text gnome" -- "$cur" )) + COMPREPLY=( $( compgen -W "newt text gnome" -- "$cur" ) ) return 0 ;; esac $split && return 0 - COMPREPLY=($( compgen -W '-h --help -v --version -A --archive \ - -B --bts -l --ldap --no-ldap --proxy --http_proxy \ - -s --source -w --web -u --ui --interface \ - wnpp boot-floppies kernel bugs.debian.org \ - cdimage.debian.org general installation-reports \ - listarchives lists.debian.org mirrors nm.debian.org \ - press project qa.debian.org release-notes \ - security.debian.org tech-ctte upgrade-reports \ - www.debian.org' -- "$cur" ) \ - $( apt-cache pkgnames -- "$cur" 2> /dev/null) ) + COMPREPLY=( $( compgen -W '-h --help -v --version -A --archive -B --bts -l + --ldap --no-ldap --proxy --http_proxy -s --source -w --web -u --ui + --interface \ + wnpp boot-floppies kernel bugs.debian.org cdimage.debian.org general + installation-reports listarchives lists.debian.org mirrors + nm.debian.org press project qa.debian.org release-notes + security.debian.org tech-ctte upgrade-reports www.debian.org' \ + -- "$cur" ) $( apt-cache pkgnames -- "$cur" 2> /dev/null ) ) } && complete -F _querybts querybts diff --git a/completions/rdesktop b/completions/rdesktop index 48a91750..50273f2d 100644 --- a/completions/rdesktop +++ b/completions/rdesktop @@ -32,7 +32,7 @@ _rdesktop() *:*) ;; *) - COMPREPLY=( $( compgen -W 'comport: disk: lptport: \ + COMPREPLY=( $( compgen -W 'comport: disk: lptport: printer: sound: lspci scard' -- "$cur" ) ) [[ $COMPREPLY == *: ]] && compopt -o nospace ;; diff --git a/completions/remove_members b/completions/remove_members index 4e459381..5003fcab 100644 --- a/completions/remove_members +++ b/completions/remove_members @@ -15,7 +15,7 @@ _remove_members() $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--file --all --fromall --nouserack \ + COMPREPLY=( $( compgen -W '--file --all --fromall --nouserack --noadminack --help' -- "$cur" ) ) else _xfunc list_lists _mailman_lists diff --git a/completions/reportbug b/completions/reportbug index aa5ac3e5..83be47f5 100644 --- a/completions/reportbug +++ b/completions/reportbug @@ -12,11 +12,11 @@ _reportbug() ;; -B|--bts) COMPREPLY=( $( compgen -W "debian guug kde mandrake help" -- \ - "$cur" )) + "$cur" ) ) return 0 ;; -e|--editor|--mua) - words=(words[0] "$cur") + words=( words[0] "$cur" ) cword=1 _command return 0 @@ -26,8 +26,8 @@ _reportbug() return 0 ;; -S|--severity) - COMPREPLY=( $( compgen -W "grave serious important normal \ - minor wishlist" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "grave serious important normal minor + wishlist" -- "$cur" ) ) return 0 ;; -u|--ui|--interface) @@ -39,12 +39,11 @@ _reportbug() return 0 ;; -T|--tag) - COMPREPLY=( $( compgen -W "none \ - woody potato sarge sarge-ignore etch etch-ignore \ - lenny lenny-ignore sid experimental confirmed \ - d-i fixed fixed-in-experimental fixed-upstream \ - help l10n moreinfo patch pending security \ - unreproducible upstream wontfix ipv6 lfs" -- "$cur" )) + COMPREPLY=( $( compgen -W "none woody potato sarge sarge-ignore + etch etch-ignore lenny lenny-ignore sid experimental confirmed + d-i fixed fixed-in-experimental fixed-upstream help l10n + moreinfo patch pending security unreproducible upstream wontfix + ipv6 lfs" -- "$cur" ) ) return 0 ;; --from-buildd) @@ -56,28 +55,25 @@ _reportbug() ;; esac - 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 \ - press project qa.debian.org release-notes \ - security.debian.org tech-ctte upgrade-reports \ - www.debian.org' -- "$cur" ) \ - $( apt-cache pkgnames -- "$cur" 2> /dev/null) ) + 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 press project qa.debian.org release-notes + security.debian.org tech-ctte upgrade-reports www.debian.org' \ + -- "$cur" ) $( apt-cache pkgnames -- "$cur" 2> /dev/null ) ) _filedir return 0 } && diff --git a/completions/rpm b/completions/rpm index b7b59e0e..a66534a6 100644 --- a/completions/rpm +++ b/completions/rpm @@ -52,11 +52,11 @@ _rpm() # first parameter on line case $cur in --*) - COMPREPLY=( $( compgen -W '--help --version --initdb \ - --checksig --addsign --delsign --rebuilddb --showrc \ - --setperms --setugids --eval --install --upgrade --query \ + COMPREPLY=( $( compgen -W '--help --version --initdb + --checksig --addsign --delsign --rebuilddb --showrc + --setperms --setugids --eval --install --upgrade --query --freshen --erase --verify --querytags --import' \ - -- "$cur" ) ) + -- "$cur" ) ) ;; *) COMPREPLY=( $( compgen -W '-e -E -F -i -q -t -U -V' \ @@ -122,45 +122,43 @@ _rpm() $split && return 0 # options common to all modes - local opts="--define= --eval= --macros= --nodigest --nosignature \ - --rcfile= --quiet --pipe --verbose" + local opts="--define= --eval= --macros= --nodigest --nosignature --rcfile= + --quiet --pipe --verbose" case ${words[1]} in -[iFU]*|--install|--freshen|--upgrade) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$opts --percent --force \ - --test --replacepkgs --replacefiles --root \ - --excludedocs --includedocs --noscripts --ignorearch \ - --dbpath --prefix= --ignoreos --nodeps --allfiles \ - --ftpproxy --ftpport --justdb --httpproxy --httpport \ - --noorder --relocate= --badreloc --notriggers \ - --excludepath= --ignoresize --oldpackage \ - --queryformat --repackage --nosuggests" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "$opts --percent --force --test + --replacepkgs --replacefiles --root --excludedocs --includedocs + --noscripts --ignorearch --dbpath --prefix= --ignoreos --nodeps + --allfiles --ftpproxy --ftpport --justdb --httpproxy --httpport + --noorder --relocate= --badreloc --notriggers --excludepath= + --ignoresize --oldpackage --queryformat --repackage + --nosuggests" -- "$cur" ) ) else _filedir '[rs]pm' fi ;; -e|--erase) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$opts --allmatches \ - --noscripts --notriggers --nodeps --test --repackage" \ - -- "$cur" ) ) + COMPREPLY=( $( compgen -W "$opts --allmatches --noscripts + --notriggers --nodeps --test --repackage" -- "$cur" ) ) else _rpm_installed_packages $1 fi ;; -q*|--query) # options common to all query types - opts+=" --changelog --configfiles --conflicts --docfiles - --dump --enhances --filesbypkg --filecaps --fileclass - --filecolor --fileprovide --filerequire --filesbypkg --info - --list --obsoletes --pipe --provides --queryformat= - --requires --scripts --suggests --triggers --xml" + opts+=" --changelog --configfiles --conflicts --docfiles --dump + --enhances --filesbypkg --filecaps --fileclass --filecolor + --fileprovide --filerequire --filesbypkg --info --list + --obsoletes --pipe --provides --queryformat= --requires + --scripts --suggests --triggers --xml" if [[ ${words[@]} == *\ -@(*([^ -])f|-file )* ]]; then # -qf completion if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$opts --dbpath --fscontext \ + COMPREPLY=( $( compgen -W "$opts --dbpath --fscontext --last --root --state" -- "$cur" ) ) else _filedir @@ -171,7 +169,7 @@ _rpm() elif [[ ${words[@]} == *\ -@(*([^ -])p|-package )* ]]; then # -qp; uninstalled package completion if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$opts --ftpport --ftpproxy \ + COMPREPLY=( $( compgen -W "$opts --ftpport --ftpproxy --httpport --httpproxy --nomanifest" -- "$cur" ) ) else _filedir '[rs]pm' @@ -199,9 +197,9 @@ _rpm() ;; -[Vy]*|--verify) if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W "$opts --root= --dbpath --nodeps \ - --nogroup --nolinkto --nomode --nomtime --nordev --nouser \ - --nofiles --noscripts --nomd5 --querytags --specfile \ + COMPREPLY=( $( compgen -W "$opts --root= --dbpath --nodeps + --nogroup --nolinkto --nomode --nomtime --nordev --nouser + --nofiles --noscripts --nomd5 --querytags --specfile --whatrequires --whatprovides" -- "$cur" ) ) # check whether we're doing file completion elif [[ ${words[@]} == *\ -@(*([^ -])f|-file )* ]]; then diff --git a/completions/rpmcheck b/completions/rpmcheck index 5c3d16f0..dce7319e 100644 --- a/completions/rpmcheck +++ b/completions/rpmcheck @@ -13,8 +13,8 @@ _rpmcheck() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-explain -failures -successes \ - -dump -dump-all -base -help -compressed-input' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '-explain -failures -successes -dump + -dump-all -base -help -compressed-input' -- "$cur" ) ) else _filedir fi diff --git a/completions/rrdtool b/completions/rrdtool index 8170c9fe..c7d2bd2a 100644 --- a/completions/rrdtool +++ b/completions/rrdtool @@ -6,7 +6,7 @@ _rrdtool () _init_completion || return if [[ ${#words[@]} -eq 2 ]]; then - COMPREPLY=( $( compgen -W 'create update updatev graph dump restore \ + COMPREPLY=( $( compgen -W 'create update updatev graph dump restore last lastupdate first info fetch tune resize xport' -- "$cur" ) ) else _filedir rrd diff --git a/completions/rsync b/completions/rsync index e3f0f10e..04e1cda1 100644 --- a/completions/rsync +++ b/completions/rsync @@ -36,33 +36,32 @@ _rsync() 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" ) ) + 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" ) ) [[ $COMPREPLY == *= ]] || compopt +o nospace ;; *:*) diff --git a/completions/sbopkg b/completions/sbopkg index 598cb8cf..f6589103 100644 --- a/completions/sbopkg +++ b/completions/sbopkg @@ -24,7 +24,7 @@ _sbopkg() return ;; -V) - COMPREPLY=( $( compgen -W "? \ + COMPREPLY=( $( compgen -W "? $( sbopkg -V ? 2>&1 | cut -s -f1 )" -- "$cur" ) ) return ;; diff --git a/completions/screen b/completions/screen index 7132d064..1ba1b24b 100644 --- a/completions/screen +++ b/completions/screen @@ -84,8 +84,8 @@ _screen() esac if [[ "$cur" == -* ]]; then - 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 -T -U -v -wipe -x -X --help \ + 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 -T -U -v -wipe -x -X --help --version' -- "$cur" ) ) fi } && diff --git a/completions/slackpkg b/completions/slackpkg index 1be2f956..dab9c6d4 100644 --- a/completions/slackpkg +++ b/completions/slackpkg @@ -70,14 +70,14 @@ _slackpkg() remove) _filedir COMPREPLY+=( $( compgen -W 'a ap d e f k kde kdei l n t tcl x - xap y' -- "$cur" ) ) + xap xfce y' -- "$cur" ) ) COMPREPLY+=( $( cd /var/log/packages; compgen -f -- "$cur" ) ) return ;; install|reinstall|upgrade|blacklist|download) _filedir COMPREPLY+=( $( compgen -W 'a ap d e f k kde kdei l n t tcl x - xap y' -- "$cur" ) ) + xap xfce y' -- "$cur" ) ) COMPREPLY+=( $( cut -f 6 -d\ "${WORKDIR}/pkglist" 2> /dev/null | \ grep "^$cur" ) ) return diff --git a/completions/slapt-get b/completions/slapt-get index ff42660a..93d110bc 100644 --- a/completions/slapt-get +++ b/completions/slapt-get @@ -70,7 +70,7 @@ _slapt_get() ;; set) # --install-set COMPREPLY=( $( compgen -W 'a ap d e f k kde kdei l n t tcl x - xap y' -- "$cur" ) ) + xap xfce y' -- "$cur" ) ) return ;; esac diff --git a/completions/smartctl b/completions/smartctl index 8461c988..bc0d0c01 100644 --- a/completions/smartctl +++ b/completions/smartctl @@ -29,8 +29,8 @@ _smartctl_device() } _smartctl_tolerance() { - COMPREPLY=( $( compgen -W 'normal conservative permissive \ - verypermissive' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'normal conservative permissive verypermissive' \ + -- "$cur" ) ) } _smartctl_badsum() { @@ -56,10 +56,10 @@ _smartctl_log() } _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() { diff --git a/completions/smbclient b/completions/smbclient index b7371907..fe14f940 100644 --- a/completions/smbclient +++ b/completions/smbclient @@ -17,7 +17,7 @@ _samba_hosts() if [[ -n ${COMP_SAMBA_SCAN:-} ]]; then COMPREPLY=( $( compgen -W "$( smbtree -N -S | \ sed -ne 's/^[[:space:]]*\\\\*\([^[:space:]]*\).*/\1/p' \ - )" -- $cur ) ) + )" -- "$cur" ) ) fi } diff --git a/completions/ss b/completions/ss new file mode 100644 index 00000000..655f1f1f --- /dev/null +++ b/completions/ss @@ -0,0 +1,39 @@ +# ss(8) completion -*- shell-script -*- + +_ss() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + -h|--help|-V|--version) + return + ;; + -f|--family) + COMPREPLY=( $( compgen -W 'unix inet inet6 link netlink' \ + -- "$cur" ) ) + return + ;; + -A|--query) + local prefix=; [[ $cur == *,* ]] && prefix="${cur%,*}," + COMPREPLY=( $( compgen -P "$prefix" -W '$( "$1" --help | \ + sed -e "s/|/ /g" -ne "s/.*QUERY := {\([^}]*\)}.*/\1/p" )' \ + -- "${cur##*,}" ) ) + return + ;; + -D|--diag|-F|--filter) + _filedir + return + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + fi +} && +complete -F _ss ss + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/ssh b/completions/ssh index 5cd03b97..ebd7424a 100644 --- a/completions/ssh +++ b/completions/ssh @@ -2,37 +2,39 @@ _ssh_ciphers() { - 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" ) ) + 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+=( $( compgen -W 'hmac-md5 hmac-sha1 \ - umac-64@openssh.com hmac-ripemd160 hmac-sha1-96 hmac-md5-96' \ - -- "$cur" ) ) + COMPREPLY+=( $( compgen -W 'hmac-md5 hmac-sha1 umac-64@openssh.com + hmac-ripemd160 hmac-sha1-96 hmac-md5-96' -- "$cur" ) ) } _ssh_options() { 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 \ + COMPREPLY=( $( compgen -S = -W 'AddressFamily BatchMode BindAddress + ChallengeResponseAuthentication CheckHostIP Cipher Ciphers + ClearAllForwardings Compression CompressionLevel ConnectionAttempts + ConnectTimeout ControlMaster ControlPath ControlPersist DynamicForward + EnableSSHKeysign EscapeChar ExitOnForwardFailure ForwardAgent + ForwardX11 ForwardX11Timeout ForwardX11Trusted GatewayPorts + GlobalKnownHostsFile GSSAPIAuthentication GSSAPIClientIdentity + GSSAPIDelegateCredentials GSSAPIKeyExchange GSSAPIRenewalForcesRekey + GSSAPIServerIdentity GSSAPITrustDns HashKnownHosts Host + HostbasedAuthentication HostKeyAlgorithms HostKeyAlias HostName + IdentityFile IdentitiesOnly IPQoS KbdInteractiveDevices KexAlgorithms + LocalCommand LocalForward LogLevel MACs + NoHostAuthenticationForLocalhost NumberOfPasswordPrompts + PasswordAuthentication PermitLocalCommand PKCS11Provider Port + PreferredAuthentications Protocol ProxyCommand PubkeyAuthentication + RekeyLimit RemoteForward RequestTTY RhostsRSAAuthentication + RSAAuthentication SendEnv ServerAliveCountMax ServerAliveInterval + SmartcardDevice StrictHostKeyChecking TCPKeepAlive Tunnel TunnelDevice + UsePrivilegedPort User UserKnownHostsFile VerifyHostKeyDNS VisualHostKey XAuthLocation' -- "$cur" ) ) } @@ -47,16 +49,17 @@ _ssh_suboption() case $prev in BatchMode|ChallengeResponseAuthentication|CheckHostIP|\ - ClearAllForwardings|Compression|ExitOnForwardFailure|ForwardAgent|\ - ForwardX11|ForwardX11Trusted|GatewayPorts|GSSAPIAuthentication|\ - GSSAPIKeyExchange|GSSAPIDelegateCredentials|GSSAPITrustDns|\ + ClearAllForwardings|ControlPersist|Compression|EnableSSHKeysign|\ + ExitOnForwardFailure|ForwardAgent|ForwardX11|ForwardX11Trusted|\ + GatewayPorts|GSSAPIAuthentication|GSSAPIKeyExchange|\ + GSSAPIDelegateCredentials|GSSAPIRenewalForcesRekey|GSSAPITrustDns|\ HashKnownHosts|HostbasedAuthentication|IdentitiesOnly|\ KbdInteractiveAuthentication|KbdInteractiveDevices|\ NoHostAuthenticationForLocalhost|PasswordAuthentication|\ PubkeyAuthentication|RhostsRSAAuthentication|RSAAuthentication|\ StrictHostKeyChecking|TCPKeepAlive|UsePrivilegedPort|\ VerifyHostKeyDNS|VisualHostKey) - COMPREPLY=( $( compgen -W 'yes no' -- "$cur") ) + COMPREPLY=( $( compgen -W 'yes no' -- "$cur" ) ) ;; AddressFamily) COMPREPLY=( $( compgen -W 'any inet inet6' -- "$cur" ) ) @@ -67,16 +70,23 @@ _ssh_suboption() Cipher) COMPREPLY=( $( compgen -W 'blowfish des 3des' -- "$cur" ) ) ;; + IPQoS) + COMPREPLY=( $( compgen -W 'af1{1..4} af2{2..3} af3{1..3} af4{1..3} + cs{0..7} ef lowdelay throughput reliability' -- "$cur" ) ) + ;; Protocol) COMPREPLY=( $( compgen -W '1 2 1,2 2,1' -- "$cur" ) ) ;; + RequestTTY) + COMPREPLY=( $( compgen -W 'no yes force auto' -- "$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" ) ) + COMPREPLY=( $( compgen -W 'gssapi-with-mic host-based publickey + keyboard-interactive password' -- "$cur" ) ) ;; MACs) _ssh_macs @@ -129,6 +139,10 @@ _ssh() COMPREPLY=( $( compgen -u -- "$cur" ) ) return 0 ;; + -O) + COMPREPLY=( $( compgen -W 'check forward exit stop' -- "$cur" ) ) + return 0 + ;; -o) _ssh_options return 0 @@ -141,7 +155,7 @@ _ssh() _ip_addresses return 0 ;; - -D|-e|-I|-L|-O|-p|-R|-W) + -D|-e|-I|-L|-p|-R|-W) return 0 ;; esac @@ -339,10 +353,10 @@ _scp() _expand || return 0 - if [[ "$cur" == *:* ]]; then - _scp_remote_files - return 0 - fi + case $cur in + !(*:*)/*|[.~]*) ;; # looks like a path + *:*) _scp_remote_files ; return 0 ;; + esac if [[ "$cur" == -F* ]]; then cur=${cur#-F} diff --git a/completions/sshow b/completions/sshow index a28d2444..2e9bd467 100644 --- a/completions/sshow +++ b/completions/sshow @@ -7,7 +7,7 @@ _sshow() case $prev in -i) - _interfaces + _available_interfaces -a return 0 ;; esac diff --git a/completions/strace b/completions/strace index 9d28a54e..0b8f0e9c 100644 --- a/completions/strace +++ b/completions/strace @@ -58,7 +58,7 @@ _strace() COMPREPLY=( $( compgen -W '${!syscalls[@]} file process network signal ipc desc all none' \ - -- "$cur") ) + -- "$cur" ) ) return 0 ;; esac @@ -89,9 +89,8 @@ _strace() esac if [[ "$cur" == -* ]]; then - 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" ) ) + 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 COMPREPLY=( $( compgen -c -- "$cur" ) ) fi diff --git a/completions/strings b/completions/strings new file mode 100644 index 00000000..8f47d374 --- /dev/null +++ b/completions/strings @@ -0,0 +1,44 @@ +# strings(1) completion -*- shell-script -*- + +_strings() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + -h|--help|-v|-V|--version|-n|--bytes) + return + ;; + -t|--radix) + COMPREPLY=( $( compgen -W 'o d x' -- "$cur" ) ) + return + ;; + -T|--target) + COMPREPLY=( $( compgen -W '$( "$1" --help 2>/dev/null | \ + sed -ne "s/: supported targets: \(.*\)/\1/p" )' -- "$cur" ) ) + return + ;; + -e|--encoding) + COMPREPLY=( $( compgen -W 's S b l B L' -- "$cur" ) ) + return + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + elif [[ $cur == @* ]]; then + cur=${cur:1} + _filedir + COMPREPLY=( "${COMPREPLY[@]/#/@}" ) + return + fi + + _filedir +} && +complete -F _strings strings + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/svcadm b/completions/svcadm new file mode 100644 index 00000000..21cc723c --- /dev/null +++ b/completions/svcadm @@ -0,0 +1,143 @@ +# svcadm completion -*- shell-script -*- +# +# Copyright 2006 Yann Rouillard <yann@opencsw.org> + +# +# svcadm accept any complete FMRI or abreviated FMRI +# - a complete FMRI is svc:/foo/bar/bar/baz +# - abbreviated FMRI are foo/bar/bar/baz, bar/bar/baz, bar/baz or baz +# +# The goal of this function is to be able to propose all alternatives, +# but to not clutter the interface with all completions, we will only +# cut every completion alternative at the next slash. +# +# For exemple, if the user types <nothing><tab>, we will propose for svc://foo/bar/bar/baz +# the following completion: foo/, bar/ and baz +# If the user types <b><tab>, we will propose: bar/ and baz +# If the user types <bar/><tab>, we will propose: bar/bar/ and bar/baz +# +# By default, the function proproses only abbreviated completions except if the user already +# began to type svc:. In that case we will propose only the complete FMRI beginning with the +# pattern +# +_smf_complete_fmri () +{ + local cur="$1" prefix="$2" + local cur_prefix fmri fmri_list="" + local exact_mode pattern + + if [[ "$cur" == $prefix* ]]; then + [[ "$cur" == $prefix ]] && cur+="/" + pattern="$cur*" + exact_mode=1 + else + pattern="$prefix*/$cur*" + fi + + cur_prefix="${cur%"${cur##*/}"}" + + for fmri in $(svcs -H -o FMRI "$pattern" 2>/dev/null); do + local fmri_part_list fmri_part + if [[ -z "$exact_mode" ]]; then + fmri=${fmri#$prefix/} + + # we generate all possibles abbrevations for the FMRI + # no need to have a generic loop as we will have a finite + # number of components + local OIFS="$IFS"; IFS="/"; set -- $fmri; IFS="$OIFS" + case $# in + 1) fmri_part_list=" $1";; + 2) fmri_part_list=" $2 $1/$2";; + 3) fmri_part_list=" $3 $2/$3 $1/$2/$3";; + 4) fmri_part_list=" $4 $3/$4 $2/$3/$4 $1/$2/$3/$4";; + esac + else + fmri_part_list="$fmri" + fi + + # Here we make sure the completions begins with the pattern and + # we cut them at the first slash + for fmri_part in $fmri_part_list; do + [[ "$fmri_part" == $cur* ]] || continue + local first_part=${fmri_part#$cur_prefix} + first_part=$cur_prefix${first_part%%/*} + [[ "$first_part" != "$fmri_part" ]] && first_part+="/" + fmri_list+=" $first_part" + done + done + + COMPREPLY=( $fmri_list ) + + # here we want to detect if there only one completion proposed and that + # it ends with a slash. That means the users will still have to complete + # after, so we gain him one tab keystroke by immediately proposing the + # next completion alternatives + local i=${#COMPREPLY[*]} + if [[ $i -gt 0 ]] && [[ "${COMPREPLY[$((--i))]}" == */ ]]; then + # we have to iterate throught the list as we may have duplicate + while [[ $i -ne 0 ]]; do + [[ "${COMPREPLY[$i]}" != "${COMPREPLY[$((i - 1))]}" ]] && break + ((i--)) + done + if [[ $i -eq 0 ]]; then + _smf_complete_fmri "${COMPREPLY[0]}" "$prefix" + return 0 + fi + fi + + # Work-around bash_completion issue where bash interprets a colon + # as a separator, borrowed from maven completion code which borrowed + # it from darcs completion code :) + local colonprefixes=${cur%"${cur##*:}"} + local i=${#COMPREPLY[*]} + while [ $((--i)) -ge 0 ]; do + COMPREPLY[$i]=${COMPREPLY[$i]#"$colonprefixes"} + done +} + +_svcadm () +{ + local cur prev words cword + _init_completion -n : || return + + local command_list="enable disable restart refresh clear mark milestone" + local command i + + for (( i=1; i < $cword; i++ )); do + if [[ ${words[i]} == @(enable|disable|restart|refresh|clear|mark|milestone) ]]; then + command=${words[i]} + fi + done + + if [[ -z "$command" ]]; then + if [[ ${cur} == -* ]] ; then + COMPREPLY=( $(compgen -W "-v" -- ${cur}) ) + else + COMPREPLY=( $(compgen -W "$command_list" -- ${cur}) ) + fi + else + if [[ ${cur} == -* ]]; then + case "$command" in + enable) + COMPREPLY=( $(compgen -W "-r -s -t" -- ${cur}) );; + disable) + COMPREPLY=( $(compgen -W "-s -t" -- ${cur}) );; + mark) + COMPREPLY=( $(compgen -W "-I -t" -- ${cur}) );; + milestone) + COMPREPLY=( $(compgen -W "-d" -- ${cur}) );; + esac + else + if [[ "$command" == "mark" ]] && [[ "$prev" != @(degraded|maintenance) ]]; then + COMPREPLY=( $(compgen -W "degraded maintenance" -- ${cur}) ) + elif [[ "$command" == "milestone" ]]; then + _smf_complete_fmri "${cur}" "svc:/milestone" + else + _smf_complete_fmri "${cur}" "svc:" + fi + fi + fi +} && +complete -F _svcadm svcadm + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/svk b/completions/svk index 1146277d..632eeb29 100644 --- a/completions/svk +++ b/completions/svk @@ -7,13 +7,12 @@ _svk() local commands options command - commands='add admin annotate ann blame praise cat checkout co cleanup \ - cmerge cm commit ci copy cp delete del remove rm depotmap \ - depot describe desc diff di help h ? import info list ls log \ - merge mirror mi mkdir move mv ren rename patch propdel pd pdel \ - propedit pe pedit propget pg pget proplist pl plist propset ps \ - pset pull push resolved revert smerge sm status st stat switch \ - sw sync sy update up verify' + commands='add admin annotate ann blame praise cat checkout co cleanup + cmerge cm commit ci copy cp delete del remove rm depotmap depot + describe desc diff di help h ? import info list ls log merge mirror mi + mkdir move mv ren rename patch propdel pd pdel propedit pe pedit + propget pg pget proplist pl plist propset ps pset pull push resolved + revert smerge sm status st stat switch sw sync sy update up verify' if [[ $cword -eq 1 ]] ; then if [[ "$cur" == -* ]]; then @@ -49,99 +48,99 @@ _svk() options='-r --revision' ;; checkout|co) - options='-r --revision -q --quiet -N --non-recursive -l \ + options='-r --revision -q --quiet -N --non-recursive -l --list -d --detach --export --relocate --purge' ;; cleanup) options='-a --all' ;; 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 \ + 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) - options='--import -m --message -F --file --encoding \ - --template -P --patch -S --sign -C --check-only -N \ + options='--import -m --message -F --file --encoding + --template -P --patch -S --sign -C --check-only -N --non-recursive --direct' ;; copy|cp) - options='-r --revision -p --parent -q --quiet -m --message \ - -F --file --template --encoding -P --patch -S --sign \ - -C --check-only --direct' + 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) - options='-k --keep-local -m --message -F --file --encoding \ - --template -P --patch -S --sign -C --check-only \ + options='-k --keep-local -m --message -F --file --encoding + --template -P --patch -S --sign -C --check-only --direct' ;; depotmap|depot) options='-i --init -l --list -d --detach --relocate' ;; diff|di) - options='-r --revision -s --summarize -b --verbose -N \ + options='-r --revision -s --summarize -b --verbose -N --non-recursive' ;; import) - options='-f --from-checkout -t --to-checkout -m --message \ - -F --file --template --encoding -P --patch -S --sign \ - -C --check-only -N --non-recursive --direct' + options='-f --from-checkout -t --to-checkout -m --message + -F --file --template --encoding -P --patch -S --sign -C + --check-only -N --non-recursive --direct' ;; list|ls) - options='-r --revision -v --verbose -R --recursive -d \ + options='-r --revision -v --verbose -R --recursive -d --depth -f --full-path' ;; log) - options='-r --revision -l --limit -q --quiet -x --cross \ - -v --verbose' + options='-r --revision -l --limit -q --quiet -x --cross -v + --verbose' ;; merge) - options='-r --revision -c --change -I --incremental -a \ - --auto -l --log -s --sync -t --to -f --from \ - --verbatim --no-ticket --track-rename -m --message \ - -F --file --template --encoding -P --patch -S --sign \ - -C --check-only --direct' + options='-r --revision -c --change -I --incremental -a + --auto -l --log -s --sync -t --to -f --from --verbatim + --no-ticket --track-rename -m --message -F --file + --template --encoding -P --patch -S --sign -C + --check-only --direct' ;; mirror|mi) - options='-l --list -d --detach --relocate --recover \ + options='-l --list -d --detach --relocate --recover --unlock --upgrade' ;; mkdir) - options='-p --parent -m --message -F --file --template \ - --encoding -P --patch -S --sign -C --check-only \ + options='-p --parent -m --message -F --file --template + --encoding -P --patch -S --sign -C --check-only --direct' ;; 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' + options='-r --revision -p --parent -q --quiet -m --message + -F --file --encoding --template -P --patch -S --sign -C + --check-only --direct' ;; patch) options='--depot' ;; 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' + 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) - options='-R --recursive -r --revision --revprop -m \ - --message -F --file --template --encoding -P --patch \ + options='-R --recursive -r --revision --revprop -m + --message -F --file --template --encoding -P --patch -S --sign -C --check-only --direct' ;; propget|pget|pg) options='-R --recursive -r --revision --revprop --strict' ;; proplist|plist|pl) - options='-R --recursive -v --verbose \ - -r --revision --revprop' + options='-R --recursive -v --verbose -r --revision + --revprop' ;; pull) options='-a --all -l --lump' ;; push) - options='-f --from -l --lump -C --check -P --patch -S \ + options='-f --from -l --lump -C --check -P --patch -S --sign --verbatim' ;; resolved) @@ -151,14 +150,14 @@ _svk() options='-R --recursive -q --quiet' ;; 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' + 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) - options='-q --quiet --no-ignore -N --non-recursive -v \ + options='-q --quiet --no-ignore -N --non-recursive -v --verbose' ;; switch|sw) @@ -168,7 +167,7 @@ _svk() options='-a --all -s --skipto -t --torev' ;; update|up) - options='-r --revision -N --non-recursive -C --check-only \ + options='-r --revision -N --non-recursive -C --check-only -s --sync -m --merge -q --quiet' ;; esac @@ -178,17 +177,17 @@ _svk() else case $command in help|h|\?) - COMPREPLY=( $( compgen -W "$commands \ - environment commands intro" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "$commands environment commands + intro" -- "$cur" ) ) ;; admin) - COMPREPLY=( $( compgen -W 'help deltify dump hotcopy \ - list-dblogs list-unused-dblogs load lstxns recover \ + COMPREPLY=( $( compgen -W 'help deltify dump hotcopy + list-dblogs list-unused-dblogs load lstxns recover rmtxns setlog verify rmcache' -- "$cur" ) ) ;; patch) - COMPREPLY=( $( compgen -W '--ls --list --cat --view \ - --regen --regenerate --up --update --apply --rm \ + COMPREPLY=( $( compgen -W '--ls --list --cat --view + --regen --regenerate --up --update --apply --rm --delete' -- "$cur" ) ) ;; sync) diff --git a/completions/sync_members b/completions/sync_members index 77420f16..715d53f4 100644 --- a/completions/sync_members +++ b/completions/sync_members @@ -7,7 +7,7 @@ _sync_members() case $prev in -w|-g|-d|--welcome-msg|--goodbye-msg|--digest) - COMPREPLY=( $( compgen -W 'y n' -- "$cur") ) + COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) return 0 ;; -d|--file) @@ -19,8 +19,8 @@ _sync_members() $split && return 0 if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--no-change --welcome-msg \ - --goodbye-msg --digest --notifyadmin --file --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--no-change --welcome-msg --goodbye-msg + --digest --notifyadmin --file --help' -- "$cur" ) ) else _xfunc list_lists _mailman_lists fi diff --git a/completions/tar b/completions/tar index 45f3ff36..374e0692 100644 --- a/completions/tar +++ b/completions/tar @@ -12,7 +12,7 @@ _tar() return 0 fi - local tars='@(@(tar|gem|spkg)?(.@(Z|[gx]z|bz?(2)|lzma))|t@([glx]z|bz?(2)))' + local tars='@(@(tar|gem|spkg)?(.@(Z|[bgx]z|bz2|lz?(ma)))|t@([abglx]z|b?(z)2))' case ${words[1]} in --*) @@ -21,11 +21,11 @@ _tar() if [[ $cword -eq 2 ]]; then ext='@(tar|gem|spkg)' case ${words[1]} in - *a*) ext="$tars" ;; - *z*) ext='t?(ar.)gz' ;; - *Z*) ext='tar.Z' ;; - *[jy]*) ext='t?(ar.)bz?(2)' ;; - *J*) ext='t?(ar.)xz' ;; + *a*) ext="$tars" ;; + *z*) ext='t?(ar.)gz' ;; + *Z*) ext='ta@(r.Z|z)' ;; + *[jy]*) ext='t@(?(ar.)bz?(2)|b2)' ;; + *J*) ext='t?(ar.)xz' ;; esac _filedir $ext else @@ -33,21 +33,21 @@ _tar() fi return 0 ;; - +([^IZzJjy])f) + +([^ZzJjy])f) ext="$tars" - regex='\(\(tar\|gem\|spkg\)\(\.\(Z\|[gx]z\|bz2\?\|lzma\)\)\?\|t\([glx]z\|bz2\?\)\)' + regex='\(\(tar\|gem\|spkg\)\(\.\(Z\|[bgx]z\|bz2\|lz\(ma\)\?\)\)\?\|t\([abglx]z\|bz\?2\)\)' ;; *[Zz]*f) - ext='@(t?(ar.)|gem.|spkg.)@(gz|Z)' - regex='\(t\(ar\.\)\?\|gem\.\|spkg\.\)\(gz\|Z\)' + ext='@(@(t?(ar.)|gem.|spkg.)@(gz|Z)|taz)' + regex='\(\(t\(ar\.\)\?\|gem\.\|spkg\.\)\(gz\|Z\)\|taz\)' ;; - *[Ijy]*f) - ext='@(@(t?(ar.)|gem.)bz?(2)|spkg)' - regex='\(\(t\(ar\.\)\?\|gem\.\)bz2\?\|spkg\)' + *[jy]*f) + ext='@(@(t?(ar.)|gem.)bz?(2)|spkg|tb2)' + regex='\(\(t\(ar\.\)\?\|gem\.\)bz2\?\|spkg\|tb2\)' ;; *[J]*f) - ext='@(t?(ar.)|gem.|spkg.)@(lz?(ma)|xz)' - regex='\(t\(ar\.\)\?\|gem\.\|spkg\.\)\(lzma\|xz\)\?' + ext='@(@(tar|gem|spkg).@(lzma|xz)|t[lx]z)' + regex='\(\(tar\|gem\|spkg\)\.\(lzma\|xz\)\|t[lx]z\)' ;; *) _filedir @@ -56,13 +56,13 @@ _tar() esac case $prev in - *$ext) + *${ext:-$tars}) # complete on files in tar file # # get name of tar file from command line tar=$( sed -e 's/^.* \([^ ]*'$regex'\) .*$/\1/' <<<"${words[@]}" ) # devise how to untar and list it - untar=t${words[1]//[^IJzjyf]/} + untar=t${words[1]//[^Jzjyf]/} local IFS=$'\n' COMPREPLY=( $( compgen -W "$( printf '%s\n' $( tar $untar $tar \ diff --git a/completions/tcpdump b/completions/tcpdump index 8fe4ed63..7b4b4ea8 100644 --- a/completions/tcpdump +++ b/completions/tcpdump @@ -24,6 +24,7 @@ _tcpdump() return 0 ;; -z) + compopt -o filenames COMPREPLY=( $( compgen -c -- "$cur" ) ) return 0 ;; diff --git a/completions/tcpkill b/completions/tcpkill index 82420230..4a753326 100644 --- a/completions/tcpkill +++ b/completions/tcpkill @@ -7,7 +7,7 @@ _tcpkill() case $prev in -i) - _interfaces + _available_interfaces -a return 0 ;; esac diff --git a/completions/tcpnice b/completions/tcpnice index 03c23e5e..49b89258 100644 --- a/completions/tcpnice +++ b/completions/tcpnice @@ -7,7 +7,7 @@ _tcpnice() case $prev in -i) - _interfaces + _available_interfaces -a return 0 ;; esac diff --git a/completions/tshark b/completions/tshark new file mode 100644 index 00000000..32f853f2 --- /dev/null +++ b/completions/tshark @@ -0,0 +1,105 @@ +# tshark(1) completion -*- shell-script -*- + +_tshark() +{ + local cur prev words cword + _init_completion -n : || return + + case $prev in + -f|-s|-B|-D|-L|-c|-R|-N|-d|-C|-e|-E|-z|-h|-v|-o|-K) + return + ;; + -i) + _available_interfaces -a + return + ;; + -y) + local opts i + for (( i=${#words[@]}-1; i > 0; i-- )); do + if [[ ${words[i]} == -i ]]; then + opts+="-i ${words[i+1]}" + break + fi + done + COMPREPLY=( $( compgen -W "$( "$1" $opts -L 2>&1 | \ + awk '/^ / { print $1 }' )" -- "$cur" ) ) + return + ;; + -a|-b) + COMPREPLY=( $( compgen -W 'duration: filesize: files:' \ + -- "$cur" ) ) + [[ $COMPREPLY == *: ]] && compopt -o nospace + return + ;; + -r) + _filedir pcap + return + ;; + -H) + _filedir + return + ;; + -w) + _filedir + [[ $cur == @(|-) ]] && COMPREPLY+=( - ) + return + ;; + -F) + COMPREPLY=( $( compgen -W "$( "$1" -F 2>&1 | \ + awk '/^ / { print $1 }' )" -- "$cur" ) ) + return + ;; + -O) + local prefix=; [[ $cur == *,* ]] && prefix="${cur%,*}," + COMPREPLY=( $( compgen -P "$prefix" -W \ + "$( "$1" -G protocols 2>&1 | cut -d$'\t' -f 3 )" \ + -- "${cur##*,}" ) ) + return + ;; + -T) + # TODO: could be parsed from "-T ." output + COMPREPLY=( $( compgen -W 'ps text pdml psml fields' -- "$cur" ) ) + return + ;; + -t) + # TODO: could be parsed from "-t ." output + COMPREPLY=( $( compgen -W 'ad a r d dd e' -- "$cur" ) ) + return + ;; + -u) + # TODO: could be parsed from "-u ." output + COMPREPLY=( $( compgen -W 's hms' -- "$cur" ) ) + return + ;; + -W) + COMPREPLY=( $( compgen -W 'n' -- "$cur" ) ) + return + ;; + -X) + if [[ $cur == lua_script:* ]]; then + cur=${cur#*:} + _filedir lua + else + COMPREPLY=( $( compgen -W 'lua_script:' -- "$cur" ) ) + [[ $COMPREPLY == *: ]] && compopt -o nospace + fi + return + ;; + -G) + COMPREPLY=( $( compgen -W "$( "$1" -G ? | \ + awk '/^[ \t]*-G / \ + { sub("^[[]","",$2); sub("[]]$","",$2); print $2 }' )" \ + -- "$cur" ) ) + return + ;; + + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + return + fi +} && +complete -F _tshark tshark + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/umount.linux b/completions/umount.linux index 97231807..9bc9fcc1 100644 --- a/completions/umount.linux +++ b/completions/umount.linux @@ -105,11 +105,11 @@ _umount() cur="${cur##*,}" split=true fi - COMPREPLY=( $(compgen -W 'adfs affs autofs btrfs cifs coda + COMPREPLY=( $( compgen -W 'adfs affs autofs btrfs cifs coda cramfs debugfs devpts efs ext2 ext3 ext4 fuse hfs hfsplus hpfs iso9660 jfs minix msdos ncpfs nfs nfs4 ntfs ntfs-3g proc qnx4 ramfs reiserfs romfs squashfs smbfs sysv tmpfs ubifs udf ufs - umsdos usbfs vfat xfs' -- "$cur") ) + umsdos usbfs vfat xfs' -- "$cur" ) ) _fstypes $split && COMPREPLY=( ${COMPREPLY[@]/#/$prev,} ) return diff --git a/completions/unpack200 b/completions/unpack200 index de708fe8..fe058c64 100644 --- a/completions/unpack200 +++ b/completions/unpack200 @@ -33,7 +33,7 @@ _unpack200() if ! $pack ; then if [[ "$cur" == -* ]] ; then - COMPREPLY=( $( compgen -W '--deflate-hint= --remove-pack-file \ + COMPREPLY=( $( compgen -W '--deflate-hint= --remove-pack-file --verbose --quiet --log-file= --help --version' -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace else diff --git a/completions/unrar b/completions/unrar index 67a316ff..f2a8a182 100644 --- a/completions/unrar +++ b/completions/unrar @@ -6,9 +6,9 @@ _unrar() _init_completion || return 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" ) ) + 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 [[ $cword -eq 1 ]]; then COMPREPLY=( $( compgen -W 'e l lb lt p t v vb vt x' -- "$cur" ) ) diff --git a/completions/update-alternatives b/completions/update-alternatives index 051b1142..e421db86 100644 --- a/completions/update-alternatives +++ b/completions/update-alternatives @@ -82,8 +82,8 @@ _update_alternatives() _installed_alternatives ;; *) - COMPREPLY=( $( compgen -W '--verbose --quiet --help --version \ - --altdir --admindir --install --remove --auto --display \ + COMPREPLY=( $( compgen -W '--verbose --quiet --help --version + --altdir --admindir --install --remove --auto --display --config --set' -- "$cur" ) ) esac } && diff --git a/completions/update-rc.d b/completions/update-rc.d index 3dbad2e5..9a16385a 100644 --- a/completions/update-rc.d +++ b/completions/update-rc.d @@ -53,7 +53,7 @@ _update_rc_d() COMPREPLY=() fi elif [[ "$prev" == "." ]]; then - COMPREPLY=( $(compgen -W "start stop" -- "$cur") ) + COMPREPLY=( $( compgen -W "start stop" -- "$cur" ) ) else COMPREPLY=() fi diff --git a/completions/urlsnarf b/completions/urlsnarf index bb1a29ef..e9ccd8f9 100644 --- a/completions/urlsnarf +++ b/completions/urlsnarf @@ -7,7 +7,7 @@ _urlsnarf() case $prev in -i) - _interfaces + _available_interfaces -a return 0 ;; esac diff --git a/completions/useradd b/completions/useradd index 2a61c948..12c29365 100644 --- a/completions/useradd +++ b/completions/useradd @@ -9,11 +9,11 @@ _useradd() # with -u/--uid case $prev in - -c|--comment|-h|--help|-e|--expiredate|-f|--inactive|-k|--key|\ + -c|--comment|-h|--help|-e|--expiredate|-f|--inactive|-K|--key|\ -p|--password|-u|--uid|-Z|--selinux-user) return 0 ;; - -b|--base-dir|-d|--home|-k|--skel) + -b|--base-dir|-d|--home-dir|-k|--skel|-R|--root) _filedir -d return 0 ;; @@ -24,7 +24,8 @@ _useradd() return 0 ;; -G|--groups) - COMPREPLY=( $( compgen -g -- "$cur" ) ) + local prefix=; [[ $cur == *,* ]] && prefix="${cur%,*}," + COMPREPLY=( $( compgen -P "$prefix" -g -- "${cur##*,}" ) ) return 0 ;; -s|--shell) diff --git a/completions/userdel b/completions/userdel index aafd00eb..090203ac 100644 --- a/completions/userdel +++ b/completions/userdel @@ -5,6 +5,16 @@ _userdel() local cur prev words cword _init_completion || return + case $prev in + -h|--help) + return + ;; + -R|--root) + _filedir -d + return + ;; + esac + if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) return 0 diff --git a/completions/usermod b/completions/usermod index f8cd9e0e..0d1f497b 100644 --- a/completions/usermod +++ b/completions/usermod @@ -20,7 +20,12 @@ _usermod() return 0 ;; -G|--groups) - COMPREPLY=( $( compgen -g -- "$cur" ) ) + local prefix=; [[ $cur == *,* ]] && prefix="${cur%,*}," + COMPREPLY=( $( compgen -P "$prefix" -g -- "${cur##*,}" ) ) + return 0 + ;; + -R|--root) + _filedir -d return 0 ;; -s|--shell) diff --git a/completions/valgrind b/completions/valgrind index 1930c21b..08950998 100644 --- a/completions/valgrind +++ b/completions/valgrind @@ -42,6 +42,11 @@ _valgrind() COMPREPLY=( $( compgen -W 'lax-ioctls enable-outer' -- "$cur" ) ) return ;; + --soname-synonyms) + COMPREPLY=( $( compgen -W 'somalloc' -S = -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + ;; --kernel-variant) COMPREPLY=( $( compgen -W 'bproc' -- "$cur" ) ) return @@ -72,6 +77,7 @@ _valgrind() return ;; \<command\>) + compopt -o filenames COMPREPLY=( $( compgen -c -- "$cur" ) ) return ;; diff --git a/completions/vipw b/completions/vipw index 4205cee2..2220f2e8 100644 --- a/completions/vipw +++ b/completions/vipw @@ -9,12 +9,13 @@ _vipw() -h|--help) return 0 ;; + -R|--root) + _filedir -d + return 0 + ;; esac - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - return 0 - fi + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) } && complete -F _vipw vipw vigr diff --git a/completions/vncviewer b/completions/vncviewer index 46d6c617..a1c16d69 100644 --- a/completions/vncviewer +++ b/completions/vncviewer @@ -27,8 +27,8 @@ _tightvncviewer() return 0 ;; -encodings) - COMPREPLY=( $( compgen -W 'copyrect tight hextile zlib \ - corre rre raw' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'copyrect tight hextile zlib corre rre + raw' -- "$cur" ) ) return 0 ;; -via) @@ -39,11 +39,10 @@ _tightvncviewer() if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-help -listen -via -shared -noshared\ - -viewonly -fullscreen -noraiseonbeep -passwd -encodings\ - -bgr233 -owncmap -truecolour -truecolor -depth \ - -compresslevel -quality -nojpeg -nocursorshape \ - -x11cursor' -- $cur ) ) + COMPREPLY=( $( compgen -W '-help -listen -via -shared -noshared + -viewonly -fullscreen -noraiseonbeep -passwd -encodings -bgr233 + -owncmap -truecolour -truecolor -depth -compresslevel -quality + -nojpeg -nocursorshape -x11cursor' -- "$cur" ) ) else _known_hosts_real "$cur" fi @@ -68,7 +67,7 @@ _xvnc4viewer() ;; # -PreferredEncoding -[pP][rR][eE][fF][eE][rR][rR][eE][dD][eE][nN][cC][oO][dD][iI][nN][gG]) - COMPREPLY=( $( compgen -W 'zrle hextile raw' -- $cur ) ) + COMPREPLY=( $( compgen -W 'zrle hextile raw' -- "$cur" ) ) return 0 ;; # -via @@ -80,16 +79,12 @@ _xvnc4viewer() if [[ "$cur" == -* || "$cur" == --* ]]; then # Default to vncviewer camelcase options, see `vncviewer -help' - local dash 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 \ - ) + local dash 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 ) [[ "$cur" == --* ]] && dash=-- || dash=- local option oldNoCaseMatch=$(shopt -p nocasematch) diff --git a/completions/vpnc b/completions/vpnc index 0465c31e..143798de 100644 --- a/completions/vpnc +++ b/completions/vpnc @@ -6,31 +6,53 @@ _vpnc() _init_completion || return case $prev in + --help|--long-help|--version|--id|--username|--domain|--ifname|\ + --application-version|--local-addr|--local-port|--udp-port|--dpd-idle|\ + --target-network) + return 0 + ;; + --gateway) + _known_hosts_real "$cur" + return 0 + ;; + --vendor) + COMPREPLY=( $( compgen -W 'cisco netscreen' -- "$cur" ) ) + return 0 + ;; + --natt-mode) + COMPREPLY=( $( compgen -W 'natt none force-natt cisco-udp' \ + -- "$cur" ) ) + return 0 + ;; + --script|--pid-file|--ca-file) + _filedir + return 0 + ;; + --dh) + COMPREPLY=( $( compgen -W 'dh1 dh2 dh5' -- "$cur" ) ) + return 0 + ;; --pfs) COMPREPLY=( $( compgen -W 'nopfs dh1 dh2 dh5 server' -- "$cur" ) ) return 0 ;; - --pfs) - COMPREPLY=( $( compgen -W 'dh1 dh2 dh5' -- "$cur" ) ) + --debug) + COMPREPLY=( $( compgen -W '0 1 2 3 99' -- "$cur" ) ) return 0 ;; - --pid-file|--script) - _filedir + --auth-mode) + COMPREPLY=( $( compgen -W 'psk cert hybrid' -- "$cur" ) ) return 0 ;; - --gateway) - _known_hosts_real "$cur" + --ca-dir) + _filedir -d return 0 ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--version --print-config --help \ - --long-help --gateway --id --username --udp --domain \ - --xauth-inter --script --dh --pfs --enable-1des \ - --application-version --ifname --debug --no-detach \ - --pid-file --local-port --udp-port --disable-natt \ - --non-inter' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '$( _parse_help "$1" --long-help )' \ + -- "$cur" ) ) else COMPREPLY=( $( compgen -W '$( command ls /etc/vpnc )' -- "$cur" ) ) fi diff --git a/completions/wget b/completions/wget new file mode 100644 index 00000000..1fc5c955 --- /dev/null +++ b/completions/wget @@ -0,0 +1,164 @@ +# wget(1) completion -*- shell-script -*- + +_wget() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + --progress) + COMPREPLY=( $( compgen -W 'bar dot' -- "$cur" ) ) + return + ;; + --bind-address) + _ip_addresses "$cur" + return + ;; + -D|--domains|--exclude-domains) + _known_hosts_real "$cur" + return + ;; + --restrict-file-names) + local excludes=() + case $cur in + *unix*|*windows*) + excludes=( windows unix ) + ;;& + *lowercase*|*uppercase*) + excludes+=( lowercase uppercase ) + ;;& + *nocontrol*) + excludes+=( nocontrol ) + ;;& + *ascii*) + excludes+=( ascii ) + ;; + esac + local excludes_str=$( export IFS='|'; echo "${excludes[*]}"; ) + + # prevopt is the previous options string used as a prefix + # to avoid COMPREPLY replacing them with the $lastopt completion + local lastopt=${cur/*,} prevopt= + [[ $cur == *,* ]] && prevopt=${cur%,*}, + + COMPREPLY=( $( compgen -P "$prevopt" -X "@($excludes_str)" \ + -W 'unix windows nocontrol ascii lowercase uppercase' \ + -- "$lastopt" ) ) + + # +o nospace when no more valid option is possible (= append a space) + local opt_as_arr=( $( echo ${COMPREPLY[0]//,/ } ) ) + [[ ${#opt_as_arr[@]} -lt 4 ]] && compopt -o nospace + return + ;; + --prefer-family) + COMPREPLY=( $( compgen -W 'IPv4 IPv6 none' -- "$cur" ) ) + return + ;; + -P|--directory-prefix|--ca-directory|--warc-tempdir) + _filedir -d + return + ;; + -o|--output-file|-a|--append-output|--config|--load-cookies|\ + --save-cookies|--post-file|--certificate|--ca-certificate|\ + --private-key|--random-file|--egd-file|--warc-file|--warc-dedup) + _filedir + return + ;; + -O|--output-document|-i|--input-file) + _filedir && [[ $cur == - || -z $cur ]] && COMPREPLY+=( - ) + return + ;; + --secure-protocol) + COMPREPLY=( $( compgen -W 'auto SSLv2 SSLv3 TLSv1' -- "$cur" ) ) + return + ;; + --certificate-type|--private-key-type) + COMPREPLY=( $( compgen -W 'PEM DER' -- "$cur" ) ) + return + ;; + --follow-tags|--ignore-tags) + local lastopt=${cur/*,} prevopt= + [[ $cur == *,* ]] && prevopt=${cur%,*}, + + COMPREPLY=( $( compgen -P "$prevopt" -W 'a abbr acronym address + applet area b base basefont bdo big blockquote body br button + caption center cite code col colgroup dd del dir div dfn dl dt + em fieldset font form frame frameset h6 head hr html i iframe + img input ins isindex kbd label legend li link map menu meta + noframes noscript object ol optgroup option p param pre q s + samp script select small span strike strong style sub sup table + tbody td textarea tfoot th thead title tr tt u ul var xmp' \ + -- "$lastopt" ) ) + return + ;; + -t|--tries|-T|--timeout|--dns-timeout|--connect-timeout|--read-timeout|\ + -w|--wait|--waitretry|--cut-dirs|--max-redirect|-l|--level) + # expect integer number + COMPREPLY+=( $( compgen -P "$cur" -W "{0..9}" ) ) + compopt -o nospace + return + ;; + -Q|--quota|--limit-rate|--warc-max-size) + # expect size + if [[ $cur == *@(k|m) ]]; then + COMPREPLY=( $( compgen -W "$cur" ) ) + elif [[ $cur ]]; then + COMPREPLY=( $( compgen -P "$cur" -W "{0..9} k m" ) ) + compopt -o nospace + else + COMPREPLY=( $( compgen -W "{0..9}" ) ) + compopt -o nospace + fi + return + ;; + --user|--http-user|--proxy-user|--ftp-user) + COMPREPLY=( $( compgen -W "$( sed -n \ + '/^login/s/^[[:blank:]]*login[[:blank:]]//p' ~/.netrc \ + 2>/dev/null )" -- "$cur" ) ) + return + ;; + --header) + COMPREPLY=( $( compgen -W 'Accept Accept-Charset Accept-Encoding + Accept-Language Accept-Ranges Age Allow Authorization + Cache-Control Connection Content-Encoding Content-Language + Content-Length Content-Location Content-MD5 Content-Range + Content-Type Date ETag Expect Expires From Host If-Match + If-Modified-Since If-None-Match If-Range If-Unmodified-Since + Last-Modified Location Max-Forwards Pragma Proxy-Authenticate + Proxy-Authorization Range Referer Retry-After Server TE Trailer + Transfer-Encoding Upgrade User-Agent Vary Via Warning + WWW-Authenticate' -- "$cur" ) ) + compopt -o nospace + return + ;; + --local-encoding|--remote-encoding) + type -P xauth &>/dev/null && \ + COMPREPLY=( $( compgen -W '$( iconv -l 2>/dev/null | \ + sed -e "s@/*\$@@" -e "s/[,()]//g" 2>/dev/null )' -- "$cur" ) ) + return + ;; + -e|--execute) + return # TODO base=STR + ;; + -nv|--report-speed) + COMPREPLY=( $( compgen -W 'bits' -- "$cur" ) ) + return + ;; + -B|--base|--password|--ftp-password|--http-password|--proxy-password|\ + --default-page|--referer|-U|--user-agent|--post-data|--warc-header|-A|\ + --accept|-R|--reject|-I|--include-directories|-X|--exclude-directories) + # argument required but no completions available + return + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + fi + +} && complete -F _wget wget + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/wine b/completions/wine index c02c97f0..8cdc9146 100644 --- a/completions/wine +++ b/completions/wine @@ -10,7 +10,7 @@ _wine() COMPREPLY=( $( compgen -W '--help --version' -- "$cur" ) ) [[ $COMPREPLY ]] && return fi - _filedir '[eE][xX][eE]?(.[sS][oO])|[cC][oO][mM]|[sS][cC][rR]' + _filedir '@([eE][xX][eE]?(.[sS][oO])|[cC][oO][mM]|[sS][cC][rR]|[mM][sS][iI])' else _filedir fi diff --git a/completions/withlist b/completions/withlist index a48d7ea5..4aaad602 100644 --- a/completions/withlist +++ b/completions/withlist @@ -6,8 +6,8 @@ _withlist() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--lock --interactive \ - --run --all --quiet --help' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '--lock --interactive --run --all --quiet + --help' -- "$cur" ) ) else _xfunc list_lists _mailman_lists fi diff --git a/completions/wol b/completions/wol index 02030aba..ce1b7c50 100644 --- a/completions/wol +++ b/completions/wol @@ -11,9 +11,11 @@ _wol() ;; -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' ) ) + local PATH=$PATH:/sbin + COMPREPLY=( $( { ip addr show || ifconfig -a; } 2>/dev/null | \ + sed -ne 's/.*[[:space:]]Bcast:\([^[:space:]]*\).*/\1/p' -ne \ + 's/.*inet.*[[:space:]]brd[[:space:]]\([^[:space:]]*\).*/\1/p' -ne \ + 's/.*[[:space:]]broadcast[[:space:]]\{1,\}\([^[:space:]]*\).*/\1/p' ) ) _known_hosts_real "$cur" return 0 ;; diff --git a/completions/wsimport b/completions/wsimport new file mode 100644 index 00000000..91504844 --- /dev/null +++ b/completions/wsimport @@ -0,0 +1,49 @@ +# wsimport(1) completion -*- shell-script -*- + +_wsimport() +{ + local cur prev words cword + _init_completion -n : || return + + case $prev in + -help|-version|-B|-p|-wsdllocation) + return + ;; + -b) + _filedir '@(xml|xjb)' + return + ;; + -catalog) + _filedir '@(xml|soc|catalog)' + return + ;; + -d|–s) + _filedir -d + return + ;; + -target) + COMPREPLY=( $( compgen -W '2.0 2.1 2.2' -- "$cur" ) ) + return + ;; + -clientjar) + _filedir jar + return + ;; + esac + + if [[ $cur == -httpproxy:* ]]; then + _known_hosts_real "${cur#-httpproxy:}" + return + elif [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help )' \ + -- "$cur" ) ) + [[ $COMPREPLY == *: ]] && compopt -o nospace + __ltrim_colon_completions "$cur" + return + fi + + _filedir wsdl +} && +complete -F _wsimport wsimport + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/xfreerdp b/completions/xfreerdp index 0dfb8537..f0188446 100644 --- a/completions/xfreerdp +++ b/completions/xfreerdp @@ -16,7 +16,7 @@ _xfreerdp() return 0 ;; -x) - COMPREPLY=( $( compgen -W 'b broadband m modem l lan' -- $cur ) ) + COMPREPLY=( $( compgen -W 'b broadband m modem l lan' -- "$cur" ) ) return 0 ;; --plugin) @@ -26,8 +26,8 @@ _xfreerdp() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '-u -d -s -c -p -n -t -g -a -z -f -x -O -o \ - -k --kbd-list -h --plugin --data' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '-u -d -s -c -p -n -t -g -a -z -f -x -O -o -k + --kbd-list -h --plugin --data' -- "$cur" ) ) else _known_hosts_real "$cur" fi diff --git a/completions/xm b/completions/xm index 37bd3d02..e3ae9796 100644 --- a/completions/xm +++ b/completions/xm @@ -2,14 +2,14 @@ _xen_domain_names() { - COMPREPLY=( $(compgen -W "$( xm list 2>/dev/null | \ - awk '!/Name|Domain-0/ { print $1 }' )" -- "$cur") ) + COMPREPLY=( $( compgen -W "$( xm list 2>/dev/null | \ + awk '!/Name|Domain-0/ { print $1 }' )" -- "$cur" ) ) } _xen_domain_ids() { - COMPREPLY=( $(compgen -W "$( xm list 2>/dev/null | \ - awk '!/Name|Domain-0/ { print $2 }' )" -- "$cur") ) + COMPREPLY=( $( compgen -W "$( xm list 2>/dev/null | \ + awk '!/Name|Domain-0/ { print $2 }' )" -- "$cur" ) ) } _xm() @@ -21,16 +21,16 @@ _xm() local command options - commands='console vncviewer create new delete destroy domid domname \ - dump-core list mem-max mem-set migrate pause reboot rename reset \ - restore resume save shutdown start suspend sysrq trigger top unpause \ - uptime usb-add usb-del vcpu-list vcpu-pin vcpu-set debug-keys dmesg \ - info log serve sched-credit sched-sedf block-attach block-detach \ - block-list block-configure network-attach network-detach network-list \ - vtpm-list pci-attach pci-detach pci-list pci-list-assignable-devices \ - scsi-attach scsi-detach scsi-list vnet-list vnet-create vnet-delete \ - labels addlabel rmlabel getlabel dry-run resources dumppolicy \ - setpolicy resetpolicy getpolicy shell help' + commands='console vncviewer create new delete destroy domid domname + dump-core list mem-max mem-set migrate pause reboot rename reset + restore resume save shutdown start suspend sysrq trigger top unpause + uptime usb-add usb-del vcpu-list vcpu-pin vcpu-set debug-keys dmesg + info log serve sched-credit sched-sedf block-attach block-detach + block-list block-configure network-attach network-detach network-list + vtpm-list pci-attach pci-detach pci-list pci-list-assignable-devices + scsi-attach scsi-detach scsi-list vnet-list vnet-create vnet-delete + labels addlabel rmlabel getlabel dry-run resources dumppolicy setpolicy + resetpolicy getpolicy shell help' if [[ $cword -eq 1 ]] ; then COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) @@ -69,12 +69,9 @@ _xm() options='--dumpxml' ;; new) - options='-h --help --help_config -q \ - --quiet --path= -f= \ - --defconfig= -F= --config= \ - -b --dryrun -x --xmldryrun \ - -s --skipdtd -p --paused -c \ - --console_autoconnect' + options='-h --help --help_config -q --quiet --path= -f= + --defconfig= -F= --config= -b --dryrun -x --xmldryrun + -s --skipdtd -p --paused -c --console_autoconnect' ;; esac COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) @@ -122,7 +119,8 @@ _xm() _xen_domain_names ;; 3) - COMPREPLY=( $(compgen -W "r s e i u b" -- "$cur") ) + COMPREPLY=( $( compgen -W "r s e i u b" \ + -- "$cur" ) ) ;; esac ;; @@ -133,10 +131,11 @@ _xm() _xen_domain_names ;; 3) - COMPREPLY=( $(compgen -W "phy: file:" -- "$cur") ) + COMPREPLY=( $( compgen -W "phy: file:" \ + -- "$cur" ) ) ;; 5) - COMPREPLY=( $(compgen -W "w r" -- "$cur") ) + COMPREPLY=( $( compgen -W "w r" -- "$cur" ) ) ;; 6) _xen_domain_names @@ -150,9 +149,9 @@ _xm() _xen_domain_names ;; 3) - COMPREPLY=( $(compgen -W "$( xm block-list $prev \ + COMPREPLY=( $( compgen -W "$( xm block-list $prev \ 2>/dev/null | awk '!/Vdev/ { print $1 }' )" \ - -- "$cur") ) + -- "$cur" ) ) ;; esac ;; @@ -163,8 +162,8 @@ _xm() _xen_domain_names ;; *) - COMPREPLY=( $(compgen -W "script= ip= mac= \ - bridge= backend=" -- "$cur") ) + COMPREPLY=( $( compgen -W "script= ip= mac= bridge= + backend=" -- "$cur" ) ) ;; esac ;; @@ -177,7 +176,7 @@ _xm() 3) COMPREPLY=( $(compgen -W "$( xm network-list $prev \ 2>/dev/null | awk '!/Idx/ { print $1 }' )" \ - -- "$cur") ) + -- "$cur" ) ) ;; esac ;; diff --git a/completions/xmlwf b/completions/xmlwf index 6b7ad1ba..15206134 100644 --- a/completions/xmlwf +++ b/completions/xmlwf @@ -11,8 +11,8 @@ _xmlwf() return 0 ;; -e) - COMPREPLY=( $( compgen -W 'US-ASCII UTF-8 UTF-16 \ - ISO-8859-1' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'US-ASCII UTF-8 UTF-16 ISO-8859-1' \ + -- "$cur" ) ) return 0 ;; -v) diff --git a/completions/xrandr b/completions/xrandr index 332be812..cef0941e 100644 --- a/completions/xrandr +++ b/completions/xrandr @@ -5,24 +5,31 @@ _xrandr() local cur prev words cword _init_completion || return - local output modes - case "$prev" in + -display|-d|-help|-s|--size|-r|--rate|--refresh|--screen|--fb|--fbmm|\ + --dpi|--pos|--set|--scale|--transform|--crtc|--panning|--gamma|\ + --newmode|--rmmode|--addmode|--delmode) + return + ;; --output|--left-of|--right-of|--above|--below|--same-as) local outputs=$( xrandr | awk '/connected/ {print $1}' ) COMPREPLY=( $( compgen -W "$outputs" -- "$cur" ) ) return ;; --mode) - for(( i = 1; i < cword; i++ )); do + local i output + for (( i=1; i < cword; i++ )); do if [[ "${words[i]}" == --output ]]; then output=${words[i+1]} break fi done - modes=$( xrandr | sed -e "1,/$output/ d" \ - -e "/connected/,$ d" | awk '{print $1}' ) - COMPREPLY=( $( compgen -W "$modes" -- "$cur" ) ) + if [[ $output ]]; then + local modes=$( xrandr | sed -e "1,/$output/ d" \ + -e "/connected/,$ d" \ + -e "s/\([^[:space:]]\)[[:space:]].*/\1/" ) + COMPREPLY=( $( compgen -W "$modes" -- "$cur" ) ) + fi return ;; -o|--orientation) @@ -40,19 +47,8 @@ _xrandr() ;; esac - case $cur in - *) - COMPREPLY=( $( compgen -W '-display -help --orientation --query - --size --rate --version -x -y --screen --verbose --dryrun - --q1 --q12 --nograb --prop --properties --fb --fbmm --dpi - --output --auto --mode --preferred --pos --rate --refresh - --reflect --rotate --left-of --right-of --above --below - --same-as --set --scale --transform --off --crtc --panning - --gamma --brightness --primary --noprimary --newmode --rmmode - --addmode --delmode' -- "$cur" ) ) - return - ;; - esac + COMPREPLY=( $( compgen -W '$( "$1" -help 2>&1 | + sed -e "s/ or / /g" -e "s/<[^>]*>]//g" | _parse_help - )' -- "$cur" ) ) } && complete -F _xrandr xrandr diff --git a/completions/xxd b/completions/xxd new file mode 100644 index 00000000..050a2b66 --- /dev/null +++ b/completions/xxd @@ -0,0 +1,23 @@ +# xxd(1) completion -*- shell-script -*- + +_xxd() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -h|-help|-c|-cols|-g|-groupsize|-l|-len|-s|-seek|-v|-version) + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + return + fi + + _filedir +} && +complete -F _xxd xxd + +# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/ypmatch b/completions/ypmatch index 584b0d04..99d80c43 100644 --- a/completions/ypmatch +++ b/completions/ypmatch @@ -13,12 +13,12 @@ _ypmatch() if [[ $cmd == ypmatch && $cword -eq 1 && ${#words[@]} -eq 3 ]]; then map=${words[2]} COMPREPLY=( $( compgen -W '$( ypcat $map 2>/dev/null | \ - cut -d':' -f 1 )' -- "$cur") ) + cut -d':' -f 1 )' -- "$cur" ) ) else [[ $cmd == ypmatch && $cword -ne 2 ]] && return 0 COMPREPLY=( $( compgen -W \ '$( printf "%s\n" $(ypcat -x 2>/dev/null | \ - cut -d"\"" -f 2) )' -- "$cur") ) + cut -d"\"" -f 2) )' -- "$cur" ) ) fi return 0 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for bash-completion 2.0. +# Generated by GNU Autoconf 2.69 for bash-completion 2.1. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -576,8 +576,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='bash-completion' PACKAGE_TARNAME='bash-completion' -PACKAGE_VERSION='2.0' -PACKAGE_STRING='bash-completion 2.0' +PACKAGE_VERSION='2.1' +PACKAGE_STRING='bash-completion 2.1' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1193,7 +1193,7 @@ if test "$ac_init_help" = "long"; then # 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 2.0 to adapt to many kinds of systems. +\`configure' configures bash-completion 2.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1259,7 +1259,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of bash-completion 2.0:";; + short | recursive ) echo "Configuration of bash-completion 2.1:";; esac cat <<\_ACEOF @@ -1326,7 +1326,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -bash-completion configure 2.0 +bash-completion configure 2.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1343,7 +1343,7 @@ cat >config.log <<_ACEOF 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 2.0, which was +It was created by bash-completion $as_me 2.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2158,7 +2158,7 @@ fi # Define the identity of the package. PACKAGE='bash-completion' - VERSION='2.0' + VERSION='2.1' cat >>confdefs.h <<_ACEOF @@ -2757,7 +2757,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # 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 2.0, which was +This file was extended by bash-completion $as_me 2.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -2810,7 +2810,7 @@ _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 2.0 +bash-completion config.status 2.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 3dd17c66..82e88ac2 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ([2.60]) -AC_INIT([bash-completion], [2.0]) +AC_INIT([bash-completion], [2.1]) AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip -Wall -Werror]) AC_PROG_LN_S AC_PROG_MKDIR_P diff --git a/doc/Makefile.in b/doc/Makefile.in index 7a6ebf4e..42551b57 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.5 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, diff --git a/helpers/Makefile.in b/helpers/Makefile.in index 3288374f..04ccc164 100644 --- a/helpers/Makefile.in +++ b/helpers/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.5 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2009-04-28.21; # UTC +scriptversion=2011-01-19.21; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -156,6 +156,10 @@ while test $# -ne 0; do -s) stripcmd=$stripprog;; -t) dst_arg=$2 + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac shift;; -T) no_target_directory=true;; @@ -186,6 +190,10 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then fi shift # arg dst_arg=$arg + # Protect names problematic for `test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac done fi @@ -200,7 +208,11 @@ if test $# -eq 0; then fi if test -z "$dir_arg"; then - trap '(exit $?); exit' 1 2 13 15 + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. @@ -228,9 +240,9 @@ fi for src do - # Protect names starting with `-'. + # Protect names problematic for `test' and other utilities. case $src in - -*) src=./$src;; + -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then @@ -252,12 +264,7 @@ do echo "$0: no destination specified." >&2 exit 1 fi - dst=$dst_arg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst;; - esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. @@ -385,7 +392,7 @@ do case $dstdir in /*) prefix='/';; - -*) prefix='./';; + [-=\(\)!]*) prefix='./';; *) prefix='';; esac @@ -403,7 +410,7 @@ do for d do - test -z "$d" && continue + test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then @@ -1,10 +1,10 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2009-04-28.21; # UTC +scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009 Free Software Foundation, Inc. +# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996. # This program is free software; you can redistribute it and/or modify @@ -84,7 +84,6 @@ Supported PROGRAM values: help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and @@ -122,15 +121,6 @@ case $1 in # Not GNU programs, they don't have --version. ;; - tar*) - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - exit 1 - fi - ;; - *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. @@ -226,7 +216,7 @@ WARNING: \`$1' $msg. You should only need it if \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then - eval LASTARG="\${$#}" + eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` @@ -256,7 +246,7 @@ WARNING: \`$1' is $msg. You should only need it if \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then - eval LASTARG="\${$#}" + eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` @@ -318,41 +308,6 @@ WARNING: \`$1' is $msg. You should only need it if touch $file ;; - tar*) - shift - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case $firstarg in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case $firstarg in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. diff --git a/test/Makefile.in b/test/Makefile.in index 337f7425..5cdd4f51 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.11.5 from Makefile.am. +# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, diff --git a/test/completion/chronyc.exp b/test/completion/chronyc.exp new file mode 100644 index 00000000..9f7d8216 --- /dev/null +++ b/test/completion/chronyc.exp @@ -0,0 +1 @@ +assert_source_completions chronyc diff --git a/test/completion/eject.exp b/test/completion/eject.exp new file mode 100644 index 00000000..5f02e2ae --- /dev/null +++ b/test/completion/eject.exp @@ -0,0 +1 @@ +assert_source_completions eject diff --git a/test/completion/eog.exp b/test/completion/eog.exp new file mode 100644 index 00000000..bba23491 --- /dev/null +++ b/test/completion/eog.exp @@ -0,0 +1 @@ +assert_source_completions eog diff --git a/test/completion/file-roller.exp b/test/completion/file-roller.exp new file mode 100644 index 00000000..2208ba14 --- /dev/null +++ b/test/completion/file-roller.exp @@ -0,0 +1 @@ +assert_source_completions file-roller diff --git a/test/completion/genisoimage.exp b/test/completion/genisoimage.exp new file mode 100644 index 00000000..de3be5ba --- /dev/null +++ b/test/completion/genisoimage.exp @@ -0,0 +1 @@ +assert_source_completions genisoimage diff --git a/test/completion/gphoto2.exp b/test/completion/gphoto2.exp new file mode 100644 index 00000000..1eab94b0 --- /dev/null +++ b/test/completion/gphoto2.exp @@ -0,0 +1 @@ +assert_source_completions gphoto2 diff --git a/test/completion/hexdump.exp b/test/completion/hexdump.exp new file mode 100644 index 00000000..7bdc0d36 --- /dev/null +++ b/test/completion/hexdump.exp @@ -0,0 +1 @@ +assert_source_completions hexdump diff --git a/test/completion/interdiff.exp b/test/completion/interdiff.exp new file mode 100644 index 00000000..97bbbdeb --- /dev/null +++ b/test/completion/interdiff.exp @@ -0,0 +1 @@ +assert_source_completions interdiff diff --git a/test/completion/lua.exp b/test/completion/lua.exp new file mode 100644 index 00000000..a5774f4f --- /dev/null +++ b/test/completion/lua.exp @@ -0,0 +1 @@ +assert_source_completions lua diff --git a/test/completion/luac.exp b/test/completion/luac.exp new file mode 100644 index 00000000..63f49ee7 --- /dev/null +++ b/test/completion/luac.exp @@ -0,0 +1 @@ +assert_source_completions luac diff --git a/test/completion/luseradd.exp b/test/completion/luseradd.exp new file mode 100644 index 00000000..69b10cfe --- /dev/null +++ b/test/completion/luseradd.exp @@ -0,0 +1 @@ +assert_source_completions luseradd diff --git a/test/completion/luserdel.exp b/test/completion/luserdel.exp new file mode 100644 index 00000000..289a4c32 --- /dev/null +++ b/test/completion/luserdel.exp @@ -0,0 +1 @@ +assert_source_completions luserdel diff --git a/test/completion/lusermod.exp b/test/completion/lusermod.exp new file mode 100644 index 00000000..9ca4cecc --- /dev/null +++ b/test/completion/lusermod.exp @@ -0,0 +1 @@ +assert_source_completions lusermod diff --git a/test/completion/mussh.exp b/test/completion/mussh.exp new file mode 100644 index 00000000..1232287c --- /dev/null +++ b/test/completion/mussh.exp @@ -0,0 +1 @@ +assert_source_completions mussh diff --git a/test/completion/nc.exp b/test/completion/nc.exp new file mode 100644 index 00000000..a5c06b2d --- /dev/null +++ b/test/completion/nc.exp @@ -0,0 +1 @@ +assert_source_completions nc diff --git a/test/completion/ngrep.exp b/test/completion/ngrep.exp new file mode 100644 index 00000000..3ad711b1 --- /dev/null +++ b/test/completion/ngrep.exp @@ -0,0 +1 @@ +assert_source_completions ngrep diff --git a/test/completion/nmcli.exp b/test/completion/nmcli.exp new file mode 100644 index 00000000..816468f7 --- /dev/null +++ b/test/completion/nmcli.exp @@ -0,0 +1 @@ +assert_source_completions nmcli diff --git a/test/completion/opera.exp b/test/completion/opera.exp new file mode 100644 index 00000000..9ab6a08f --- /dev/null +++ b/test/completion/opera.exp @@ -0,0 +1 @@ +assert_source_completions opera diff --git a/test/completion/pkg-get.exp b/test/completion/pkg-get.exp new file mode 100644 index 00000000..4499142f --- /dev/null +++ b/test/completion/pkg-get.exp @@ -0,0 +1 @@ +assert_source_completions pkg-get diff --git a/test/completion/pkgadd.exp b/test/completion/pkgadd.exp new file mode 100644 index 00000000..128c823e --- /dev/null +++ b/test/completion/pkgadd.exp @@ -0,0 +1 @@ +assert_source_completions pkgadd diff --git a/test/completion/pkgrm.exp b/test/completion/pkgrm.exp new file mode 100644 index 00000000..e94337ae --- /dev/null +++ b/test/completion/pkgrm.exp @@ -0,0 +1 @@ +assert_source_completions pkgrm diff --git a/test/completion/pkgutil.exp b/test/completion/pkgutil.exp new file mode 100644 index 00000000..b4d152ec --- /dev/null +++ b/test/completion/pkgutil.exp @@ -0,0 +1 @@ +assert_source_completions pkgutil diff --git a/test/completion/pydoc.exp b/test/completion/pydoc.exp new file mode 100644 index 00000000..9555e850 --- /dev/null +++ b/test/completion/pydoc.exp @@ -0,0 +1 @@ +assert_source_completions pydoc diff --git a/test/completion/pylint.exp b/test/completion/pylint.exp new file mode 100644 index 00000000..d5a993de --- /dev/null +++ b/test/completion/pylint.exp @@ -0,0 +1 @@ +assert_source_completions pylint diff --git a/test/completion/ss.exp b/test/completion/ss.exp new file mode 100644 index 00000000..f8703884 --- /dev/null +++ b/test/completion/ss.exp @@ -0,0 +1 @@ +assert_source_completions ss diff --git a/test/completion/strings.exp b/test/completion/strings.exp new file mode 100644 index 00000000..a5c544a2 --- /dev/null +++ b/test/completion/strings.exp @@ -0,0 +1 @@ +assert_source_completions strings diff --git a/test/completion/svcadm.exp b/test/completion/svcadm.exp new file mode 100644 index 00000000..f96d46dc --- /dev/null +++ b/test/completion/svcadm.exp @@ -0,0 +1 @@ +assert_source_completions svcadm diff --git a/test/completion/tshark.exp b/test/completion/tshark.exp new file mode 100644 index 00000000..885fae32 --- /dev/null +++ b/test/completion/tshark.exp @@ -0,0 +1 @@ +assert_source_completions tshark diff --git a/test/completion/udevadm.exp b/test/completion/udevadm.exp deleted file mode 100644 index 69c980ff..00000000 --- a/test/completion/udevadm.exp +++ /dev/null @@ -1 +0,0 @@ -assert_source_completions udevadm diff --git a/test/completion/vpnc.exp b/test/completion/vpnc.exp new file mode 100644 index 00000000..29511b59 --- /dev/null +++ b/test/completion/vpnc.exp @@ -0,0 +1 @@ +assert_source_completions vpnc diff --git a/test/completion/wsimport.exp b/test/completion/wsimport.exp new file mode 100644 index 00000000..3f889e26 --- /dev/null +++ b/test/completion/wsimport.exp @@ -0,0 +1 @@ +assert_source_completions wsimport diff --git a/test/completion/xxd.exp b/test/completion/xxd.exp new file mode 100644 index 00000000..d9750e40 --- /dev/null +++ b/test/completion/xxd.exp @@ -0,0 +1 @@ +assert_source_completions xxd diff --git a/test/fixtures/man/man/quux.8 b/test/fixtures/man/man/quux.8 new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/fixtures/man/man/quux.8 diff --git a/test/lib/completions/chronyc.exp b/test/lib/completions/chronyc.exp new file mode 100644 index 00000000..33458113 --- /dev/null +++ b/test/lib/completions/chronyc.exp @@ -0,0 +1,21 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "chronyc -" +sync_after_int + +assert_complete_any "chronyc " +sync_after_int + + +teardown diff --git a/test/lib/completions/udevadm.exp b/test/lib/completions/eject.exp index bef16f0b..8de109d4 100644 --- a/test/lib/completions/udevadm.exp +++ b/test/lib/completions/eject.exp @@ -11,9 +11,7 @@ proc teardown {} { setup -assert_complete_any "udevadm " - - +assert_complete_any "eject -" sync_after_int diff --git a/test/lib/completions/eog.exp b/test/lib/completions/eog.exp new file mode 100644 index 00000000..b708c564 --- /dev/null +++ b/test/lib/completions/eog.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "eog " +sync_after_int + + +teardown diff --git a/test/lib/completions/file-roller.exp b/test/lib/completions/file-roller.exp new file mode 100644 index 00000000..942941d0 --- /dev/null +++ b/test/lib/completions/file-roller.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "file-roller " +sync_after_int + + +teardown diff --git a/test/lib/completions/genisoimage.exp b/test/lib/completions/genisoimage.exp new file mode 100644 index 00000000..5379f047 --- /dev/null +++ b/test/lib/completions/genisoimage.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "genisoimage " +sync_after_int + + +teardown diff --git a/test/lib/completions/gphoto2.exp b/test/lib/completions/gphoto2.exp new file mode 100644 index 00000000..90dc1e5e --- /dev/null +++ b/test/lib/completions/gphoto2.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "gphoto2 --" +sync_after_int + + +teardown diff --git a/test/lib/completions/hexdump.exp b/test/lib/completions/hexdump.exp new file mode 100644 index 00000000..e3447482 --- /dev/null +++ b/test/lib/completions/hexdump.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "hexdump -" +sync_after_int + + +teardown diff --git a/test/lib/completions/interdiff.exp b/test/lib/completions/interdiff.exp new file mode 100644 index 00000000..8880f461 --- /dev/null +++ b/test/lib/completions/interdiff.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "interdiff " +sync_after_int + + +teardown diff --git a/test/lib/completions/lua.exp b/test/lib/completions/lua.exp new file mode 100644 index 00000000..864b1bfc --- /dev/null +++ b/test/lib/completions/lua.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "lua " +sync_after_int + + +teardown diff --git a/test/lib/completions/luac.exp b/test/lib/completions/luac.exp new file mode 100644 index 00000000..d7cfb23b --- /dev/null +++ b/test/lib/completions/luac.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "luac " +sync_after_int + + +teardown diff --git a/test/lib/completions/luseradd.exp b/test/lib/completions/luseradd.exp new file mode 100644 index 00000000..744314a7 --- /dev/null +++ b/test/lib/completions/luseradd.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "luseradd -" +sync_after_int + + +teardown diff --git a/test/lib/completions/luserdel.exp b/test/lib/completions/luserdel.exp new file mode 100644 index 00000000..70d11661 --- /dev/null +++ b/test/lib/completions/luserdel.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "luserdel " +sync_after_int + + +teardown diff --git a/test/lib/completions/lusermod.exp b/test/lib/completions/lusermod.exp new file mode 100644 index 00000000..f96293e6 --- /dev/null +++ b/test/lib/completions/lusermod.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "lusermod " +sync_after_int + + +teardown diff --git a/test/lib/completions/man.exp b/test/lib/completions/man.exp index c7358c62..66b565a2 100644 --- a/test/lib/completions/man.exp +++ b/test/lib/completions/man.exp @@ -30,4 +30,8 @@ assert_complete "Bash::Completion" "man Bash::C" sync_after_int +assert_complete_dir "man/quux.8" "man man/" $::srcdir/fixtures/man +sync_after_int + + teardown diff --git a/test/lib/completions/mussh.exp b/test/lib/completions/mussh.exp new file mode 100644 index 00000000..24c5c1f1 --- /dev/null +++ b/test/lib/completions/mussh.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "mussh -" +sync_after_int + + +teardown diff --git a/test/lib/completions/nc.exp b/test/lib/completions/nc.exp new file mode 100644 index 00000000..84e61896 --- /dev/null +++ b/test/lib/completions/nc.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "nc -" +sync_after_int + + +teardown diff --git a/test/lib/completions/ncftp.exp b/test/lib/completions/ncftp.exp index 52d70756..d6683b86 100644 --- a/test/lib/completions/ncftp.exp +++ b/test/lib/completions/ncftp.exp @@ -12,8 +12,10 @@ setup assert_complete_any "ncftp " +sync_after_int +assert_complete_any "ncftp -" sync_after_int diff --git a/test/lib/completions/ngrep.exp b/test/lib/completions/ngrep.exp new file mode 100644 index 00000000..a49543bb --- /dev/null +++ b/test/lib/completions/ngrep.exp @@ -0,0 +1,21 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "ngrep -" +sync_after_int + +assert_complete_any "ngrep -d " +sync_after_int + + +teardown diff --git a/test/lib/completions/nmcli.exp b/test/lib/completions/nmcli.exp new file mode 100644 index 00000000..b891f45e --- /dev/null +++ b/test/lib/completions/nmcli.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "nmcli " +sync_after_int + + +teardown diff --git a/test/lib/completions/opera.exp b/test/lib/completions/opera.exp new file mode 100644 index 00000000..9b666403 --- /dev/null +++ b/test/lib/completions/opera.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "opera " +sync_after_int + + +teardown diff --git a/test/lib/completions/pkg-get.exp b/test/lib/completions/pkg-get.exp new file mode 100644 index 00000000..38b2b97f --- /dev/null +++ b/test/lib/completions/pkg-get.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "pkg-get " +sync_after_int + + +teardown diff --git a/test/lib/completions/pkgadd.exp b/test/lib/completions/pkgadd.exp new file mode 100644 index 00000000..ba5eadf9 --- /dev/null +++ b/test/lib/completions/pkgadd.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "pkgadd " +sync_after_int + + +teardown diff --git a/test/lib/completions/pkgrm.exp b/test/lib/completions/pkgrm.exp new file mode 100644 index 00000000..08c685c4 --- /dev/null +++ b/test/lib/completions/pkgrm.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "pkgrm " +sync_after_int + + +teardown diff --git a/test/lib/completions/pkgutil.exp b/test/lib/completions/pkgutil.exp new file mode 100644 index 00000000..e79dea15 --- /dev/null +++ b/test/lib/completions/pkgutil.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "pkgutil " +sync_after_int + + +teardown diff --git a/test/lib/completions/pwd.exp b/test/lib/completions/pwd.exp index f40fdb99..3690076a 100644 --- a/test/lib/completions/pwd.exp +++ b/test/lib/completions/pwd.exp @@ -11,7 +11,7 @@ proc teardown {} { setup -assert_no_complete "pwd " +assert_complete_any "pwd -" sync_after_int diff --git a/test/lib/completions/pydoc.exp b/test/lib/completions/pydoc.exp new file mode 100644 index 00000000..fe573693 --- /dev/null +++ b/test/lib/completions/pydoc.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "pydoc r" +sync_after_int + + +teardown diff --git a/test/lib/completions/pylint.exp b/test/lib/completions/pylint.exp new file mode 100644 index 00000000..62774220 --- /dev/null +++ b/test/lib/completions/pylint.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "pylint -" +sync_after_int + + +teardown diff --git a/test/lib/completions/ss.exp b/test/lib/completions/ss.exp new file mode 100644 index 00000000..f6e711c6 --- /dev/null +++ b/test/lib/completions/ss.exp @@ -0,0 +1,21 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "ss -" +sync_after_int + +assert_complete_any "ss -A " +sync_after_int + + +teardown diff --git a/test/lib/completions/strings.exp b/test/lib/completions/strings.exp new file mode 100644 index 00000000..103d5d3a --- /dev/null +++ b/test/lib/completions/strings.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "strings " +sync_after_int + + +teardown diff --git a/test/lib/completions/svcadm.exp b/test/lib/completions/svcadm.exp new file mode 100644 index 00000000..e7266146 --- /dev/null +++ b/test/lib/completions/svcadm.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "svcadm " +sync_after_int + + +teardown diff --git a/test/lib/completions/tshark.exp b/test/lib/completions/tshark.exp new file mode 100644 index 00000000..f2419119 --- /dev/null +++ b/test/lib/completions/tshark.exp @@ -0,0 +1,21 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "tshark -" +sync_after_int + +assert_complete_any "tshark -G " +sync_after_int + + +teardown diff --git a/test/lib/completions/vpnc.exp b/test/lib/completions/vpnc.exp new file mode 100644 index 00000000..451d8093 --- /dev/null +++ b/test/lib/completions/vpnc.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "vpnc -" +sync_after_int + + +teardown diff --git a/test/lib/completions/wget.exp b/test/lib/completions/wget.exp index 8e830a12..457ae2ce 100644 --- a/test/lib/completions/wget.exp +++ b/test/lib/completions/wget.exp @@ -17,4 +17,10 @@ assert_complete_any "wget --" sync_after_int +assert_no_complete "wget " + + +sync_after_int + + teardown diff --git a/test/lib/completions/wsimport.exp b/test/lib/completions/wsimport.exp new file mode 100644 index 00000000..36bf35c1 --- /dev/null +++ b/test/lib/completions/wsimport.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "wsimport " +sync_after_int + + +teardown diff --git a/test/lib/completions/xrandr.exp b/test/lib/completions/xrandr.exp index 14beb762..e76a5665 100644 --- a/test/lib/completions/xrandr.exp +++ b/test/lib/completions/xrandr.exp @@ -12,8 +12,9 @@ setup assert_complete_any "xrandr " +sync_after_int - +assert_no_complete "xrandr --mode " sync_after_int diff --git a/test/lib/completions/xxd.exp b/test/lib/completions/xxd.exp new file mode 100644 index 00000000..6f12c0c0 --- /dev/null +++ b/test/lib/completions/xxd.exp @@ -0,0 +1,18 @@ +proc setup {} { + save_env +} + + +proc teardown {} { + assert_env_unmodified +} + + +setup + + +assert_complete_any "xxd " +sync_after_int + + +teardown diff --git a/test/unit/_filedir.exp b/test/unit/_filedir.exp index b8cc2009..a736e6ed 100644 --- a/test/unit/_filedir.exp +++ b/test/unit/_filedir.exp @@ -88,8 +88,7 @@ foreach name {f f2} { set test "completing $name a\\\$b/ should return h" set cmd "$name a\\\$b/" - assert_complete_dir "\b\b\b\b\b$::srcdirabs/fixtures/_filedir/a\\\\\$b/h" \ - $cmd "$::srcdir/fixtures/_filedir" $test + assert_complete_dir h $cmd "$::srcdir/fixtures/_filedir" $test sync_after_int @@ -199,7 +198,7 @@ foreach name {f f2} { set cmd "$name \"a\\\$b/"; #" - assert_complete_dir "\b\b\b\b\b$::srcdirabs/fixtures/_filedir/a\\\\\$b/h\\\"" $cmd "$::srcdir/fixtures/_filedir" + assert_complete_dir {h"} $cmd "$::srcdir/fixtures/_filedir"; #" sync_after_int |