From 059a87a5936cfebfd2d71ab8057002cafb2ea051 Mon Sep 17 00:00:00 2001 From: David Paleino Date: Mon, 4 Nov 2013 17:58:57 +0100 Subject: Imported Upstream version 2.1 --- AUTHORS | 1 + CHANGES | 174 +++++++++++++++++++++++++- Makefile.in | 4 +- aclocal.m4 | 6 +- bash_completion | 100 ++++++++------- completions/Makefile.am | 63 +++++++++- completions/Makefile.in | 65 +++++++++- completions/_mock | 2 +- completions/_subversion | 26 ++-- completions/_udevadm | 79 ++++++++++++ completions/_yum | 33 ++--- completions/acpi | 3 +- completions/add_members | 7 +- completions/apt-build | 10 +- completions/apt-cache | 18 ++- completions/apt-get | 23 ++-- completions/aptitude | 23 ++-- completions/arch | 6 +- completions/arpspoof | 2 +- completions/aspell | 46 ++++--- completions/autorpm | 2 +- completions/brctl | 7 +- completions/btdownloadheadless.py | 14 +-- completions/cardctl | 4 +- completions/cfrun | 2 +- completions/change_pw | 4 +- completions/chgrp | 6 +- completions/chown | 4 +- completions/chpasswd | 7 +- completions/chronyc | 69 +++++++++++ completions/cleanarch | 4 +- completions/clisp | 6 +- completions/clone_member | 4 +- completions/complete | 10 +- completions/config_list | 4 +- completions/convert | 88 +++++++------ completions/cpio | 67 ++++------ completions/cppcheck | 9 +- completions/cryptsetup | 6 +- completions/cvs | 8 +- completions/dhclient | 4 +- completions/dmesg | 9 +- completions/dnsspoof | 2 +- completions/dpkg | 2 +- completions/dselect | 8 +- completions/dsniff | 6 +- completions/dumpdb | 4 +- completions/eject | 30 +++++ completions/eog | 27 ++++ completions/ether-wake | 2 +- completions/evince | 2 +- completions/feh | 4 +- completions/file-roller | 41 ++++++ completions/filesnarf | 2 +- completions/find | 25 ++-- completions/find_member | 4 +- completions/fusermount | 4 +- completions/gcl | 4 +- completions/genisoimage | 32 +---- completions/getent | 4 +- completions/gkrellm | 5 +- completions/gnatmake | 19 ++- completions/gpg | 6 +- completions/gpg2 | 4 +- completions/gphoto2 | 51 ++++++++ completions/groupmems | 9 +- completions/hcitool | 63 +++++----- completions/hexdump | 29 +++++ completions/hid2hci | 4 +- completions/hwclock | 6 +- completions/installpkg | 4 +- completions/interdiff | 33 +++++ completions/ip | 35 +++++- completions/ipsec | 33 +++-- completions/iptables | 24 ++-- completions/ipv6calc | 15 ++- completions/iwconfig | 8 +- completions/iwlist | 6 +- completions/jar | 2 +- completions/jarsigner | 6 +- completions/kcov | 21 +++- completions/koji | 15 ++- completions/ktutil | 10 +- completions/larch | 2 +- completions/lastlog | 7 +- completions/ldapvi | 9 +- completions/lilo | 8 +- completions/links | 12 +- completions/lintian | 23 ++-- completions/lisp | 4 +- completions/list_lists | 4 +- completions/list_members | 8 +- completions/list_owners | 4 +- completions/lua | 23 ++++ completions/luac | 27 ++++ completions/luseradd | 40 ++++++ completions/luserdel | 23 ++++ completions/lvm | 234 ++++++++++++++++++----------------- completions/lzip | 9 +- completions/lzma | 8 +- completions/lzop | 14 +-- completions/macof | 2 +- completions/mailmanctl | 2 +- completions/make | 101 +++++++++++++-- completions/makepkg | 4 +- completions/man | 18 +-- completions/mdadm | 61 +++++---- completions/mdtool | 8 +- completions/mii-diag | 5 +- completions/mii-tool | 6 +- completions/minicom | 4 +- completions/modinfo | 2 +- completions/modprobe | 14 +++ completions/mount | 3 +- completions/mount.linux | 58 ++++++--- completions/mplayer | 113 +++++++++-------- completions/msynctool | 8 +- completions/munin-update | 6 +- completions/mussh | 52 ++++++++ completions/mutt | 4 +- completions/mysqladmin | 7 +- completions/nc | 48 +++++++ completions/ncftp | 11 ++ completions/ngrep | 37 ++++++ completions/nmap | 34 ++--- completions/nmcli | 199 +++++++++++++++++++++++++++++ completions/nslookup | 3 + completions/ntpdate | 2 +- completions/openssl | 137 ++++++++++---------- completions/opera | 46 +++++++ completions/p4 | 8 +- completions/pack200 | 13 +- completions/patch | 70 +++++++++++ completions/perl | 4 +- completions/pkg-config | 14 ++- completions/pkg-get | 75 +++++++++++ completions/pkgadd | 59 +++++++++ completions/pkgrm | 50 ++++++++ completions/pkgtool | 2 +- completions/pkgutil | 96 ++++++++++++++ completions/postfix | 2 +- completions/puppet | 64 +++++----- completions/pwd | 8 +- completions/pydoc | 39 ++++++ completions/pylint | 66 ++++++++++ completions/python | 12 +- completions/qemu | 21 ++-- completions/qrunner | 4 +- completions/querybts | 22 ++-- completions/rdesktop | 2 +- completions/remove_members | 2 +- completions/reportbug | 60 +++++---- completions/rpm | 52 ++++---- completions/rpmcheck | 4 +- completions/rrdtool | 2 +- completions/rsync | 53 ++++---- completions/sbopkg | 2 +- completions/screen | 4 +- completions/slackpkg | 4 +- completions/slapt-get | 2 +- completions/smartctl | 12 +- completions/smbclient | 2 +- completions/ss | 39 ++++++ completions/ssh | 80 +++++++----- completions/sshow | 2 +- completions/strace | 7 +- completions/strings | 44 +++++++ completions/svcadm | 143 +++++++++++++++++++++ completions/svk | 113 +++++++++-------- completions/sync_members | 6 +- completions/tar | 34 ++--- completions/tcpdump | 1 + completions/tcpkill | 2 +- completions/tcpnice | 2 +- completions/tshark | 105 ++++++++++++++++ completions/udevadm | 76 ------------ completions/umount.linux | 4 +- completions/unpack200 | 2 +- completions/unrar | 6 +- completions/update-alternatives | 4 +- completions/update-rc.d | 2 +- completions/urlsnarf | 2 +- completions/useradd | 7 +- completions/userdel | 10 ++ completions/usermod | 7 +- completions/valgrind | 6 + completions/vipw | 9 +- completions/vncviewer | 31 ++--- completions/vpnc | 46 +++++-- completions/wget | 164 ++++++++++++++++++++++++ completions/wine | 2 +- completions/withlist | 4 +- completions/wol | 8 +- completions/wsimport | 49 ++++++++ completions/xfreerdp | 6 +- completions/xm | 55 ++++---- completions/xmlwf | 4 +- completions/xrandr | 34 +++-- completions/xxd | 23 ++++ completions/ypmatch | 4 +- configure | 20 +-- configure.ac | 2 +- doc/Makefile.in | 2 +- helpers/Makefile.in | 2 +- install-sh | 29 +++-- missing | 53 +------- test/Makefile.in | 2 +- test/completion/chronyc.exp | 1 + test/completion/eject.exp | 1 + test/completion/eog.exp | 1 + test/completion/file-roller.exp | 1 + test/completion/genisoimage.exp | 1 + test/completion/gphoto2.exp | 1 + test/completion/hexdump.exp | 1 + test/completion/interdiff.exp | 1 + test/completion/lua.exp | 1 + test/completion/luac.exp | 1 + test/completion/luseradd.exp | 1 + test/completion/luserdel.exp | 1 + test/completion/lusermod.exp | 1 + test/completion/mussh.exp | 1 + test/completion/nc.exp | 1 + test/completion/ngrep.exp | 1 + test/completion/nmcli.exp | 1 + test/completion/opera.exp | 1 + test/completion/pkg-get.exp | 1 + test/completion/pkgadd.exp | 1 + test/completion/pkgrm.exp | 1 + test/completion/pkgutil.exp | 1 + test/completion/pydoc.exp | 1 + test/completion/pylint.exp | 1 + test/completion/ss.exp | 1 + test/completion/strings.exp | 1 + test/completion/svcadm.exp | 1 + test/completion/tshark.exp | 1 + test/completion/udevadm.exp | 1 - test/completion/vpnc.exp | 1 + test/completion/wsimport.exp | 1 + test/completion/xxd.exp | 1 + test/fixtures/man/man/quux.8 | 0 test/lib/completions/chronyc.exp | 21 ++++ test/lib/completions/eject.exp | 18 +++ test/lib/completions/eog.exp | 18 +++ test/lib/completions/file-roller.exp | 18 +++ test/lib/completions/genisoimage.exp | 18 +++ test/lib/completions/gphoto2.exp | 18 +++ test/lib/completions/hexdump.exp | 18 +++ test/lib/completions/interdiff.exp | 18 +++ test/lib/completions/lua.exp | 18 +++ test/lib/completions/luac.exp | 18 +++ test/lib/completions/luseradd.exp | 18 +++ test/lib/completions/luserdel.exp | 18 +++ test/lib/completions/lusermod.exp | 18 +++ test/lib/completions/man.exp | 4 + test/lib/completions/mussh.exp | 18 +++ test/lib/completions/nc.exp | 18 +++ test/lib/completions/ncftp.exp | 2 + test/lib/completions/ngrep.exp | 21 ++++ test/lib/completions/nmcli.exp | 18 +++ test/lib/completions/opera.exp | 18 +++ test/lib/completions/pkg-get.exp | 18 +++ test/lib/completions/pkgadd.exp | 18 +++ test/lib/completions/pkgrm.exp | 18 +++ test/lib/completions/pkgutil.exp | 18 +++ test/lib/completions/pwd.exp | 2 +- test/lib/completions/pydoc.exp | 18 +++ test/lib/completions/pylint.exp | 18 +++ test/lib/completions/ss.exp | 21 ++++ test/lib/completions/strings.exp | 18 +++ test/lib/completions/svcadm.exp | 18 +++ test/lib/completions/tshark.exp | 21 ++++ test/lib/completions/udevadm.exp | 20 --- test/lib/completions/vpnc.exp | 18 +++ test/lib/completions/wget.exp | 6 + test/lib/completions/wsimport.exp | 18 +++ test/lib/completions/xrandr.exp | 3 +- test/lib/completions/xxd.exp | 18 +++ test/unit/_filedir.exp | 5 +- 278 files changed, 4320 insertions(+), 1501 deletions(-) create mode 100644 completions/_udevadm create mode 100644 completions/chronyc create mode 100644 completions/eject create mode 100644 completions/eog create mode 100644 completions/file-roller create mode 100644 completions/gphoto2 create mode 100644 completions/hexdump create mode 100644 completions/interdiff create mode 100644 completions/lua create mode 100644 completions/luac create mode 100644 completions/luseradd create mode 100644 completions/luserdel create mode 100644 completions/mussh create mode 100644 completions/nc create mode 100644 completions/ngrep create mode 100644 completions/nmcli create mode 100644 completions/opera create mode 100644 completions/patch create mode 100644 completions/pkg-get create mode 100644 completions/pkgadd create mode 100644 completions/pkgrm create mode 100644 completions/pkgutil create mode 100644 completions/pydoc create mode 100644 completions/pylint create mode 100644 completions/ss create mode 100644 completions/strings create mode 100644 completions/svcadm create mode 100644 completions/tshark delete mode 100644 completions/udevadm create mode 100644 completions/wget create mode 100644 completions/wsimport create mode 100644 completions/xxd create mode 100644 test/completion/chronyc.exp create mode 100644 test/completion/eject.exp create mode 100644 test/completion/eog.exp create mode 100644 test/completion/file-roller.exp create mode 100644 test/completion/genisoimage.exp create mode 100644 test/completion/gphoto2.exp create mode 100644 test/completion/hexdump.exp create mode 100644 test/completion/interdiff.exp create mode 100644 test/completion/lua.exp create mode 100644 test/completion/luac.exp create mode 100644 test/completion/luseradd.exp create mode 100644 test/completion/luserdel.exp create mode 100644 test/completion/lusermod.exp create mode 100644 test/completion/mussh.exp create mode 100644 test/completion/nc.exp create mode 100644 test/completion/ngrep.exp create mode 100644 test/completion/nmcli.exp create mode 100644 test/completion/opera.exp create mode 100644 test/completion/pkg-get.exp create mode 100644 test/completion/pkgadd.exp create mode 100644 test/completion/pkgrm.exp create mode 100644 test/completion/pkgutil.exp create mode 100644 test/completion/pydoc.exp create mode 100644 test/completion/pylint.exp create mode 100644 test/completion/ss.exp create mode 100644 test/completion/strings.exp create mode 100644 test/completion/svcadm.exp create mode 100644 test/completion/tshark.exp delete mode 100644 test/completion/udevadm.exp create mode 100644 test/completion/vpnc.exp create mode 100644 test/completion/wsimport.exp create mode 100644 test/completion/xxd.exp create mode 100644 test/fixtures/man/man/quux.8 create mode 100644 test/lib/completions/chronyc.exp create mode 100644 test/lib/completions/eject.exp create mode 100644 test/lib/completions/eog.exp create mode 100644 test/lib/completions/file-roller.exp create mode 100644 test/lib/completions/genisoimage.exp create mode 100644 test/lib/completions/gphoto2.exp create mode 100644 test/lib/completions/hexdump.exp create mode 100644 test/lib/completions/interdiff.exp create mode 100644 test/lib/completions/lua.exp create mode 100644 test/lib/completions/luac.exp create mode 100644 test/lib/completions/luseradd.exp create mode 100644 test/lib/completions/luserdel.exp create mode 100644 test/lib/completions/lusermod.exp create mode 100644 test/lib/completions/mussh.exp create mode 100644 test/lib/completions/nc.exp create mode 100644 test/lib/completions/ngrep.exp create mode 100644 test/lib/completions/nmcli.exp create mode 100644 test/lib/completions/opera.exp create mode 100644 test/lib/completions/pkg-get.exp create mode 100644 test/lib/completions/pkgadd.exp create mode 100644 test/lib/completions/pkgrm.exp create mode 100644 test/lib/completions/pkgutil.exp create mode 100644 test/lib/completions/pydoc.exp create mode 100644 test/lib/completions/pylint.exp create mode 100644 test/lib/completions/ss.exp create mode 100644 test/lib/completions/strings.exp create mode 100644 test/lib/completions/svcadm.exp create mode 100644 test/lib/completions/tshark.exp delete mode 100644 test/lib/completions/udevadm.exp create mode 100644 test/lib/completions/vpnc.exp create mode 100644 test/lib/completions/wsimport.exp create mode 100644 test/lib/completions/xxd.exp diff --git a/AUTHORS b/AUTHORS index a63f2c53..be87f3f2 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,6 +1,7 @@ David Paleino (Debian) Freddy Vulto Guillame Rousse (Mandriva) +Igor Murzov Mike Kelly (Exherbo) Santiago M. Mola (Exherbo) Ville Skyttä (Fedora/Red Hat) diff --git a/CHANGES b/CHANGES index 3c01e9f8..a4e8bcf8 100644 --- a/CHANGES +++ b/CHANGES @@ -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 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 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) diff --git a/aclocal.m4 b/aclocal.m4 index 573651e7..279699f2 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -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 -# © 2009-2011, Bash Completion Maintainers +# © 2009-2013, Bash Completion Maintainers # # # 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 new file mode 100644 index 00000000..51ec0e5d --- /dev/null +++ b/completions/_udevadm @@ -0,0 +1,79 @@ +# 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 + _init_completion -s || return + + local i udevcmd + for (( i=1; i < cword; i++ )); do + if [[ ${words[i]} != -* ]]; then + udevcmd=${words[i]} + break + fi + done + + case $prev in + --help|--version|--property|--children-max|--timeout|--seq-start|\ + --seq-end|--attr-match|--attr-nomatch|--parent-match|--property-match|\ + --tag-match|--subsystem-match|--subsystem-nomatch|--sysname-match|\ + --path) + return + ;; + --log-priority) + COMPREPLY=( $( compgen -W 'err info debug' -- "$cur" ) ) + return + ;; + --query) + COMPREPLY=( $( compgen -W 'name symlink path property all' \ + -- "$cur" ) ) + return + ;; + --name) + cur=${cur:=/dev/} + _filedir + return + ;; + --device-id-of-file|--exit-if-exists) + _filedir + return + ;; + --action) + COMPREPLY=( $( compgen -W 'add change remove' -- "$cur" ) ) + return + ;; + --type) + COMPREPLY=( $( compgen -W 'devices subsystems failed' -- "$cur" ) ) + return + ;; + esac + + $split && return + + if [[ -z $udevcmd ]]; then + case $cur in + -*) + COMPREPLY=( $( compgen -W '--help --version --debug' -- \ + "$cur" ) ) + ;; + *) + COMPREPLY=( $( compgen -W "$( "$1" --help 2>/dev/null | + awk '/^[[:space:]]+/ { print $1 }' )" -- "$cur" ) ) + ;; + esac + return + fi + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W \ + '$( "$1" $udevcmd --help 2>/dev/null | _parse_help - )' \ + -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + fi +} && +complete -F _udevadm udevadm + +# ex: ts=4 sw=4 et filetype=sh 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 <