From 6d88f1055806932d9291f96847d2b691cccda2cd Mon Sep 17 00:00:00 2001 From: "Gabriel F. T. Gomes" Date: Mon, 25 Sep 2017 23:46:54 -0300 Subject: New upstream version 2.7 --- completions/.gitignore | 205 ++++++ completions/2to3 | 39 ++ completions/7z | 119 ++++ completions/Makefile.am | 153 ++++- completions/Makefile.in | 1258 ------------------------------------- completions/_cal | 37 ++ completions/_chfn | 8 + completions/_chsh | 30 + completions/_dmesg | 34 + completions/_eject | 33 + completions/_hexdump | 32 + completions/_hwclock | 26 + completions/_ionice | 60 ++ completions/_look | 17 + completions/_mock | 18 +- completions/_modules | 12 +- completions/_newgrp | 19 + completions/_nmcli | 201 ++++++ completions/_renice | 32 + completions/_repomanage | 24 + completions/_reptyr | 26 + completions/_rtcwake | 32 + completions/_runuser | 8 + completions/_su | 41 ++ completions/_subversion | 344 ---------- completions/_svn | 212 +++++++ completions/_svnadmin | 78 +++ completions/_svnlook | 63 ++ completions/_udevadm | 4 +- completions/_write | 8 + completions/_yum | 27 +- completions/_yum-utils | 24 - completions/a2x | 2 +- completions/abook | 23 +- completions/aclocal | 14 +- completions/acpi | 2 +- completions/adb | 66 ++ completions/add_members | 8 +- completions/alias | 4 +- completions/ant | 67 +- completions/apache2ctl | 4 +- completions/appdata-validate | 32 + completions/apt-build | 24 +- completions/apt-cache | 46 +- completions/apt-get | 23 +- completions/aptitude | 51 +- completions/arch | 11 +- completions/arping | 2 +- completions/arpspoof | 6 +- completions/asciidoc | 2 +- completions/aspell | 36 +- completions/autoconf | 12 +- completions/automake | 12 +- completions/autoreconf | 12 +- completions/autorpm | 2 +- completions/autoscan | 10 +- completions/avctrl | 2 +- completions/badblocks | 10 +- completions/bind | 36 ++ completions/bk | 5 +- completions/brctl | 4 +- completions/btdownloadheadless.py | 6 +- completions/bts | 115 ++++ completions/bzip2 | 14 +- completions/cal | 34 - completions/cancel | 2 +- completions/cardctl | 2 +- completions/ccache | 22 +- completions/cfagent | 4 +- completions/cfrun | 6 +- completions/chage | 8 +- completions/change_pw | 6 +- completions/check_db | 2 +- completions/check_perms | 2 +- completions/checksec | 37 ++ completions/chgrp | 11 +- completions/chkconfig | 8 +- completions/chown | 8 +- completions/chpasswd | 8 +- completions/chronyc | 52 +- completions/chrpath | 2 +- completions/chsh | 28 - completions/cksfv | 10 +- completions/cleanarch | 2 +- completions/clisp | 3 +- completions/clone_member | 6 +- completions/complete | 14 +- completions/config_list | 6 +- completions/configure | 8 +- completions/convert | 48 +- completions/cowsay | 4 +- completions/cpan2dist | 8 +- completions/cpio | 12 +- completions/cppcheck | 28 +- completions/crontab | 18 +- completions/cryptsetup | 5 +- completions/curl | 2 +- completions/cvs | 81 +-- completions/cvsps | 28 +- completions/dd | 27 +- completions/deja-dup | 33 + completions/desktop-file-validate | 2 +- completions/dhclient | 6 +- completions/dict | 18 +- completions/dmesg | 31 - completions/dnsspoof | 6 +- completions/dot | 10 +- completions/dpkg | 46 +- completions/dpkg-source | 23 +- completions/dselect | 7 +- completions/dsniff | 6 +- completions/dumpdb | 2 +- completions/dumpe2fs | 8 +- completions/e2freefrag | 6 +- completions/e2label | 2 +- completions/eject | 30 - completions/eog | 4 +- completions/ether-wake | 8 +- completions/evince | 4 +- completions/explodepkg | 2 +- completions/export | 9 +- completions/faillog | 9 +- completions/fbgs | 7 +- completions/fbi | 7 +- completions/feh | 10 +- completions/file | 2 +- completions/file-roller | 6 +- completions/filefrag | 4 +- completions/filesnarf | 4 +- completions/find | 33 +- completions/find_member | 6 +- completions/flake8 | 35 ++ completions/freebsd-update | 29 + completions/freeciv-gtk2 | 8 +- completions/freeciv-server | 4 +- completions/function | 27 +- completions/fusermount | 6 +- completions/gcc | 25 +- completions/gcl | 3 +- completions/gdb | 15 +- completions/genaliases | 2 +- completions/gendiff | 4 +- completions/genisoimage | 10 +- completions/getent | 26 +- completions/gkrellm | 14 +- completions/gm | 40 ++ completions/gnatmake | 16 +- completions/gnokii | 235 +++++++ completions/gnome-mplayer | 2 +- completions/gpasswd | 6 +- completions/gpg | 22 +- completions/gpg2 | 24 +- completions/gphoto2 | 33 +- completions/gprof | 2 +- completions/groupadd | 7 +- completions/groupdel | 2 +- completions/groupmems | 8 +- completions/groupmod | 8 +- completions/growisofs | 10 +- completions/grpck | 4 +- completions/gzip | 15 +- completions/hcitool | 60 +- completions/hddtemp | 2 +- completions/hexdump | 29 - completions/hid2hci | 2 +- completions/hostname | 23 + completions/hping2 | 10 +- completions/htop | 5 +- completions/htpasswd | 2 +- completions/hwclock | 23 - completions/iconv | 15 +- completions/id | 2 +- completions/idn | 2 +- completions/iftop | 8 +- completions/ifup | 3 +- completions/info | 9 +- completions/inject | 6 +- completions/insmod | 2 +- completions/installpkg | 15 +- completions/interdiff | 2 +- completions/invoke-rc.d | 7 +- completions/ionice | 57 -- completions/ip | 62 +- completions/iperf | 6 +- completions/ipmitool | 30 +- completions/ipsec | 12 +- completions/iptables | 10 +- completions/ipv6calc | 18 +- completions/iscsiadm | 12 +- completions/isql | 4 +- completions/iwconfig | 26 +- completions/iwlist | 2 +- completions/iwpriv | 6 +- completions/iwspy | 2 +- completions/jar | 4 +- completions/jarsigner | 23 +- completions/java | 66 +- completions/javaws | 12 +- completions/jpegoptim | 38 ++ completions/jps | 2 +- completions/jshint | 38 ++ completions/k3b | 18 +- completions/kcov | 29 +- completions/kill | 2 +- completions/killall | 2 +- completions/kldload | 3 +- completions/kldunload | 6 +- completions/koji | 2 +- completions/ktutil | 14 +- completions/larch | 3 +- completions/lastlog | 8 +- completions/ldapsearch | 62 +- completions/ldapvi | 18 +- completions/lftp | 8 +- completions/lftpget | 2 +- completions/lilo | 14 +- completions/links | 5 +- completions/lintian | 43 +- completions/lisp | 3 +- completions/list_admins | 2 +- completions/list_lists | 2 +- completions/list_members | 10 +- completions/list_owners | 2 +- completions/look | 14 - completions/lpq | 8 +- completions/lpr | 10 +- completions/lrzip | 20 +- completions/lsof | 20 +- completions/lua | 2 +- completions/luac | 2 +- completions/luseradd | 2 +- completions/luserdel | 2 +- completions/lvm | 261 +++----- completions/lz4 | 53 ++ completions/lzip | 2 +- completions/lzma | 10 +- completions/lzop | 12 +- completions/macof | 4 +- completions/mailmanctl | 2 +- completions/make | 106 ++-- completions/makepkg | 9 +- completions/man | 25 +- completions/mc | 10 +- completions/mcrypt | 31 +- completions/mdadm | 14 +- completions/mdtool | 9 +- completions/medusa | 12 +- completions/mii-diag | 6 +- completions/mii-tool | 8 +- completions/minicom | 25 +- completions/mkinitrd | 10 +- completions/mktemp | 8 +- completions/mmsitepass | 2 +- completions/modinfo | 2 +- completions/modprobe | 33 +- completions/monodevelop | 3 +- completions/mount | 12 +- completions/mount.linux | 8 +- completions/mplayer | 102 +-- completions/mr | 86 +++ completions/msynctool | 26 +- completions/mtx | 3 +- completions/munin-node-configure | 10 +- completions/munin-run | 6 +- completions/munin-update | 6 +- completions/munindoc | 2 +- completions/mussh | 8 +- completions/mutt | 36 +- completions/mysql | 38 +- completions/mysqladmin | 18 +- completions/nc | 6 +- completions/ncftp | 5 +- completions/nethogs | 5 +- completions/newgrp | 16 - completions/newlist | 18 +- completions/newusers | 10 +- completions/ngrep | 2 +- completions/nmap | 10 +- completions/nmcli | 199 ------ completions/nslookup | 10 +- completions/ntpdate | 12 +- completions/openssl | 48 +- completions/opera | 5 +- completions/optipng | 52 ++ completions/p4 | 3 +- completions/pack200 | 18 +- completions/passwd | 6 +- completions/patch | 2 +- completions/pdftotext | 36 ++ completions/perl | 50 +- completions/pgrep | 26 +- completions/pidof | 12 +- completions/pine | 31 +- completions/ping | 2 +- completions/pkg-config | 12 +- completions/pkg-get | 34 +- completions/pkg_delete | 7 +- completions/pkgadd | 15 +- completions/pkgrm | 24 +- completions/pkgtool | 11 +- completions/pkgutil | 35 +- completions/plague-client | 2 +- completions/pm-hibernate | 2 +- completions/pm-is-supported | 2 +- completions/pm-powersave | 2 +- completions/pngfix | 35 ++ completions/portinstall | 5 +- completions/portsnap | 25 + completions/portupgrade | 7 +- completions/postcat | 17 +- completions/postconf | 9 +- completions/postfix | 8 +- completions/postmap | 9 +- completions/postsuper | 18 +- completions/povray | 16 +- completions/prelink | 2 +- completions/protoc | 4 +- completions/psql | 104 ++- completions/puppet | 257 ++++---- completions/pwck | 4 +- completions/pwd | 2 +- completions/pwdx | 12 +- completions/pwgen | 2 +- completions/py.test | 71 +++ completions/pydoc | 6 +- completions/pyflakes | 23 + completions/pylint | 2 +- completions/python | 62 +- completions/pyvenv | 25 + completions/qdbus | 6 +- completions/qemu | 52 +- completions/qrunner | 4 +- completions/querybts | 8 +- completions/quota | 42 +- completions/rcs | 4 +- completions/rdesktop | 12 +- completions/remove_members | 6 +- completions/removepkg | 2 +- completions/renice | 29 - completions/reportbug | 21 +- completions/reptyr | 23 - completions/resolvconf | 4 +- completions/rfkill | 4 +- completions/ri | 43 +- completions/rmlist | 2 +- completions/rmmod | 3 +- completions/route | 4 +- completions/rpcdebug | 10 +- completions/rpm | 86 +-- completions/rpm2tgz | 5 +- completions/rpmcheck | 4 +- completions/rrdtool | 2 +- completions/rsync | 16 +- completions/rtcwake | 29 - completions/sbcl | 4 +- completions/sbopkg | 8 +- completions/screen | 20 +- completions/sh | 15 +- completions/sitecopy | 13 +- completions/slackpkg | 9 +- completions/slapt-get | 14 +- completions/slapt-src | 27 +- completions/smartctl | 30 +- completions/smbclient | 100 +-- completions/snownews | 2 +- completions/sqlite3 | 10 +- completions/ss | 4 +- completions/ssh | 202 +++--- completions/ssh-add | 4 +- completions/ssh-copy-id | 8 +- completions/ssh-keygen | 50 ++ completions/sshfs | 8 +- completions/sshmitm | 2 +- completions/sshow | 4 +- completions/strace | 14 +- completions/strings | 6 +- completions/su | 37 -- completions/sudo | 7 +- completions/svcadm | 16 +- completions/svk | 16 +- completions/sync_members | 8 +- completions/synclient | 24 + completions/sysbench | 52 +- completions/sysctl | 11 +- completions/tar | 777 ++++++++++++++++++++--- completions/tcpdump | 16 +- completions/tcpkill | 4 +- completions/tcpnice | 4 +- completions/timeout | 38 ++ completions/tipc | 285 +++++++++ completions/tracepath | 2 +- completions/tshark | 10 +- completions/tune2fs | 17 +- completions/umount | 2 +- completions/umount.linux | 18 +- completions/unace | 2 +- completions/unpack200 | 8 +- completions/unrar | 2 +- completions/unshunt | 4 +- completions/update-alternatives | 6 +- completions/update-rc.d | 6 +- completions/upgradepkg | 7 +- completions/urlsnarf | 4 +- completions/uscan | 39 ++ completions/useradd | 18 +- completions/userdel | 4 +- completions/usermod | 16 +- completions/valgrind | 6 +- completions/vipw | 6 +- completions/vmstat | 6 +- completions/vncviewer | 19 +- completions/vpnc | 22 +- completions/watch | 2 +- completions/webmitm | 2 +- completions/wget | 23 +- completions/wine | 2 +- completions/withlist | 2 +- completions/wodim | 4 +- completions/wol | 14 +- completions/wsimport | 2 +- completions/wtf | 25 +- completions/wvdial | 6 +- completions/xfreerdp | 17 +- completions/xgamma | 9 +- completions/xhost | 2 +- completions/xm | 10 +- completions/xmllint | 18 +- completions/xmlwf | 12 +- completions/xmms | 2 +- completions/xmodmap | 6 +- completions/xrandr | 15 +- completions/xrdb | 8 +- completions/xsltproc | 24 +- completions/xxd | 2 +- completions/xz | 22 +- completions/xzdec | 10 +- completions/ypmatch | 10 +- completions/yum-arch | 2 +- completions/zopfli | 31 + completions/zopflipng | 39 ++ 440 files changed, 6741 insertions(+), 4974 deletions(-) create mode 100644 completions/.gitignore create mode 100644 completions/2to3 create mode 100644 completions/7z delete mode 100644 completions/Makefile.in create mode 100644 completions/_cal create mode 100644 completions/_chfn create mode 100644 completions/_chsh create mode 100644 completions/_dmesg create mode 100644 completions/_eject create mode 100644 completions/_hexdump create mode 100644 completions/_hwclock create mode 100644 completions/_ionice create mode 100644 completions/_look create mode 100644 completions/_newgrp create mode 100644 completions/_nmcli create mode 100644 completions/_renice create mode 100644 completions/_repomanage create mode 100644 completions/_reptyr create mode 100644 completions/_rtcwake create mode 100644 completions/_runuser create mode 100644 completions/_su delete mode 100644 completions/_subversion create mode 100644 completions/_svn create mode 100644 completions/_svnadmin create mode 100644 completions/_svnlook create mode 100644 completions/_write delete mode 100644 completions/_yum-utils create mode 100644 completions/adb create mode 100644 completions/appdata-validate create mode 100644 completions/bind create mode 100644 completions/bts delete mode 100644 completions/cal create mode 100644 completions/checksec delete mode 100644 completions/chsh create mode 100644 completions/deja-dup delete mode 100644 completions/dmesg delete mode 100644 completions/eject create mode 100644 completions/flake8 create mode 100644 completions/freebsd-update create mode 100644 completions/gm create mode 100644 completions/gnokii delete mode 100644 completions/hexdump create mode 100644 completions/hostname delete mode 100644 completions/hwclock delete mode 100644 completions/ionice create mode 100644 completions/jpegoptim create mode 100644 completions/jshint delete mode 100644 completions/look create mode 100644 completions/lz4 create mode 100644 completions/mr delete mode 100644 completions/newgrp delete mode 100644 completions/nmcli create mode 100644 completions/optipng create mode 100644 completions/pdftotext create mode 100644 completions/pngfix create mode 100644 completions/portsnap create mode 100644 completions/py.test create mode 100644 completions/pyflakes create mode 100644 completions/pyvenv delete mode 100644 completions/renice delete mode 100644 completions/reptyr delete mode 100644 completions/rtcwake create mode 100644 completions/ssh-keygen delete mode 100644 completions/su create mode 100644 completions/synclient create mode 100644 completions/timeout create mode 100644 completions/tipc create mode 100644 completions/uscan create mode 100644 completions/zopfli create mode 100644 completions/zopflipng (limited to 'completions') diff --git a/completions/.gitignore b/completions/.gitignore new file mode 100644 index 00000000..60a2d949 --- /dev/null +++ b/completions/.gitignore @@ -0,0 +1,205 @@ +7za +aclocal-1.1[012345] +alpine +alternatives +animate +apropos +arm-koji +asciidoc.py +autoheader +automake-1.1[012345] +autossh +autoupdate +bsdtar +btdownloadcurses.py +btdownloadgui.py +c++ +cc +cdrecord +ci +ciptool +civclient +civserver +clzip +co +colormake +compare +compgen +composite +conjure +cowthink +createdb +createuser +dcop +declare +dfutool +display +dpkg-deb +dpkg-query +dpkg-reconfigure +dropdb +dropuser +edquota +f77 +f95 +filebucket +freeciv-sdl +freeciv-xaw +g++ +g4 +g77 +g95 +gcj +gfortran +gkrellm2 +gmake +gmplayer +gnumake +gpc +hciattach +hciconfig +hd +host +hping +hping3 +identify +ifdown +ifstatus +import +insmod.static +javac +javadoc +kplayer +l2ping +lbzip2 +ldapadd +ldapcompare +ldapdelete +ldapmodify +ldapmodrdn +ldappasswd +ldapwhoami +lintian-info +lusermod +lvchange +lvcreate +lvdisplay +lvextend +lvmdiskscan +lvreduce +lvremove +lvrename +lvresize +lvs +lvscan +lz4c +mailsnarf +mdecrypt +mencoder +micropython +mkisofs +mogrify +montage +mplayer2 +msgsnarf +muttng +ncal +pbzip2 +pccardctl +pdlzip +perldoc +phing +pigz +pinfo +ping6 +pkg_deinstall +pkg_info +pkill +plzip +pm-suspend +pm-suspend-hybrid +pmake +postalias +ppc-koji +puppetca +puppetd +puppetdoc +puppetmasterd +puppetqd +puppetrun +pvchange +pvcreate +pvdisplay +pvmove +pvremove +pvs +pvscan +pxz +py.test-[23] +pydoc3 +python2 +python3 +pypy +pypy3 +pyvenv-3.[45] +qemu-kvm +qemu-system-i386 +qemu-system-x86_64 +quotacheck +quotaoff +quotaon +ralsh +rcsdiff +rdict +repquota +rfcomm +rlog +rpm2targz +rpm2txz +rpmbuild +rpmbuild-md5 +s390-koji +sbcl-mt +scp +sdptool +setquota +sftp +sidedoor +slogin +smbcacls +smbcquotas +smbget +smbpasswd +smbtar +smbtree +sparc-koji +spovray +star +stream +sudoedit +tightvncviewer +tracepath6 +typeset +vgcfgbackup +vgcfgrestore +vgchange +vgck +vgconvert +vgcreate +vgdisplay +vgexport +vgextend +vgimport +vgmerge +vgmknodes +vgreduce +vgremove +vgrename +vgs +vgscan +vgsplit +vigr +whatis +xpovray +xvnc4viewer +ypcat diff --git a/completions/2to3 b/completions/2to3 new file mode 100644 index 00000000..4dd29bf4 --- /dev/null +++ b/completions/2to3 @@ -0,0 +1,39 @@ +# bash completion for 2to3 -*- shell-script -*- + +_2to3() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + -h|--help|--add-suffix) + return + ;; + -f|--fix|-x|--nofix) + COMPREPLY=( $( compgen -W \ + "$( $1 --list-fixes 2>/dev/null | command sed -e 1d )" -- "$cur" ) ) + return + ;; + -j|--processes) + COMPREPLY=( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) ) + return + ;; + -o|--output-dir) + _filedir -d + return + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + fi + + _filedir py +} && +complete -F _2to3 2to3 + +# ex: filetype=sh diff --git a/completions/7z b/completions/7z new file mode 100644 index 00000000..5599b708 --- /dev/null +++ b/completions/7z @@ -0,0 +1,119 @@ +# 7z(1) completion -*- shell-script -*- + +_7z() +{ + local cur prev words cword + _init_completion -n = || return + + if [[ $cword -eq 1 ]]; then + COMPREPLY=( $( compgen -W 'a b d e l t u x' -- "$cur" ) ) + return + fi + + local mode + [[ ${words[1]} == [adu] ]] && mode=w || mode=r + + case $cur in + -ao*) + COMPREPLY=( $( compgen -P${cur:0:3} -W 'a s t u' -- "${cur:3}" ) ) + return + ;; + -?(a)[ix]*) + local opt + if [[ $cur == -a[ix]* ]]; then + opt=${cur:0:3} cur=${cur:3} + else + opt=${cur:0:2} cur=${cur:2} + fi + if [[ $cur != *[@\!]* ]]; then + COMPREPLY=( $( compgen -P$opt -W '@ ! r@ r-@ r0@ r! r-! r0!' \ + -- "$cur" ) ) + elif [[ $cur == ?(r@(-|0|))@* ]]; then + local x tmp + x=$( compgen -P"${opt}${cur%%@*}@" -f -- "${cur#*@}" ) && + while read -r tmp; do + COMPREPLY+=( "$tmp" ) + done <<< "$x" + compopt -o filenames + fi + return + ;; + -mhe=*|-mhc=*|-ms=*|-mt=*) + COMPREPLY=( $( compgen -W 'on off' -- "${cur#*=}" ) ) + return + ;; + -mx=*) + COMPREPLY=( $( compgen -W '0 1 3 5 7 9' -- "${cur#*=}" ) ) + return + ;; + -o*|-w?*) + local x tmp + x=$( compgen -P${cur:0:2} -S/ -d -- "${cur:2}" ) && + while read -r tmp; do + COMPREPLY+=( "$tmp" ) + done <<< "$x" + compopt -o nospace -o filenames + return + ;; + -r?*) + COMPREPLY=( $( compgen -P${cur:0:2} -W '- 0' -- "${cur:2}" ) ) + return + ;; + -scs*) + COMPREPLY=( $( compgen -P${cur:0:4} -W 'UTF-8 WIN DOS' \ + -- "${cur:4}" ) ) + return + ;; + -ssc?*) + COMPREPLY=( $( compgen -P${cur:0:4} -W '-' -- "${cur:4}" ) ) + return + ;; + -t*) + if [[ $mode == w ]]; then + COMPREPLY=( $( compgen -P${cur:0:2} -W '7z bzip2 gzip swfc + tar wim xz zip' -- "${cur:2}" ) ) + else + COMPREPLY=( $( compgen -P${cur:0:2} -W '7z apm arj bzip2 cab + chm cpio cramfs deb dmg elf fat flv gzip hfs iso lzh lzma + lzma86 macho mbr mslz mub nsis ntfs pe ppmd rar rpm + squashfs swf swfc tar udf vhd wim xar xz z zip' \ + -- "${cur:2}" ) ) + fi + return + ;; + -m*=*|-p*|-u*|-v*) + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '-ai -an -ao -ax -bd -i -m{x,s,f,he,hc,mt}= + -o -p -r -scs -sfx -si -slp -slt -so -ssc -t -u -v -w -x -y' \ + -- "$cur" ) ) + [[ $COMPREPLY == -@(an|bd|sfx|si|slt|so|ssc|[rwy]) ]] || + compopt -o nospace + return + fi + + local args + _count_args = + if [[ $args -eq 2 ]]; then + _filedir_xspec unzip + [[ $mode == w ]] && + _filedir '@(7z|bz2|swf|?(g)tar|?(t)[bglx]z|tb?(z)2|wim)' || + _filedir '@(7z|arj|bz2|cab|chm|cpio|deb|dmg|flv|gem|img|iso|lz[ah]|lzma?(86)|pmd|[rx]ar|rpm|sw[fm]|?(g)tar|taz|?(t)[bglx]z|tb?(z)2|vhd|wim|Z)' + else + if [[ ${words[1]} == d ]]; then + local IFS=$'\n' + COMPREPLY=( $( compgen -W "$( printf '%s\n' $( $1 l ${words[2]} \ + -slt 2>/dev/null | command sed -n '/^Path =/s/^Path = \(.*\)$/\1/p' \ + 2>/dev/null | tail -n+2 ) )" -- "$cur" ) ) + compopt -o filenames + else + _filedir + fi + fi +} && +complete -F _7z 7z 7za + +# ex: filetype=sh diff --git a/completions/Makefile.am b/completions/Makefile.am index f312b3a9..f04d7c36 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -1,12 +1,16 @@ bashcompdir = $(pkgdatadir)/completions -bashcomp_DATA = a2x \ +bashcomp_DATA = 2to3 \ + 7z \ + a2x \ abook \ aclocal \ acpi \ + adb \ add_members \ alias \ ant \ apache2ctl \ + appdata-validate \ apt-build \ apt-cache \ apt-get \ @@ -23,11 +27,13 @@ bashcomp_DATA = a2x \ autoscan \ avctrl \ badblocks \ + bind \ bk \ brctl \ btdownloadheadless.py \ + bts \ bzip2 \ - cal \ + _cal \ cancel \ cardctl \ ccache \ @@ -37,13 +43,15 @@ bashcomp_DATA = a2x \ change_pw \ check_db \ check_perms \ + checksec \ + _chfn \ chgrp \ chkconfig \ chown \ chpasswd \ chronyc \ chrpath \ - chsh \ + _chsh \ cksfv \ cleanarch \ clisp \ @@ -62,10 +70,11 @@ bashcomp_DATA = a2x \ cvs \ cvsps \ dd \ + deja-dup \ desktop-file-validate \ dhclient \ dict \ - dmesg \ + _dmesg \ dnsspoof \ dot \ dpkg \ @@ -76,7 +85,7 @@ bashcomp_DATA = a2x \ dumpe2fs \ e2freefrag \ e2label \ - eject \ + _eject \ eog \ ether-wake \ evince \ @@ -92,6 +101,8 @@ bashcomp_DATA = a2x \ filesnarf \ find \ find_member \ + flake8 \ + freebsd-update \ freeciv-gtk2 \ freeciv-server \ function \ @@ -104,7 +115,9 @@ bashcomp_DATA = a2x \ genisoimage \ getent \ gkrellm \ + gm \ gnatmake \ + gnokii \ gnome-mplayer \ gpasswd \ gpg \ @@ -120,12 +133,13 @@ bashcomp_DATA = a2x \ gzip \ hcitool \ hddtemp \ - hexdump \ + _hexdump \ hid2hci \ + hostname \ hping2 \ htop \ htpasswd \ - hwclock \ + _hwclock \ iconv \ id \ idn \ @@ -137,7 +151,7 @@ bashcomp_DATA = a2x \ installpkg \ interdiff \ invoke-rc.d \ - ionice \ + _ionice \ ip \ iperf \ ipmitool \ @@ -154,7 +168,9 @@ bashcomp_DATA = a2x \ jarsigner \ java \ javaws \ + jpegoptim \ jps \ + jshint \ k3b \ kcov \ kill \ @@ -177,7 +193,7 @@ bashcomp_DATA = a2x \ list_lists \ list_members \ list_owners \ - look \ + _look \ lpq \ lpr \ lrzip \ @@ -187,6 +203,7 @@ bashcomp_DATA = a2x \ luseradd \ luserdel \ lvm \ + lz4 \ lzip \ lzma \ lzop \ @@ -206,12 +223,15 @@ bashcomp_DATA = a2x \ mkinitrd \ mktemp \ mmsitepass \ + _mock \ modinfo \ modprobe \ + _modules \ monodevelop \ mount \ mount.linux \ mplayer \ + mr \ msynctool \ mtx \ munindoc \ @@ -225,20 +245,22 @@ bashcomp_DATA = a2x \ nc \ ncftp \ nethogs \ - newgrp \ + _newgrp \ newlist \ newusers \ ngrep \ nmap \ - nmcli \ + _nmcli \ nslookup \ ntpdate \ openssl \ opera \ + optipng \ p4 \ pack200 \ passwd \ patch \ + pdftotext \ perl \ pgrep \ pidof \ @@ -255,7 +277,9 @@ bashcomp_DATA = a2x \ pm-hibernate \ pm-is-supported \ pm-powersave \ + pngfix \ portinstall \ + portsnap \ portupgrade \ postcat \ postconf \ @@ -271,9 +295,12 @@ bashcomp_DATA = a2x \ pwd \ pwdx \ pwgen \ + py.test \ pydoc \ + pyflakes \ pylint \ python \ + pyvenv \ qdbus \ qemu \ qrunner \ @@ -283,9 +310,10 @@ bashcomp_DATA = a2x \ rdesktop \ remove_members \ removepkg \ - renice \ + _renice \ + _repomanage \ reportbug \ - reptyr \ + _reptyr \ resolvconf \ rfkill \ ri \ @@ -298,7 +326,8 @@ bashcomp_DATA = a2x \ rpmcheck \ rrdtool \ rsync \ - rtcwake \ + _rtcwake \ + _runuser \ sbcl \ sbopkg \ screen \ @@ -315,25 +344,33 @@ bashcomp_DATA = a2x \ ssh \ ssh-add \ ssh-copy-id \ + ssh-keygen \ sshfs \ sshmitm \ sshow \ strace \ strings \ - su \ + _su \ sudo \ svcadm \ svk \ + _svn \ + _svnadmin \ + _svnlook \ sync_members \ + synclient \ sysbench \ sysctl \ tar \ tcpdump \ tcpkill \ tcpnice \ + timeout \ + tipc \ tracepath \ tshark \ tune2fs \ + _udevadm \ umount \ umount.linux \ unace \ @@ -359,6 +396,7 @@ bashcomp_DATA = a2x \ withlist \ wodim \ wol \ + _write \ wsimport \ wtf \ wvdial \ @@ -377,13 +415,21 @@ bashcomp_DATA = a2x \ xz \ xzdec \ ypmatch \ - yum-arch + _yum \ + yum-arch \ + zopfli \ + zopflipng -EXTRA_DIST = $(bashcomp_DATA) \ - _mock _modules _subversion _udevadm _yum _yum-utils +EXTRA_DIST = $(bashcomp_DATA) CLEANFILES = \ + 7za \ + aclocal-1.10 \ aclocal-1.11 \ + aclocal-1.12 \ + aclocal-1.13 \ + aclocal-1.14 \ + aclocal-1.15 \ alpine \ alternatives \ animate \ @@ -391,9 +437,15 @@ CLEANFILES = \ arm-koji \ asciidoc.py \ autoheader \ + automake-1.10 \ automake-1.11 \ + automake-1.12 \ + automake-1.13 \ + automake-1.14 \ + automake-1.15 \ autossh \ autoupdate \ + bsdtar \ btdownloadcurses.py \ btdownloadgui.py \ c++ \ @@ -412,6 +464,7 @@ CLEANFILES = \ conjure \ cowthink \ createdb \ + createuser \ dcop \ declare \ dfutool \ @@ -420,14 +473,19 @@ CLEANFILES = \ dpkg-query \ dpkg-reconfigure \ dropdb \ + dropuser \ edquota \ + f77 \ + f95 \ filebucket \ freeciv-sdl \ freeciv-xaw \ g++ \ g4 \ g77 \ + g95 \ gcj \ + gfortran \ gkrellm2 \ gmake \ gmplayer \ @@ -469,9 +527,11 @@ CLEANFILES = \ lvresize \ lvs \ lvscan \ + lz4c \ mailsnarf \ mdecrypt \ mencoder \ + micropython \ mkisofs \ mogrify \ montage \ @@ -510,9 +570,18 @@ CLEANFILES = \ pvs \ pvscan \ pxz \ + py.test-2 \ + py.test-3 \ pydoc3 \ + pypy \ + pypy3 \ python2 \ python3 \ + pyvenv-3.4 \ + pyvenv-3.5 \ + qemu-kvm \ + qemu-system-i386 \ + qemu-system-x86_64 \ quotacheck \ quotaoff \ quotaon \ @@ -532,6 +601,7 @@ CLEANFILES = \ sdptool \ setquota \ sftp \ + sidedoor \ slogin \ smbcacls \ smbcquotas \ @@ -541,6 +611,7 @@ CLEANFILES = \ smbtree \ sparc-koji \ spovray \ + star \ stream \ sudoedit \ tightvncviewer \ @@ -571,7 +642,12 @@ CLEANFILES = \ ypcat symlinks: $(targetdir) $(DATA) - for file in aclocal-1.11 ; do \ + for file in 7za ; do \ + rm -f $(targetdir)/$$file && \ + $(LN_S) 7z $(targetdir)/$$file ; \ + done + for file in aclocal-1.10 aclocal-1.11 aclocal-1.12 aclocal-1.13 \ + aclocal-1.14 aclocal-1.15 ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) aclocal $(targetdir)/$$file ; \ done @@ -583,7 +659,8 @@ symlinks: $(targetdir) $(DATA) rm -f $(targetdir)/$$file && \ $(LN_S) asciidoc $(targetdir)/$$file ; \ done - for file in automake-1.11 ; do \ + for file in automake-1.10 automake-1.11 automake-1.12 automake-1.13 \ + automake-1.14 automake-1.15 ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) automake $(targetdir)/$$file ; \ done @@ -605,7 +682,7 @@ symlinks: $(targetdir) $(DATA) done for file in ncal ; do \ rm -f $(targetdir)/$$file && \ - $(LN_S) cal $(targetdir)/$$file ; \ + $(LN_S) _cal $(targetdir)/$$file ; \ done for file in pccardctl ; do \ rm -f $(targetdir)/$$file && \ @@ -648,7 +725,7 @@ symlinks: $(targetdir) $(DATA) rm -f $(targetdir)/$$file && \ $(LN_S) function $(targetdir)/$$file ; \ done - for file in g++ c++ g77 gcj gpc cc ; do \ + for file in cc c++ g++ gfortran f77 g77 f95 g95 gcj gpc ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) gcc $(targetdir)/$$file ; \ done @@ -671,7 +748,7 @@ symlinks: $(targetdir) $(DATA) done for file in hd ; do \ rm -f $(targetdir)/$$file && \ - $(LN_S) hexdump $(targetdir)/$$file ; \ + $(LN_S) _hexdump $(targetdir)/$$file ; \ done for file in hping hping3 ; do \ rm -f $(targetdir)/$$file && \ @@ -719,6 +796,10 @@ symlinks: $(targetdir) $(DATA) rm -f $(targetdir)/$$file && \ $(LN_S) lvm $(targetdir)/$$file ; \ done + for file in lz4c ; do \ + rm -f $(targetdir)/$$file && \ + $(LN_S) lz4 $(targetdir)/$$file ; \ + done for file in clzip pdlzip plzip ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) lzip $(targetdir)/$$file ; \ @@ -775,7 +856,7 @@ symlinks: $(targetdir) $(DATA) rm -f $(targetdir)/$$file && \ $(LN_S) pm-hibernate $(targetdir)/$$file ; \ done - for file in createdb dropdb ; do \ + for file in createdb createuser dropdb dropuser ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) psql $(targetdir)/$$file ; \ done @@ -792,18 +873,30 @@ symlinks: $(targetdir) $(DATA) rm -f $(targetdir)/$$file && \ $(LN_S) puppet $(targetdir)/$$file ; \ done + for file in py.test-2 py.test-3 ; do \ + rm -f $(targetdir)/$$file && \ + $(LN_S) py.test $(targetdir)/$$file ; \ + done for file in pydoc3 ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) pydoc $(targetdir)/$$file ; \ done - for file in python2 python3 ; do \ + for file in pypy pypy3 python2 python3 micropython ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) python $(targetdir)/$$file ; \ done + for file in pyvenv-3.4 pyvenv-3.5 ; do \ + rm -f $(targetdir)/$$file && \ + $(LN_S) pyvenv $(targetdir)/$$file ; \ + done for file in dcop ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) qdbus $(targetdir)/$$file ; \ done + for file in qemu-kvm qemu-system-i386 qemu-system-x86_64 ; do \ + rm -f $(targetdir)/$$file && \ + $(LN_S) qemu $(targetdir)/$$file ; \ + done for file in setquota edquota quotacheck repquota quotaon quotaoff ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) quota $(targetdir)/$$file ; \ @@ -828,7 +921,7 @@ symlinks: $(targetdir) $(DATA) rm -f $(targetdir)/$$file && \ $(LN_S) sbcl $(targetdir)/$$file ; \ done - for file in slogin autossh sftp scp ; do \ + for file in slogin autossh sftp scp sidedoor ; do \ rm -f $(targetdir)/$$file && \ $(LN_S) ssh $(targetdir)/$$file ; \ done @@ -871,3 +964,11 @@ all-local: symlinks install-data-local: targetdir = $(DESTDIR)$(bashcompdir) install-data-local: symlinks + +check-local: + ret=0 + for file in $(bashcomp_DATA) ; do \ + $${bashcomp_bash:-$${BASH:-bash}} \ + -O extglob -n $$file || ret=$$? ; \ + done ; \ + exit $$ret diff --git a/completions/Makefile.in b/completions/Makefile.in deleted file mode 100644 index fef6ebc6..00000000 --- a/completions/Makefile.in +++ /dev/null @@ -1,1258 +0,0 @@ -# Makefile.in generated by automake 1.11.6 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ - esac; \ - test $$am__dry = yes; \ - } -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -subdir = completions -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -SOURCES = -DIST_SOURCES = -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(bashcompdir)" -DATA = $(bashcomp_DATA) -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -am__leading_dot = @am__leading_dot@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build_alias = @build_alias@ -builddir = @builddir@ -compatdir = @compatdir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -host_alias = @host_alias@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -bashcompdir = $(pkgdatadir)/completions -bashcomp_DATA = a2x \ - abook \ - aclocal \ - acpi \ - add_members \ - alias \ - ant \ - apache2ctl \ - apt-build \ - apt-cache \ - apt-get \ - aptitude \ - arch \ - arping \ - arpspoof \ - asciidoc \ - aspell \ - autoconf \ - automake \ - autoreconf \ - autorpm \ - autoscan \ - avctrl \ - badblocks \ - bk \ - brctl \ - btdownloadheadless.py \ - bzip2 \ - cal \ - cancel \ - cardctl \ - ccache \ - cfagent \ - cfrun \ - chage \ - change_pw \ - check_db \ - check_perms \ - chgrp \ - chkconfig \ - chown \ - chpasswd \ - chronyc \ - chrpath \ - chsh \ - cksfv \ - cleanarch \ - clisp \ - clone_member \ - complete \ - config_list \ - configure \ - convert \ - cowsay \ - cpan2dist \ - cpio \ - cppcheck \ - crontab \ - cryptsetup \ - curl \ - cvs \ - cvsps \ - dd \ - desktop-file-validate \ - dhclient \ - dict \ - dmesg \ - dnsspoof \ - dot \ - dpkg \ - dpkg-source \ - dselect \ - dsniff \ - dumpdb \ - dumpe2fs \ - e2freefrag \ - e2label \ - eject \ - eog \ - ether-wake \ - evince \ - explodepkg \ - export \ - faillog \ - fbgs \ - fbi \ - feh \ - file \ - file-roller \ - filefrag \ - filesnarf \ - find \ - find_member \ - freeciv-gtk2 \ - freeciv-server \ - function \ - fusermount \ - gcc \ - gcl \ - gdb \ - genaliases \ - gendiff \ - genisoimage \ - getent \ - gkrellm \ - gnatmake \ - gnome-mplayer \ - gpasswd \ - gpg \ - gpg2 \ - gphoto2 \ - gprof \ - groupadd \ - groupdel \ - groupmems \ - groupmod \ - growisofs \ - grpck \ - gzip \ - hcitool \ - hddtemp \ - hexdump \ - hid2hci \ - hping2 \ - htop \ - htpasswd \ - hwclock \ - iconv \ - id \ - idn \ - iftop \ - ifup \ - info \ - inject \ - insmod \ - installpkg \ - interdiff \ - invoke-rc.d \ - ionice \ - ip \ - iperf \ - ipmitool \ - ipsec \ - iptables \ - ipv6calc \ - iscsiadm \ - isql \ - iwconfig \ - iwlist \ - iwpriv \ - iwspy \ - jar \ - jarsigner \ - java \ - javaws \ - jps \ - k3b \ - kcov \ - kill \ - killall \ - kldload \ - kldunload \ - koji \ - ktutil \ - larch \ - lastlog \ - ldapsearch \ - ldapvi \ - lftp \ - lftpget \ - lilo \ - links \ - lintian \ - lisp \ - list_admins \ - list_lists \ - list_members \ - list_owners \ - look \ - lpq \ - lpr \ - lrzip \ - lsof \ - lua \ - luac \ - luseradd \ - luserdel \ - lvm \ - lzip \ - lzma \ - lzop \ - macof \ - mailmanctl \ - make \ - makepkg \ - man \ - mc \ - mcrypt \ - mdadm \ - mdtool \ - medusa \ - mii-diag \ - mii-tool \ - minicom \ - mkinitrd \ - mktemp \ - mmsitepass \ - modinfo \ - modprobe \ - monodevelop \ - mount \ - mount.linux \ - mplayer \ - msynctool \ - mtx \ - munindoc \ - 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 \ - pm-powersave \ - portinstall \ - portupgrade \ - postcat \ - postconf \ - postfix \ - postmap \ - postsuper \ - povray \ - prelink \ - protoc \ - psql \ - puppet \ - pwck \ - pwd \ - pwdx \ - pwgen \ - pydoc \ - pylint \ - python \ - qdbus \ - qemu \ - qrunner \ - querybts \ - quota \ - rcs \ - rdesktop \ - remove_members \ - removepkg \ - renice \ - reportbug \ - reptyr \ - resolvconf \ - rfkill \ - ri \ - rmlist \ - rmmod \ - route \ - rpcdebug \ - rpm \ - rpm2tgz \ - rpmcheck \ - rrdtool \ - rsync \ - rtcwake \ - sbcl \ - sbopkg \ - screen \ - sh \ - sitecopy \ - slackpkg \ - slapt-get \ - slapt-src \ - smartctl \ - smbclient \ - snownews \ - sqlite3 \ - ss \ - ssh \ - ssh-add \ - ssh-copy-id \ - sshfs \ - sshmitm \ - sshow \ - strace \ - strings \ - su \ - sudo \ - svcadm \ - svk \ - sync_members \ - sysbench \ - sysctl \ - tar \ - tcpdump \ - tcpkill \ - tcpnice \ - tracepath \ - tshark \ - tune2fs \ - umount \ - umount.linux \ - unace \ - unpack200 \ - unrar \ - unshunt \ - update-alternatives \ - update-rc.d \ - upgradepkg \ - urlsnarf \ - useradd \ - userdel \ - usermod \ - valgrind \ - vipw \ - vmstat \ - vncviewer \ - vpnc \ - watch \ - webmitm \ - wget \ - wine \ - withlist \ - wodim \ - wol \ - wsimport \ - wtf \ - wvdial \ - xfreerdp \ - xgamma \ - xhost \ - xm \ - xmllint \ - xmlwf \ - xmms \ - xmodmap \ - xrandr \ - xrdb \ - xsltproc \ - xxd \ - xz \ - xzdec \ - ypmatch \ - yum-arch - -EXTRA_DIST = $(bashcomp_DATA) \ - _mock _modules _subversion _udevadm _yum _yum-utils - -CLEANFILES = \ - aclocal-1.11 \ - alpine \ - alternatives \ - animate \ - apropos \ - arm-koji \ - asciidoc.py \ - autoheader \ - automake-1.11 \ - autossh \ - autoupdate \ - btdownloadcurses.py \ - btdownloadgui.py \ - c++ \ - cc \ - cdrecord \ - ci \ - ciptool \ - civclient \ - civserver \ - clzip \ - co \ - colormake \ - compare \ - compgen \ - composite \ - conjure \ - cowthink \ - createdb \ - dcop \ - declare \ - dfutool \ - display \ - dpkg-deb \ - dpkg-query \ - dpkg-reconfigure \ - dropdb \ - edquota \ - filebucket \ - freeciv-sdl \ - freeciv-xaw \ - g++ \ - g4 \ - g77 \ - gcj \ - gkrellm2 \ - gmake \ - gmplayer \ - gnumake \ - gpc \ - hciattach \ - hciconfig \ - hd \ - host \ - hping \ - hping3 \ - identify \ - ifdown \ - ifstatus \ - import \ - insmod.static \ - javac \ - javadoc \ - kplayer \ - l2ping \ - lbzip2 \ - ldapadd \ - ldapcompare \ - ldapdelete \ - ldapmodify \ - ldapmodrdn \ - ldappasswd \ - ldapwhoami \ - lintian-info \ - lusermod \ - lvchange \ - lvcreate \ - lvdisplay \ - lvextend \ - lvmdiskscan \ - lvreduce \ - lvremove \ - lvrename \ - lvresize \ - lvs \ - lvscan \ - mailsnarf \ - mdecrypt \ - mencoder \ - mkisofs \ - mogrify \ - montage \ - mplayer2 \ - msgsnarf \ - muttng \ - ncal \ - pbzip2 \ - pccardctl \ - pdlzip \ - perldoc \ - phing \ - pigz \ - pinfo \ - ping6 \ - pkg_deinstall \ - pkg_info \ - pkill \ - plzip \ - pm-suspend \ - pm-suspend-hybrid \ - pmake \ - postalias \ - ppc-koji \ - puppetca \ - puppetd \ - puppetdoc \ - puppetmasterd \ - puppetqd \ - puppetrun \ - pvchange \ - pvcreate \ - pvdisplay \ - pvmove \ - pvremove \ - pvs \ - pvscan \ - pxz \ - pydoc3 \ - python2 \ - python3 \ - quotacheck \ - quotaoff \ - quotaon \ - ralsh \ - rcsdiff \ - rdict \ - repquota \ - rfcomm \ - rlog \ - rpm2targz \ - rpm2txz \ - rpmbuild \ - rpmbuild-md5 \ - s390-koji \ - sbcl-mt \ - scp \ - sdptool \ - setquota \ - sftp \ - slogin \ - smbcacls \ - smbcquotas \ - smbget \ - smbpasswd \ - smbtar \ - smbtree \ - sparc-koji \ - spovray \ - stream \ - sudoedit \ - tightvncviewer \ - tracepath6 \ - typeset \ - vgcfgbackup \ - vgcfgrestore \ - vgchange \ - vgck \ - vgconvert \ - vgcreate \ - vgdisplay \ - vgexport \ - vgextend \ - vgimport \ - vgmerge \ - vgmknodes \ - vgreduce \ - vgremove \ - vgrename \ - vgs \ - vgscan \ - vgsplit \ - vigr \ - whatis \ - xpovray \ - xvnc4viewer \ - ypcat - -all: all-am - -.SUFFIXES: -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign completions/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign completions/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-bashcompDATA: $(bashcomp_DATA) - @$(NORMAL_INSTALL) - @list='$(bashcomp_DATA)'; test -n "$(bashcompdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bashcompdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bashcompdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(bashcompdir)'"; \ - $(INSTALL_DATA) $$files "$(DESTDIR)$(bashcompdir)" || exit $$?; \ - done - -uninstall-bashcompDATA: - @$(NORMAL_UNINSTALL) - @list='$(bashcomp_DATA)'; test -n "$(bashcompdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(bashcompdir)'; $(am__uninstall_files_from_dir) -tags: TAGS -TAGS: - -ctags: CTAGS -CTAGS: - - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(DATA) all-local -installdirs: - for dir in "$(DESTDIR)$(bashcompdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic mostlyclean-am - -distclean: distclean-am - -rm -f Makefile -distclean-am: clean-am distclean-generic - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-bashcompDATA install-data-local - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-generic - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-bashcompDATA - -.MAKE: install-am install-strip - -.PHONY: all all-am all-local check check-am clean clean-generic \ - distclean distclean-generic distdir dvi dvi-am html html-am \ - info info-am install install-am install-bashcompDATA \ - install-data install-data-am install-data-local install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic pdf pdf-am ps ps-am uninstall uninstall-am \ - uninstall-bashcompDATA - - -symlinks: $(targetdir) $(DATA) - for file in aclocal-1.11 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) aclocal $(targetdir)/$$file ; \ - done - for file in phing ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) ant $(targetdir)/$$file ; \ - done - for file in asciidoc.py ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) asciidoc $(targetdir)/$$file ; \ - done - for file in automake-1.11 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) automake $(targetdir)/$$file ; \ - done - for file in autoheader ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) autoreconf $(targetdir)/$$file ; \ - done - for file in autoupdate ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) autoscan $(targetdir)/$$file ; \ - done - for file in btdownloadcurses.py btdownloadgui.py ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) btdownloadheadless.py $(targetdir)/$$file ; \ - done - for file in lbzip2 pbzip2 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) bzip2 $(targetdir)/$$file ; \ - done - for file in ncal ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) cal $(targetdir)/$$file ; \ - done - for file in pccardctl ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) cardctl $(targetdir)/$$file ; \ - done - for file in compgen ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) complete $(targetdir)/$$file ; \ - done - for file in mogrify display animate identify montage composite \ - compare conjure import stream ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) convert $(targetdir)/$$file ; \ - done - for file in cowthink ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) cowsay $(targetdir)/$$file ; \ - done - for file in rdict ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) dict $(targetdir)/$$file ; \ - done - for file in dpkg-deb dpkg-query dpkg-reconfigure ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) dpkg $(targetdir)/$$file ; \ - done - for file in mailsnarf msgsnarf ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) filesnarf $(targetdir)/$$file ; \ - done - for file in civclient freeciv-sdl freeciv-xaw ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) freeciv-gtk2 $(targetdir)/$$file ; \ - done - for file in civserver ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) freeciv-server $(targetdir)/$$file ; \ - done - for file in declare typeset ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) function $(targetdir)/$$file ; \ - done - for file in g++ c++ g77 gcj gpc cc ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) gcc $(targetdir)/$$file ; \ - done - for file in mkisofs ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) genisoimage $(targetdir)/$$file ; \ - done - for file in gkrellm2 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) gkrellm $(targetdir)/$$file ; \ - done - for file in pigz ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) gzip $(targetdir)/$$file ; \ - done - for file in sdptool l2ping rfcomm ciptool dfutool hciconfig \ - hciattach ; do \ - 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 ; \ - done - for file in ifdown ifstatus ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) ifup $(targetdir)/$$file ; \ - done - for file in pinfo ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) info $(targetdir)/$$file ; \ - done - for file in insmod.static ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) insmod $(targetdir)/$$file ; \ - done - for file in javac javadoc ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) java $(targetdir)/$$file ; \ - done - for file in arm-koji ppc-koji s390-koji sparc-koji ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) koji $(targetdir)/$$file ; \ - done - for file in ldapadd ldapmodify ldapdelete ldapcompare ldapmodrdn \ - ldapwhoami ldappasswd ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) ldapsearch $(targetdir)/$$file ; \ - done - for file in lintian-info ; do \ - 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 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 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 - for file in apropos whatis ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) man $(targetdir)/$$file ; \ - done - for file in mdecrypt ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) mcrypt $(targetdir)/$$file ; \ - done - for file in mplayer2 mencoder gmplayer kplayer ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) mplayer $(targetdir)/$$file ; \ - done - for file in muttng ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) mutt $(targetdir)/$$file ; \ - done - for file in host ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) nslookup $(targetdir)/$$file ; \ - done - for file in g4 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) p4 $(targetdir)/$$file ; \ - done - for file in perldoc ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) perl $(targetdir)/$$file ; \ - done - for file in alpine ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) pine $(targetdir)/$$file ; \ - done - for file in ping6 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) ping $(targetdir)/$$file ; \ - done - for file in pkg_info pkg_deinstall ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) pkg_delete $(targetdir)/$$file ; \ - done - for file in pkill ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) pgrep $(targetdir)/$$file ; \ - done - for file in pm-suspend pm-suspend-hybrid ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) pm-hibernate $(targetdir)/$$file ; \ - done - for file in createdb dropdb ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) psql $(targetdir)/$$file ; \ - done - for file in postalias ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) postmap $(targetdir)/$$file ; \ - done - for file in xpovray spovray ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) povray $(targetdir)/$$file ; \ - done - for file in puppetmasterd puppetd puppetca ralsh puppetrun puppetqd \ - filebucket puppetdoc ; do \ - 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 ; \ - done - for file in dcop ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) qdbus $(targetdir)/$$file ; \ - done - for file in setquota edquota quotacheck repquota quotaon quotaoff ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) quota $(targetdir)/$$file ; \ - done - for file in ci co rlog rcsdiff ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) rcs $(targetdir)/$$file ; \ - done - for file in rpmbuild rpmbuild-md5 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) rpm $(targetdir)/$$file ; \ - done - for file in rpm2txz rpm2targz ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) rpm2tgz $(targetdir)/$$file ; \ - done - for file in smbget smbcacls smbcquotas smbpasswd smbtar smbtree ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) smbclient $(targetdir)/$$file ; \ - done - for file in sbcl-mt ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) sbcl $(targetdir)/$$file ; \ - done - for file in slogin autossh sftp scp ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) ssh $(targetdir)/$$file ; \ - done - for file in sudoedit ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) sudo $(targetdir)/$$file ; \ - done - for file in tracepath6 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) tracepath $(targetdir)/$$file ; \ - done - for file in alternatives ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) update-alternatives $(targetdir)/$$file ; \ - done - for file in vigr ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) vipw $(targetdir)/$$file ; \ - done - for file in tightvncviewer xvnc4viewer ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) vncviewer $(targetdir)/$$file ; \ - done - for file in cdrecord ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) wodim $(targetdir)/$$file ; \ - done - for file in pxz ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) xz $(targetdir)/$$file ; \ - done - for file in ypcat ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) ypmatch $(targetdir)/$$file ; \ - done -.PHONY: symlinks - -all-local: targetdir = . -all-local: symlinks - -install-data-local: targetdir = $(DESTDIR)$(bashcompdir) -install-data-local: symlinks - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/completions/_cal b/completions/_cal new file mode 100644 index 00000000..dfe49903 --- /dev/null +++ b/completions/_cal @@ -0,0 +1,37 @@ +# cal(1) completion -*- shell-script -*- + +# Use of this file is deprecated on Linux. Upstream completion is +# available in util-linux >= 2.23, use that instead. + +_cal() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -m) + if [[ $OSTYPE == *bsd* ]]; then + COMPREPLY=( $( compgen -W '{1..12}' -- "$cur" ) ) + return + fi + ;; + -s) + [[ $OSTYPE == *bsd* ]] && return + ;; + -A|-B|-d|-H) + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + return + fi + + local args + _count_args + [[ $args -eq 1 ]] && COMPREPLY=( $( compgen -W '{1..12}' -- "$cur" ) ) +} && +complete -F _cal cal ncal + +# ex: filetype=sh diff --git a/completions/_chfn b/completions/_chfn new file mode 100644 index 00000000..334967fa --- /dev/null +++ b/completions/_chfn @@ -0,0 +1,8 @@ +# chfn(1) completion -*- shell-script -*- + +# Use of this file is deprecated on Linux. Upstream completion is +# available in util-linux >= 2.23, use that instead. + +complete -u chfn + +# ex: filetype=sh diff --git a/completions/_chsh b/completions/_chsh new file mode 100644 index 00000000..88e8522e --- /dev/null +++ b/completions/_chsh @@ -0,0 +1,30 @@ +# chsh(1) completion -*- shell-script -*- + +# Use of this file is deprecated on Linux. Upstream completion is +# available in util-linux >= 2.23, use that instead. + +_chsh() +{ + local cur prev words cword + _init_completion || return + + case $prev in + --list-shells|--help|-v|--version) + return + ;; + -s|--shell) + _shells + return + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + else + _allowed_users + fi + +} && +complete -F _chsh chsh + +# ex: filetype=sh diff --git a/completions/_dmesg b/completions/_dmesg new file mode 100644 index 00000000..2ca7fdf1 --- /dev/null +++ b/completions/_dmesg @@ -0,0 +1,34 @@ +# dmesg(1) completion -*- shell-script -*- + +# Use of this file is deprecated on Linux. Upstream completion is +# available in util-linux >= 2.23, use that instead. + +_dmesg() +{ + [[ $OSTYPE == *solaris* ]] && return # no args there + + local cur prev words cword + _init_completion || return + + case $prev in + -h|--help|-V|--version|-s|--buffer-size|-M|-N) + return + ;; + -f|--facility) + COMPREPLY=( $( compgen -W 'kern user mail daemon auth syslog lpr + news' -- "$cur" ) ) + return + ;; + -l|--level|-n|--console-level) + COMPREPLY=( $( compgen -W '{1..8}' -- "$cur" ) ) + return + ;; + esac + + local opts=$( _parse_help "$1" ) + [[ $opts ]] || opts=$( _parse_usage "$1" ) + COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) +} && +complete -F _dmesg dmesg + +# ex: filetype=sh diff --git a/completions/_eject b/completions/_eject new file mode 100644 index 00000000..8f800f15 --- /dev/null +++ b/completions/_eject @@ -0,0 +1,33 @@ +# bash completion for eject(1) -*- shell-script -*- + +# Use of this file is deprecated on Linux. Upstream completion is +# available in util-linux >= 2.23, use that instead. + +_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: filetype=sh diff --git a/completions/_hexdump b/completions/_hexdump new file mode 100644 index 00000000..ed5cb08b --- /dev/null +++ b/completions/_hexdump @@ -0,0 +1,32 @@ +# hexdump(1) completion -*- shell-script -*- + +# Use of this file is deprecated on Linux. Upstream completion is +# available in util-linux >= 2.23, use that instead. + +_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: filetype=sh diff --git a/completions/_hwclock b/completions/_hwclock new file mode 100644 index 00000000..2d190283 --- /dev/null +++ b/completions/_hwclock @@ -0,0 +1,26 @@ +# hwclock(8) completion -*- shell-script -*- + +# Use of this file is deprecated. Upstream completion is available in +# util-linux >= 2.23, use that instead. + +_hwclock() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -h|--help|-V|--version|--date|--epoch) + return + ;; + -f|--rtc|--adjfile) + _filedir + return + ;; + esac + + COMPREPLY=( + $( PATH="$PATH:/sbin" compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) +} && +complete -F _hwclock hwclock + +# ex: filetype=sh diff --git a/completions/_ionice b/completions/_ionice new file mode 100644 index 00000000..9b378ee8 --- /dev/null +++ b/completions/_ionice @@ -0,0 +1,60 @@ +# ionice(1) completion -*- shell-script -*- + +# Use of this file is deprecated. Upstream completion is available in +# util-linux >= 2.23, use that instead. + +_ionice() +{ + local cur prev words cword + _init_completion || return + + local offset=0 i + for (( i=1; i <= cword; i++ )); do + case ${words[i]} in + -h) + return + ;; + -p) + offset=0 + break + ;; + -c|-n) + (( i++ )) + continue + ;; + -*) + continue + ;; + esac + offset=$i + break + done + + if [[ $offset -gt 0 ]]; then + _command_offset $offset + return + fi + + case $prev in + -c) + COMPREPLY=( $( compgen -W '{0..3}' -- "$cur" ) ) + return + ;; + -n) + COMPREPLY=( $( compgen -W '{0..7}' -- "$cur" ) ) + return + ;; + -p) + _pids + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) + return + fi +} && +complete -F _ionice ionice + +# ex: filetype=sh diff --git a/completions/_look b/completions/_look new file mode 100644 index 00000000..6ea41cce --- /dev/null +++ b/completions/_look @@ -0,0 +1,17 @@ +# look(1) completion -*- shell-script -*- + +# Use of this file is deprecated on Linux. Upstream completion is +# available in util-linux >= 2.23, use that instead. + +_look() +{ + local cur prev words cword + _init_completion || return + + if [[ $cword -eq 1 ]]; then + COMPREPLY=( $( compgen -W '$(look "$cur" 2>/dev/null)' -- "$cur" ) ) + fi +} && +complete -F _look -o default look + +# ex: filetype=sh diff --git a/completions/_mock b/completions/_mock index c616aed0..9649d306 100644 --- a/completions/_mock +++ b/completions/_mock @@ -24,20 +24,20 @@ _mock() case $prev in -h|--help|--copyin|--copyout|--arch|-D|--define|--with|--without|\ --uniqueext|--rpmbuild_timeout|--sources|--cwd) - return 0 + return ;; -r|--root) COMPREPLY=( $( compgen -W "$( command ls $cfgdir )" -- "$cur" ) ) COMPREPLY=( ${COMPREPLY[@]/%.cfg/} ) - return 0 + return ;; --configdir|--resultdir) _filedir -d - return 0 + return ;; --spec) _filedir spec - return 0 + return ;; --target) # Yep, compatible archs, not compatible build archs @@ -45,17 +45,17 @@ _mock() # This would actually depend on what the target root # can be used to build for... COMPREPLY=( $( compgen -W "$( command rpm --showrc | \ - sed -ne 's/^\s*compatible\s\s*archs\s*:\s*\(.*\)/\1/i p' )" \ + command sed -ne 's/^\s*compatible\s\s*archs\s*:\s*\(.*\)/\1/i p' )" \ -- "$cur" ) ) - return 0 + return ;; --enable-plugin|--disable-plugin) COMPREPLY=( $( compgen -W "$plugins" -- "$cur" ) ) - return 0 + return ;; esac - $split && return 0 + $split && return if [[ "$cur" == -* ]] ; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) @@ -66,4 +66,4 @@ _mock() } && complete -F _mock mock -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/_modules b/completions/_modules index b5a1d94a..9e48589b 100644 --- a/completions/_modules +++ b/completions/_modules @@ -23,13 +23,13 @@ _module_list () { - local modules="$( sed 's/:/ /g' <<<$LOADEDMODULES | sort )" + local modules="$( command sed 's/:/ /g' <<<$LOADEDMODULES | sort )" compgen -W "$modules" -- $1 } _module_path () { - local modules="$( sed 's/:/ /g' <<<$MODULEPATH | sort )" + local modules="$( command sed 's/:/ /g' <<<$MODULEPATH | sort )" compgen -W "$modules" -- $1 } @@ -38,7 +38,7 @@ _module_avail () local modules="$( \ module avail 2>&1 | \ command grep -E -v '^(-|$)' | \ - xargs printf '%s\n' | sed -e 's/(default)//g' | sort )" + xargs printf '%s\n' | command sed -e 's/(default)//g' | sort )" compgen -W "$modules" -- $1 } @@ -54,7 +54,7 @@ _module () local options options="$( module help 2>&1 | command grep -E '^[[:space:]]*\+' | \ - awk '{print $2}' | sed -e 's/|/ /g' | sort )" + awk '{print $2}' | command sed -e 's/|/ /g' | sort )" COMPREPLY=( $(compgen -W "$options" -- "$cur") ) @@ -77,8 +77,8 @@ _module () ;; esac fi - return 0 + } && complete -F _module -o default module -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/_newgrp b/completions/_newgrp new file mode 100644 index 00000000..0f0d3f93 --- /dev/null +++ b/completions/_newgrp @@ -0,0 +1,19 @@ +# newgrp(1) completion -*- shell-script -*- + +# Use of this file is deprecated on Linux. Upstream completion is +# available in util-linux >= 2.23, use that instead. + +_newgrp() +{ + local cur prev words cword + _init_completion || return + + if [[ "$cur" == "-" ]]; then + COMPREPLY=( - ) + else + _allowed_groups "$cur" + fi +} && +complete -F _newgrp newgrp + +# ex: filetype=sh diff --git a/completions/_nmcli b/completions/_nmcli new file mode 100644 index 00000000..f77f0505 --- /dev/null +++ b/completions/_nmcli @@ -0,0 +1,201 @@ +# nmcli completion -*- shell-script -*- + +# Use of this file is deprecated. Upstream completion is available in +# NetworkManager >= 0.9.8.0, use that instead. + +_nmcli_list() +{ + COMPREPLY=( $( compgen -W '$1' -- "$cur" ) ) +} + +_nmcli_con_id() +{ + local IFS=$'\n' + COMPREPLY=( $( compgen -W "$(nmcli con list 2>/dev/null | \ + tail -n +2 | awk -F ' {2,}' '{print $1 }')" -- "$cur" ) ) +} + +_nmcli_con_uuid() +{ + COMPREPLY=( $( compgen -W "$(nmcli con list 2>/dev/null | \ + tail -n +2 | awk -F ' {2,}' '{print $2}')" -- "$cur" ) ) +} + +_nmcli_ap_ssid() +{ + local IFS=$'\n' + COMPREPLY=( $( compgen -W "$(nmcli dev wifi list 2>/dev/null | \ + tail -n +2 | awk -F ' {2,}' '{print $1}')" -- "$cur" ) ) +} + +_nmcli_ab_bssid() +{ + COMPREPLY=( $( compgen -W "$(nmcli dev wifi list 2>/dev/null | \ + tail -n +2 | awk -F ' {2,}' '{print $2}')" -- "$cur" ) ) +} + +_nmcli() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -m|--mode) + COMPREPLY=( $( compgen -W 'tabular multiline' -- "$cur" ) ) + return + ;; + -f|--fields) + COMPREPLY=( $( compgen -W 'all common' -- "$cur" ) ) + return + ;; + -e|--escape) + _nmcli_list "yes no" + return + ;; + id) + _nmcli_con_id + return + ;; + uuid) + _nmcli_con_uuid + return + ;; + iface) + _available_interfaces + return + ;; + bssid) + _nmcli_ab_bssid + return + ;; + wep-key-type) + _nmcli_list "key phrase" + return + ;; + esac + + if [[ $cword -eq 1 ]] ; then + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--terse --pretty --mode --fields + --escape --version --help' -- "$cur" ) ) + else + COMPREPLY=( $( compgen -W "nm con dev" -- "$cur" ) ) + fi + else + local object=${words[1]} + local command=${words[2]} + + case $object in + nm) + case $command in + enable) + _nmcli_list "true false" + return + ;; + sleep) + _nmcli_list "true false" + return + ;; + wifi) + _nmcli_list "on off" + return + ;; + wwan) + _nmcli_list "on off" + return + ;; + wimax) + _nmcli_list "on off" + return + ;; + esac + + COMPREPLY=( $( compgen -W 'status permissions enable sleep + wifi wwan wimax' -- "$cur" ) ) + ;; + con) + case $command in + list) + COMPREPLY=( $( compgen -W 'id uuid' -- "$cur" ) ) + return + ;; + up) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--nowait --timeout' \ + -- "$cur" ) ) + else + COMPREPLY=( $( compgen -W 'id uuid iface ap nsp' \ + -- "$cur" ) ) + fi + return + ;; + down) + COMPREPLY=( $( compgen -W 'id uuid' -- "$cur" ) ) + return + ;; + delete) + COMPREPLY=( $( compgen -W 'id uuid' -- "$cur" ) ) + return + ;; + esac + + COMPREPLY=( $( compgen -W 'list status up down delete' \ + -- "$cur" ) ) + ;; + dev) + case $command in + list) + COMPREPLY=( $( compgen -W 'iface' -- "$cur" ) ) + return + ;; + disconnect) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--nowait --timeout' \ + -- "$cur" ) ) + else + COMPREPLY=( $( compgen -W 'iface' -- "$cur" ) ) + fi + return + ;; + wifi) + local subcommand=${words[3]} + + case $subcommand in + list) + COMPREPLY=( $( compgen -W 'iface bssid' \ + -- "$cur" ) ) + return + ;; + connect) + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--private + --nowait --timeout' -- "$cur" ) ) + else + if [[ "$prev" == "connect" ]]; then + _nmcli_ap_ssid + else + COMPREPLY=( $( compgen -W 'password + wep-key-type iface bssid name' \ + -- "$cur" ) ) + fi + fi + return + ;; + esac + + COMPREPLY=( $( compgen -W 'list connect' -- "$cur" ) ) + return + ;; + esac + + COMPREPLY=( $( compgen -W 'status list disconnect wifi' \ + -- "$cur" ) ) + ;; + esac + + fi + +} && +complete -F _nmcli nmcli + +# ex: filetype=sh diff --git a/completions/_renice b/completions/_renice new file mode 100644 index 00000000..1f1a6102 --- /dev/null +++ b/completions/_renice @@ -0,0 +1,32 @@ +# renice(8) completion -*- shell-script -*- + +# Use of this file is deprecated on Linux. Upstream completion is +# available in util-linux >= 2.23, use that instead. + +_renice() +{ + local cur prev words cword + _init_completion || return + + local command=$1 curopt i=0 + + # walk back through command line and find last option + while [[ $i -le $cword && ${#COMPREPLY[@]} -eq 0 ]]; do + curopt=${words[cword-$i]} + case "$curopt" in + -u) + _allowed_users + ;; + -g) + _pgids + ;; + -p|$command) + _pids + ;; + esac + i=$(( ++i )) + done +} && +complete -F _renice renice + +# ex: filetype=sh diff --git a/completions/_repomanage b/completions/_repomanage new file mode 100644 index 00000000..c1072e79 --- /dev/null +++ b/completions/_repomanage @@ -0,0 +1,24 @@ +# bash completion for repomanage -*- shell-script -*- + +# Use of this file is deprecated. Upstream completion is available in +# yum-utils >= 1.1.24, use that instead. + +_repomanage() +{ + local cur prev words cword split + _init_completion -s || return + + [[ "$prev" == -@([hk]|-help|-keep) ]] && return + + $split && return + + if [[ "$cur" == -* ]] ; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + else + _filedir -d + fi +} && +complete -F _repomanage repomanage + +# ex: filetype=sh diff --git a/completions/_reptyr b/completions/_reptyr new file mode 100644 index 00000000..4a087b49 --- /dev/null +++ b/completions/_reptyr @@ -0,0 +1,26 @@ +# bash completion for reptyr(1) -*- shell-script -*- + +# Use of this file is deprecated. Upstream completion is available in +# reptyr > 0.6.2, use that instead. + +_reptyr() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -l) + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + return + fi + + [[ $prev != +([0-9]) ]] && _pids +} && +complete -F _reptyr reptyr + +# ex: filetype=sh diff --git a/completions/_rtcwake b/completions/_rtcwake new file mode 100644 index 00000000..b03c1244 --- /dev/null +++ b/completions/_rtcwake @@ -0,0 +1,32 @@ +# bash completion for rtcwake -*- shell-script -*- + +# Use of this file is deprecated. Upstream completion is available in +# util-linux >= 2.23, use that instead. + +_rtcwake() +{ + local cur prev words cword split + _init_completion -s || return + + case "$prev" in + --help|-h|--version|-V|--seconds|-s|--time|-t) + return + ;; + --mode|-m) + COMPREPLY=( $( compgen -W 'standby mem disk on no off' -- "$cur" ) ) + return + ;; + --device|-d) + COMPREPLY=( $( command ls -d /dev/rtc?* 2>/dev/null ) ) + COMPREPLY=( $( compgen -W '${COMPREPLY[@]#/dev/}' -- "$cur" ) ) + return + ;; + esac + + $split && return + + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) +} && +complete -F _rtcwake rtcwake + +# ex: filetype=sh diff --git a/completions/_runuser b/completions/_runuser new file mode 100644 index 00000000..95cf930a --- /dev/null +++ b/completions/_runuser @@ -0,0 +1,8 @@ +# runuser(1) completion -*- shell-script -*- + +# Use of this file is deprecated on Linux. Upstream completion is +# available in util-linux >= 2.23, use that instead. + +complete -u runuser + +# ex: filetype=sh diff --git a/completions/_su b/completions/_su new file mode 100644 index 00000000..2b069498 --- /dev/null +++ b/completions/_su @@ -0,0 +1,41 @@ +# bash completion for su(1) -*- shell-script -*- + +# Use of this file is deprecated on Linux. Upstream completion is +# available in util-linux >= 2.23, use that instead. + +if [[ $OSTYPE != *linux* ]]; then + complete -u su # default completion + return +fi + +_su() # linux-specific completion +{ + local cur prev words cword split + _init_completion -s || return + + case "$prev" in + -s|--shell) + _shells + return + ;; + -c|--command|--session-command) + local IFS=$'\n' + compopt -o filenames + COMPREPLY=( $( compgen -d -c -- "$cur" ) ) + return + ;; + esac + + $split && return + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + fi + + COMPREPLY=( $( compgen -u -- "$cur" ) ) +} && +complete -F _su su + +# ex: filetype=sh diff --git a/completions/_subversion b/completions/_subversion deleted file mode 100644 index 2f1752c0..00000000 --- a/completions/_subversion +++ /dev/null @@ -1,344 +0,0 @@ -# svn completion -*- shell-script -*- - -# Use of this file is deprecated. Upstream completion is available in -# subversion >= 0.12.0, use that instead. - -_svn() -{ - local cur prev words cword - _init_completion || return - - local commands - commands='add blame praise annotate ann cat checkout co cleanup commit \ - ci copy cp delete del remove rm diff di export help ? h import \ - info list ls lock log merge mkdir move mv rename ren \ - propdel pdel pd propedit pedit pe propget pget pg \ - proplist plist pl propset pset ps resolved revert \ - status stat st switch sw unlock update up' - - if [[ $cword -eq 1 ]] ; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--version' -- "$cur" ) ) - else - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) - fi - else - - case $prev in - --config-dir) - _filedir -d - return 0 - ;; - -F|--file|--targets) - _filedir - return 0 - ;; - --encoding) - COMPREPLY=( $( compgen -W '$( iconv --list | \ - sed -e "s@//@@;" )' -- "$cur" ) ) - return 0 - ;; - --editor-cmd|--diff-cmd|--diff3-cmd) - words=(words[0] $cur) - cword=1 - _command - return 0 - ;; - esac - - local command=${words[1]} - - if [[ "$cur" == -* ]]; then - # possible options for the command - local options - case $command in - add) - options='--auto-props --no-auto-props --force --targets - --no-ignore --non-recursive --quiet' - ;; - blame|annotate|ann|praise) - options='--revision --username --password --no-auth-cache - --non-interactive --verbose --incremental --xml' - ;; - cat) - options='--revision --username --password --no-auth-cache - --non-interactive' - ;; - checkout|co) - options='--revision --quiet --non-recursive --username - --password --no-auth-cache --non-interactive - --ignore-externals' - ;; - cleanup) - options='--diff3-cmd' - ;; - commit|ci) - options='--message --file --encoding --force-log --quiet - --non-recursive --targets --editor-cmd --username - --password --no-auth-cache --non-interactive - --no-unlock' - ;; - copy|cp) - options='--message --file --encoding --force-log --revision - --quiet --editor-cmd -username --password - --no-auth-cache --non-interactive' - ;; - delete|del|remove|rm) - options='--force --message --file --encoding --force-log - --quiet --targets --editor-cmd --username - --password --no-auth-cache --non-interactive' - ;; - diff|di) - options='--revision --extensions --diff-cmd - --no-diff-deleted --non-recursive --username - --password --no-auth-cache --non-interactive - --force --old --new --notice-ancestry' - ;; - export) - options='--revision --quiet --username --password - --no-auth-cache --non-interactive --non-recursive - --force --native-eol --ignore-externals' - ;; - import) - options='--auto-props --no-auto-props --message --file - --encoding --force-log --quiet --non-recursive - --no-ignore --editor-cmd --username --password - --no-auth-cache --non-interactive' - ;; - info) - options='--username --password --no-auth-cache - --non-interactive --revision --xml --targets - --recursive --incremental' - ;; - list|ls) - options='--revision --verbose --recursive --username - --password --no-auth-cache --non-interactive - --incremental --xml' - ;; - lock) - options='--message --file --encoding --force-log --targets - --force --username --password --no-auth-cache - --non-interactive' - ;; - log) - options='--revision --verbose --targets --username - --password --no-auth-cache --non-interactive - --stop-on-copy --incremental --xml --quiet - --limit' - ;; - merge) - options='--revision --non-recursive --quiet --force - --dry-run --diff3-cmd --username --password - --no-auth-cache --non-interactive - --ignore-ancestry' - ;; - mkdir) - options='--message --file --encoding --force-log --quiet - --editor-cmd --username --password --no-auth-cache - --non-interactive' - ;; - move|mv|rename|ren) - options='--message --file --encoding --force-log --revision - --quiet --force --editor-cmd --username --password - --no-auth-cache --non-interactive' - ;; - propdel|pdel|pd) - options='--quiet --recursive --revision --revprop - --username --password --no-auth-cache - --non-interactive' - ;; - propedit|pedit|pe) - options='--revision --revprop --encoding --editor-cmd - --username --password --no-auth-cache - --non-interactive --force' - ;; - propget|pget|pg) - options='--recursive --revision --revprop --strict - --username --password --no-auth-cache - --non-interactive' - ;; - proplist|plist|pl) - options='--verbose --recursive --revision --revprop --quiet - --username --password --no-auth-cache - --non-interactive' - ;; - propset|pset|ps) - options='--file --quiet --targets --recursive --revprop - --encoding --username --password --no-auth-cache - --non-interactive --revision --force' - ;; - resolved) - options='--targets --recursive --quiet' - ;; - revert) - options='--targets --recursive --quiet' - ;; - status|stat|st) - options='--show-updates --verbose --non-recursive --quiet - --username --password --no-auth-cache - --non-interactive --no-ignore --ignore-externals - --incremental --xml' - ;; - switch|sw) - options='--relocate --revision --non-recursive --quiet - --username --password --no-auth-cache - --non-interactive --diff3-cmd' - ;; - unlock) - options='--targets --force --username --password - --no-auth-cache --non-interactive' - ;; - update|up) - options='--revision --non-recursive --quiet --username - --password --no-auth-cache --non-interactive - --diff3-cmd --ignore-externals' - ;; - esac - options+=" --help --config-dir" - - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) - else - if [[ "$command" == @(help|h|\?) ]]; then - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) - else - _filedir - fi - fi - fi - - return 0 -} && -complete -F _svn svn - -_svnadmin() -{ - local cur prev words cword - _init_completion || return - - local commands - commands='create deltify dump help ? hotcopy list-dblogs list-unused-dblogs - load lslocks lstxns recover rmlocks rmtxns setlog verify' - - if [[ $cword -eq 1 ]] ; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--version' -- "$cur" ) ) - else - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) - fi - else - case $prev in - --config-dir) - _filedir -d - return 0 - ;; - --fs-type) - COMPREPLY=( $( compgen -W 'fsfs bdb' -- "$cur" ) ) - return 0 - ;; - esac - - local command=${words[1]} - - if [[ "$cur" == -* ]]; then - # possible options for the command - local options - case $command in - create) - options='--bdb-txn-nosync --bdb-log-keep --config-dir - --fs-type' - ;; - deltify) - options='--revision --quiet' - ;; - dump) - options='--revision --incremental --quiet --deltas' - ;; - hotcopy) - options='--clean-logs' - ;; - load) - options='--ignore-uuid --force-uuid --parent-dir --quiet - --use-pre-commit-hook --use-post-commit-hook' - ;; - rmtxns) - options='--quiet' - ;; - setlog) - options='--revision --bypass-hooks' - ;; - esac - - options+=" --help" - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) - else - if [[ "$command" == @(help|h|\?) ]]; then - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) - else - _filedir - fi - fi - fi - - return 0 -} && -complete -F _svnadmin -o default svnadmin - -_svnlook() -{ - local cur prev words cword - _init_completion || return - - local commands - commands='author cat changed date diff dirs-changed help ? h history info - lock log propget pget pg proplist plist pl tree uuid youngest' - - if [[ $cword -eq 1 ]] ; then - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--version' -- "$cur" ) ) - else - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) - fi - else - local command=${words[1]} - - if [[ "$cur" == -* ]]; then - # possible options for the command - local options - case $command in - author|cat|date|dirs-changed|info|log) - options='--revision --transaction' - ;; - changed) - options='--revision --transaction --copy-info' - ;; - diff) - options='--revision --transaction --no-diff-deleted - --no-diff-added --diff-copy-from' - ;; - history) - options='--revision --show-ids' - ;; - propget|proplist) - options='--revision --transaction --revprop' - ;; - tree) - options='--revision --transaction --show-ids --full-paths' - ;; - esac - - options+=" --help" - COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) - else - if [[ "$command" == @(help|h|\?) ]]; then - COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) - else - _filedir - fi - fi - fi - - return 0 -} && -complete -F _svnlook -o default svnlook - -# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/_svn b/completions/_svn new file mode 100644 index 00000000..37b6b2b4 --- /dev/null +++ b/completions/_svn @@ -0,0 +1,212 @@ +# svn completion -*- shell-script -*- + +# Use of this file is deprecated. Upstream completion is available in +# subversion >= 0.12.0, use that instead. + +_svn() +{ + local cur prev words cword + _init_completion || return + + local commands + commands='add blame praise annotate ann cat checkout co cleanup commit \ + ci copy cp delete del remove rm diff di export help ? h import \ + info list ls lock log merge mkdir move mv rename ren \ + propdel pdel pd propedit pedit pe propget pget pg \ + proplist plist pl propset pset ps resolved revert \ + status stat st switch sw unlock update up' + + if [[ $cword -eq 1 ]] ; then + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--version' -- "$cur" ) ) + else + COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + fi + else + + case $prev in + --config-dir) + _filedir -d + return + ;; + -F|--file|--targets) + _filedir + return + ;; + --encoding) + COMPREPLY=( $( compgen -W '$( iconv --list | \ + command sed -e "s@//@@;" )' -- "$cur" ) ) + return + ;; + --editor-cmd|--diff-cmd|--diff3-cmd) + words=(words[0] $cur) + cword=1 + _command + return + ;; + esac + + local command=${words[1]} + + if [[ "$cur" == -* ]]; then + # possible options for the command + local options + case $command in + add) + options='--auto-props --no-auto-props --force --targets + --no-ignore --non-recursive --quiet' + ;; + blame|annotate|ann|praise) + options='--revision --username --password --no-auth-cache + --non-interactive --verbose --incremental --xml' + ;; + cat) + options='--revision --username --password --no-auth-cache + --non-interactive' + ;; + checkout|co) + options='--revision --quiet --non-recursive --username + --password --no-auth-cache --non-interactive + --ignore-externals' + ;; + cleanup) + options='--diff3-cmd' + ;; + commit|ci) + options='--message --file --encoding --force-log --quiet + --non-recursive --targets --editor-cmd --username + --password --no-auth-cache --non-interactive + --no-unlock' + ;; + copy|cp) + options='--message --file --encoding --force-log --revision + --quiet --editor-cmd -username --password + --no-auth-cache --non-interactive' + ;; + delete|del|remove|rm) + options='--force --message --file --encoding --force-log + --quiet --targets --editor-cmd --username + --password --no-auth-cache --non-interactive' + ;; + diff|di) + options='--revision --extensions --diff-cmd + --no-diff-deleted --non-recursive --username + --password --no-auth-cache --non-interactive + --force --old --new --notice-ancestry' + ;; + export) + options='--revision --quiet --username --password + --no-auth-cache --non-interactive --non-recursive + --force --native-eol --ignore-externals' + ;; + import) + options='--auto-props --no-auto-props --message --file + --encoding --force-log --quiet --non-recursive + --no-ignore --editor-cmd --username --password + --no-auth-cache --non-interactive' + ;; + info) + options='--username --password --no-auth-cache + --non-interactive --revision --xml --targets + --recursive --incremental' + ;; + list|ls) + options='--revision --verbose --recursive --username + --password --no-auth-cache --non-interactive + --incremental --xml' + ;; + lock) + options='--message --file --encoding --force-log --targets + --force --username --password --no-auth-cache + --non-interactive' + ;; + log) + options='--revision --verbose --targets --username + --password --no-auth-cache --non-interactive + --stop-on-copy --incremental --xml --quiet + --limit' + ;; + merge) + options='--revision --non-recursive --quiet --force + --dry-run --diff3-cmd --username --password + --no-auth-cache --non-interactive + --ignore-ancestry' + ;; + mkdir) + options='--message --file --encoding --force-log --quiet + --editor-cmd --username --password --no-auth-cache + --non-interactive' + ;; + move|mv|rename|ren) + options='--message --file --encoding --force-log --revision + --quiet --force --editor-cmd --username --password + --no-auth-cache --non-interactive' + ;; + propdel|pdel|pd) + options='--quiet --recursive --revision --revprop + --username --password --no-auth-cache + --non-interactive' + ;; + propedit|pedit|pe) + options='--revision --revprop --encoding --editor-cmd + --username --password --no-auth-cache + --non-interactive --force' + ;; + propget|pget|pg) + options='--recursive --revision --revprop --strict + --username --password --no-auth-cache + --non-interactive' + ;; + proplist|plist|pl) + options='--verbose --recursive --revision --revprop --quiet + --username --password --no-auth-cache + --non-interactive' + ;; + propset|pset|ps) + options='--file --quiet --targets --recursive --revprop + --encoding --username --password --no-auth-cache + --non-interactive --revision --force' + ;; + resolved) + options='--targets --recursive --quiet' + ;; + revert) + options='--targets --recursive --quiet' + ;; + status|stat|st) + options='--show-updates --verbose --non-recursive --quiet + --username --password --no-auth-cache + --non-interactive --no-ignore --ignore-externals + --incremental --xml' + ;; + switch|sw) + options='--relocate --revision --non-recursive --quiet + --username --password --no-auth-cache + --non-interactive --diff3-cmd' + ;; + unlock) + options='--targets --force --username --password + --no-auth-cache --non-interactive' + ;; + update|up) + options='--revision --non-recursive --quiet --username + --password --no-auth-cache --non-interactive + --diff3-cmd --ignore-externals' + ;; + esac + options+=" --help --config-dir" + + COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + else + if [[ "$command" == @(help|[h?]) ]]; then + COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + else + _filedir + fi + fi + fi + +} && +complete -F _svn svn + +# ex: filetype=sh diff --git a/completions/_svnadmin b/completions/_svnadmin new file mode 100644 index 00000000..395ae119 --- /dev/null +++ b/completions/_svnadmin @@ -0,0 +1,78 @@ +# svnadmin completion -*- shell-script -*- + +# Use of this file is deprecated. Upstream completion is available in +# subversion >= 0.12.0, use that instead. + +_svnadmin() +{ + local cur prev words cword + _init_completion || return + + local commands + commands='create deltify dump help ? hotcopy list-dblogs list-unused-dblogs + load lslocks lstxns recover rmlocks rmtxns setlog verify' + + if [[ $cword -eq 1 ]] ; then + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--version' -- "$cur" ) ) + else + COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + fi + else + case $prev in + --config-dir) + _filedir -d + return + ;; + --fs-type) + COMPREPLY=( $( compgen -W 'fsfs bdb' -- "$cur" ) ) + return + ;; + esac + + local command=${words[1]} + + if [[ "$cur" == -* ]]; then + # possible options for the command + local options + case $command in + create) + options='--bdb-txn-nosync --bdb-log-keep --config-dir + --fs-type' + ;; + deltify) + options='--revision --quiet' + ;; + dump) + options='--revision --incremental --quiet --deltas' + ;; + hotcopy) + options='--clean-logs' + ;; + load) + options='--ignore-uuid --force-uuid --parent-dir --quiet + --use-pre-commit-hook --use-post-commit-hook' + ;; + rmtxns) + options='--quiet' + ;; + setlog) + options='--revision --bypass-hooks' + ;; + esac + + options+=" --help" + COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + else + if [[ "$command" == @(help|[h?]) ]]; then + COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + else + _filedir + fi + fi + fi + +} && +complete -F _svnadmin -o default svnadmin + +# ex: filetype=sh diff --git a/completions/_svnlook b/completions/_svnlook new file mode 100644 index 00000000..a4f34243 --- /dev/null +++ b/completions/_svnlook @@ -0,0 +1,63 @@ +# svnlook completion -*- shell-script -*- + +# Use of this file is deprecated. Upstream completion is available in +# subversion >= 0.12.0, use that instead. + +_svnlook() +{ + local cur prev words cword + _init_completion || return + + local commands + commands='author cat changed date diff dirs-changed help ? h history info + lock log propget pget pg proplist plist pl tree uuid youngest' + + if [[ $cword -eq 1 ]] ; then + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '--version' -- "$cur" ) ) + else + COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + fi + else + local command=${words[1]} + + if [[ "$cur" == -* ]]; then + # possible options for the command + local options + case $command in + author|cat|date|dirs-changed|info|log) + options='--revision --transaction' + ;; + changed) + options='--revision --transaction --copy-info' + ;; + diff) + options='--revision --transaction --no-diff-deleted + --no-diff-added --diff-copy-from' + ;; + history) + options='--revision --show-ids' + ;; + propget|proplist) + options='--revision --transaction --revprop' + ;; + tree) + options='--revision --transaction --show-ids --full-paths' + ;; + esac + + options+=" --help" + COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) + else + if [[ "$command" == @(help|[h?]) ]]; then + COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) ) + else + _filedir + fi + fi + fi + +} && +complete -F _svnlook -o default svnlook + +# ex: filetype=sh diff --git a/completions/_udevadm b/completions/_udevadm index 51ec0e5d..80424dca 100644 --- a/completions/_udevadm +++ b/completions/_udevadm @@ -61,7 +61,7 @@ _udevadm() ;; *) COMPREPLY=( $( compgen -W "$( "$1" --help 2>/dev/null | - awk '/^[[:space:]]+/ { print $1 }' )" -- "$cur" ) ) + awk '/^[ \t]/ { print $1 }' )" -- "$cur" ) ) ;; esac return @@ -76,4 +76,4 @@ _udevadm() } && complete -F _udevadm udevadm -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/_write b/completions/_write new file mode 100644 index 00000000..49e56ffe --- /dev/null +++ b/completions/_write @@ -0,0 +1,8 @@ +# write(1) completion -*- shell-script -*- + +# Use of this file is deprecated on Linux. Upstream completion is +# available in util-linux >= 2.23, use that instead. + +complete -u write + +# ex: filetype=sh diff --git a/completions/_yum b/completions/_yum index 7b3f76a4..f3a104bd 100644 --- a/completions/_yum +++ b/completions/_yum @@ -9,12 +9,12 @@ _yum_list() # Try to strip in between headings like "Available Packages" # This will obviously only work for English :P COMPREPLY=( $( yum -d 0 -C list $1 "$cur*" 2>/dev/null | \ - sed -ne '/^Available /d' -e '/^Installed /d' -e '/^Updated /d' \ + command sed -ne '/^Available /d' -e '/^Installed /d' -e '/^Updated /d' \ -e 's/[[:space:]].*//p' ) ) else # Drop first line (e.g. "Updated Packages") COMPREPLY=( $( yum -d 0 -C list $1 "$cur*" 2>/dev/null | \ - sed -ne 1d -e 's/[[:space:]].*//p' ) ) + command sed -ne 1d -e 's/[[:space:]].*//p' ) ) fi } @@ -24,13 +24,13 @@ _yum_repolist() # http://yum.baseurl.org/ticket/83 # Drop first ("repo id repo name") and last ("repolist: ...") rows yum --noplugins -C repolist $1 2>/dev/null | \ - sed -ne '/^repo\s\s*id/d' -e '/^repolist:/d' -e 's/[[:space:]].*//p' + command sed -ne '/^repo\s\s*id/d' -e '/^repolist:/d' -e 's/[[:space:]].*//p' } _yum_plugins() { command ls /usr/lib/yum-plugins/*.py{,c,o} 2>/dev/null \ - | sed -ne 's|.*/\([^./]*\)\.py[co]\{0,1\}$|\1|p' | sort -u + | command sed -ne 's|.*/\([^./]*\)\.py[co]\{0,1\}$|\1|p' | sort -u } _yum() @@ -50,25 +50,25 @@ _yum() if [[ "$cur" == @(*/|[.~])* && \ "$special" == @(deplist|install|update|upgrade) ]]; then _filedir rpm - return 0 + return fi case $special in install) _yum_list available - return 0 + return ;; deplist|info) _yum_list all - return 0 + return ;; upgrade|update) _yum_list updates - return 0 + return ;; remove|erase) # _rpm_installed_packages is not arch-qualified _yum_list installed - return 0 + return ;; esac fi @@ -117,11 +117,11 @@ _yum() ;; -R|-x|--exclude) # argument required but no completions available - return 0 + return ;; -h|--help|--version) # no other options useful with these - return 0 + return ;; *) COMPREPLY=( $( compgen -W 'install update check-update upgrade @@ -132,14 +132,13 @@ _yum() ;; esac - $split && return 0 + $split && return if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace - return 0 fi } && complete -F _yum yum -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/_yum-utils b/completions/_yum-utils deleted file mode 100644 index 22b97af8..00000000 --- a/completions/_yum-utils +++ /dev/null @@ -1,24 +0,0 @@ -# bash completion for repomanage -*- shell-script -*- - -# Use of this file is deprecated. Upstream completion is available in -# yum-utils >= 1.1.24, use that instead. - -_repomanage() -{ - local cur prev words cword split - _init_completion -s || return - - [[ "$prev" == -@(h|-help|k|-keep) ]] && return 0 - - $split && return - - if [[ "$cur" == -* ]] ; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - [[ $COMPREPLY == *= ]] && compopt -o nospace - else - _filedir -d - fi -} && -complete -F _repomanage repomanage - -# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/a2x b/completions/a2x index 7c330908..06c7c3a4 100644 --- a/completions/a2x +++ b/completions/a2x @@ -37,4 +37,4 @@ _a2x() } && complete -F _a2x a2x -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/abook b/completions/abook index 07a0f090..4bb0e8e3 100644 --- a/completions/abook +++ b/completions/abook @@ -10,43 +10,40 @@ _abook() { compopt -o nospace COMPREPLY=( "-" ) - return 0 + return } case $cur in -*) - _longopt abook - return 0 + _longopt "$1" + return ;; esac case $prev in --informat) - COMPREPLY=( $( compgen -W "$(abook --formats | \ - sed -n -e 's/^\t\([a-z]*\).*/\1/p' -e '/^$/q')" -- "$cur" ) ) - return 0 + COMPREPLY=( $( compgen -W "$($1 --formats | \ + command sed -n -e 's/^'$'\t''\([a-z]*\).*/\1/p' -e '/^$/q')" \ + -- "$cur" ) ) ;; --outformat) - COMPREPLY=( $( compgen -W "$(abook --formats | \ - sed -n -e '/^$/,$s/^\t\([a-z]*\).*/\1/p')" -- "$cur" ) ) - return 0 + COMPREPLY=( $( compgen -W "$($1 --formats | \ + command sed -n -e '/^$/,$s/^'$'\t''\([a-z]*\).*/\1/p')" \ + -- "$cur" ) ) ;; --infile) COMPREPLY=( $( compgen -W stdin -- "$cur" ) ) _filedir - return 0 ;; --outfile) COMPREPLY=( $( compgen -W stdout -- "$cur" ) ) _filedir - return 0 ;; --config|--datafile) _filedir - return 0 ;; esac } && complete -F _abook abook -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/aclocal b/completions/aclocal index 2bbc3152..7a3d6467 100644 --- a/completions/aclocal +++ b/completions/aclocal @@ -7,29 +7,29 @@ _aclocal() case "$prev" in --help|--print-ac-dir|--version) - return 0 + return ;; --acdir|-I) _filedir -d - return 0 + return ;; --output) _filedir - return 0 + return ;; --warnings|-W) local cats=( syntax unsupported ) COMPREPLY=( $( compgen -W \ '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) ) - return 0 + return ;; esac - $split && return 0 + $split && return COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace } && -complete -F _aclocal aclocal aclocal-1.11 +complete -F _aclocal aclocal aclocal-1.1{0..5} -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/acpi b/completions/acpi index 16ae0d6e..b748cbde 100644 --- a/completions/acpi +++ b/completions/acpi @@ -19,4 +19,4 @@ _acpi() } && complete -F _acpi acpi -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/adb b/completions/adb new file mode 100644 index 00000000..d069b425 --- /dev/null +++ b/completions/adb @@ -0,0 +1,66 @@ +# adb completion -*- shell-script -*- + +_adb_command_usage() +{ + COMPREPLY=( $( compgen -W \ + '$( "$1" help 2>&1 | command grep "^ *\(adb \)\? *$2 " \ + | command sed -e "s/[]|[]/\n/g" | _parse_help - )' -- "$cur" ) ) +} + +_adb() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -s|-p|--algo|--key|--iv) + return + ;; + -f) + _filedir + return + ;; + esac + + local cmd i + for (( i=1; i < cword; i++ )); do + if [[ "${words[i]}" != -* && "${words[i-1]}" != -[sp] ]]; then + cmd="${words[i]}" + break + fi + done + + if [[ ! "$cmd" ]]; then + local tmp=() + if [[ ! $cur || $cur == -* ]]; then + tmp+=( $( compgen -W '$( _parse_help "$1" help )' -- "$cur" ) ) + fi + if [[ ! $cur || $cur != -* ]]; then + tmp+=( $( $1 help 2>&1 | awk '$1 == "adb" { print $2 }' ) ) + tmp+=( devices connect disconnect sideload ) + fi + COMPREPLY=( $( compgen -W '${tmp[@]}' -- "$cur" ) ) + return + fi + + # TODO: more and better command completions + + _adb_command_usage "$1" $cmd + + case $cmd in + push|restore|sideload) + _filedir + ;; + forward) + COMPREPLY=( $( compgen -W \ + '$( "$1" help 2>&1 | command sed -ne "s/^ *adb *forward *-/-/p" | \ + _parse_help - )' -- "$cur" ) ) + ;; + reboot) + COMPREPLY=( $( compgen -W 'bootloader recovery' -- "$cur" ) ) + ;; + esac +} && +complete -F _adb adb + +# ex: filetype=sh diff --git a/completions/add_members b/completions/add_members index 70b916be..d582d94b 100644 --- a/completions/add_members +++ b/completions/add_members @@ -8,15 +8,15 @@ _add_members() case $prev in -r|-d|--regular-members-file|--digest-members-file) _filedir - return 0 + return ;; -w|-a|--welcome-msg|--admin-notify) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) - return 0 + return ;; esac - $split && return 0 + $split && return if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '--regular-members-file --digest-members-file @@ -28,4 +28,4 @@ _add_members() } && complete -F _add_members add_members -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/alias b/completions/alias index 112dea3b..de2a57e8 100644 --- a/completions/alias +++ b/completions/alias @@ -10,11 +10,11 @@ _alias() COMPREPLY=( $( compgen -A alias -- "$cur" ) ) ;; *=) - COMPREPLY=( "$( alias ${cur%=} 2>/dev/null | sed \ + COMPREPLY=( "$( alias ${cur%=} 2>/dev/null | command sed \ -e 's|^alias '"$cur"'\(.*\)$|\1|' )" ) ;; esac } && complete -F _alias -o nospace alias -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/ant b/completions/ant index dd3606dc..639cde97 100644 --- a/completions/ant +++ b/completions/ant @@ -1,38 +1,66 @@ # bash completion for ant and phing -*- shell-script -*- +_ant_parse_targets() +{ + local line basedir + + [[ $1 == */* ]] && basedir=${1%/*} || basedir=. + + # parse buildfile for targets + while read -rd '>' line; do + if [[ $line =~ \<(target|extension-point)[[:space:]].*name=[\"\']([^\"\']+) ]]; then + targets+=" ${BASH_REMATCH[2]}" + fi + done < $1 + + # parse imports + while read -rd '>' line; do + if [[ $line =~ \' line; do - [[ $line =~ \ - \<(targe|extension-poin)t[[:space:]].*name=[\"\']([^\"\']+) ]] \ - && targets+=" ${BASH_REMATCH[2]}" - done < $buildfile COMPREPLY=( $( compgen -W '$targets' -- "$cur" ) ) fi } && @@ -61,4 +96,4 @@ complete -F _ant ant phing type complete-ant-cmd.pl &>/dev/null && \ complete -C complete-ant-cmd.pl -F _ant ant || : -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/apache2ctl b/completions/apache2ctl index f6fdeb30..74789744 100644 --- a/completions/apache2ctl +++ b/completions/apache2ctl @@ -6,11 +6,11 @@ _apache2ctl() _init_completion || return local APWORDS - APWORDS=$(apache2ctl 2>&1 >/dev/null | awk 'NR<2 { print $3; exit }' | \ + APWORDS=$($1 2>&1 >/dev/null | awk 'NR<2 { print $3; exit }' | \ tr "|" " ") COMPREPLY=( $( compgen -W "$APWORDS" -- "$cur" ) ) } && complete -F _apache2ctl apache2ctl -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/appdata-validate b/completions/appdata-validate new file mode 100644 index 00000000..3285a3b3 --- /dev/null +++ b/completions/appdata-validate @@ -0,0 +1,32 @@ +# appdata-validate(1) completion -*- shell-script -*- + +_appdata_validate() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + -h|--help|--version) + return + ;; + --output-format) + COMPREPLY=( $( compgen -W "$( $1 --help | + command sed -ne 's/--output-format.*\[\(.*\)\]/\1/' -e 's/|/ /gp' )" \ + -- "$cur" ) ) + return + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + fi + + _filedir appdata.xml +} && +complete -F _appdata_validate appdata-validate + +# ex: filetype=sh diff --git a/completions/apt-build b/completions/apt-build index 3812b20d..0723bcc4 100644 --- a/completions/apt-build +++ b/completions/apt-build @@ -16,27 +16,23 @@ _apt_build() case $special in install|source|info) COMPREPLY=( $( apt-cache pkgnames "$cur" 2> /dev/null ) ) - return 0 ;; remove) COMPREPLY=( \ $( _xfunc dpkg _comp_dpkg_installed_packages "$cur" ) ) - return 0 - ;; - *) - return 0 ;; esac + return fi case $prev in - --patch|--build-dir|--repository-dir) - _filedir - return 0 - ;; - -h|--help) - return 0 - ;; + --patch|--build-dir|--repository-dir) + _filedir + return + ;; + -h|--help) + return + ;; esac if [[ "$cur" == -* ]]; then @@ -51,9 +47,7 @@ _apt_build() -- "$cur" ) ) fi - - return 0 } && complete -F _apt_build apt-build -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/apt-cache b/completions/apt-cache index 085a964d..bedae4e9 100644 --- a/completions/apt-cache +++ b/completions/apt-cache @@ -1,5 +1,20 @@ # Debian apt-cache(8) completion -*- shell-script -*- +# List APT binary packages +_apt_cache_packages() { + apt-cache --no-generate pkgnames "$cur" 2> /dev/null +} + +# List APT source packages +_apt_cache_sources() { + apt-cache dumpavail | command grep "^Source: $1" | cut -f2 -d" " | sort -u +} + +# List APT source packages +_apt_cache_src_packages() { + compgen -W '$( _apt_cache_sources "$cur" )' -- "$cur" +} + _apt_cache() { local cur prev words cword @@ -19,34 +34,31 @@ _apt_cache() case $special in add) _filedir - return 0 ;; showsrc) - COMPREPLY=( $( apt-cache dumpavail | \ - command grep "^Source: $cur" | sort -u | cut -f2 -d" " ) ) - return 0 + COMPREPLY=( $( _apt_cache_sources "$cur" ) ) ;; *) - COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" 2> /dev/null ) ) - return 0 + COMPREPLY=( $( _apt_cache_packages ) ) ;; esac + return fi case $prev in - -c|-p|-s|--config-file|--pkg-cache|--src-cache) - _filedir - return 0 - ;; - search) - if [[ "$cur" != -* ]]; then - return 0 - fi - ;; + -c|-p|-s|--config-file|--pkg-cache|--src-cache) + _filedir + return + ;; + search) + if [[ "$cur" != -* ]]; then + return + fi + ;; esac if [[ "$cur" == -* ]]; then @@ -64,9 +76,7 @@ _apt_cache() fi - - return 0 } && complete -F _apt_cache apt-cache -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/apt-get b/completions/apt-get index 8fe36f13..ce951050 100644 --- a/completions/apt-get +++ b/completions/apt-get @@ -23,33 +23,31 @@ _apt_get() # assume RPM based _xfunc rpm _rpm_installed_packages fi - return 0 ;; source) COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" \ 2> /dev/null ) $( apt-cache dumpavail | \ command grep "^Source: $cur" | sort -u | cut -f2 -d" " ) ) - return 0 ;; *) COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" \ 2> /dev/null ) ) - return 0 ;; esac + return fi case $prev in -c|--config-file) - _filedir - return 0 - ;; + _filedir + return + ;; -t|--target-release|--default-release) - COMPREPLY=( $( apt-cache policy | \ - command grep "release.o=Debian,a=$cur" | \ - sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2> /dev/null) ) - return 0 - ;; + COMPREPLY=( $( apt-cache policy | \ + command grep "release.o=Debian,a=$cur" | \ + command sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2> /dev/null) ) + return + ;; esac if [[ "$cur" == -* ]]; then @@ -68,8 +66,7 @@ _apt_get() changelog check clean autoclean autoremove' -- "$cur" ) ) fi - return 0 } && complete -F _apt_get apt-get -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/aptitude b/completions/aptitude index 3bcfa5cf..32c1dacf 100644 --- a/completions/aptitude +++ b/completions/aptitude @@ -9,7 +9,7 @@ _comp_dpkg_hold_packages() _comp_dpkg_hold_packages() { command grep -B 2 'hold' /var/lib/dpkg/status | \ - command grep "Package: $1" | cut -d\ -f2 + awk "/Package: $1/ { print \$2 }" } } @@ -26,7 +26,7 @@ _aptitude() local special i for (( i=0; i < ${#words[@]}-1; i++ )); do - if [[ ${words[i]} == @(@(|re)install|@(|un)hold|@(|un)markauto|@(dist|full)-upgrade|download|show|forbid-version|purge|remove|changelog|why@(|-not)|keep@(|-all)|build-dep|@(add|remove)-user-tag|versions) ]]; then + if [[ ${words[i]} == @(@(|re)install|@(|un)hold|@(|un)markauto|@(dist|full|safe)-upgrade|download|show|forbid-version|purge|remove|changelog|why@(|-not)|keep@(|-all)|build-dep|@(add|remove)-user-tag|versions) ]]; then special=${words[i]} fi #exclude some mutually exclusive options @@ -35,39 +35,39 @@ _aptitude() done if [[ -n "$special" ]]; then - case $special in - install|hold|markauto|unmarkauto|dist-upgrade|full-upgrade| \ - download|show|changelog|why|why-not|build-dep|add-user-tag| \ - remove-user-tag|versions) - COMPREPLY=( $( apt-cache pkgnames $cur 2> /dev/null ) ) - return 0 - ;; - purge|remove|reinstall|forbid-version) - COMPREPLY=( \ - $( _xfunc dpkg _comp_dpkg_installed_packages "$cur" ) ) - return 0 - ;; - unhold) - COMPREPLY=( $( _comp_dpkg_hold_packages "$cur" ) ) - return 0 - ;; - esac + case $special in + install|hold|markauto|unmarkauto|dist-upgrade|full-upgrade| \ + safe-upgrade|download|show|changelog|why|why-not|build-dep| \ + add-user-tag|remove-user-tag|versions) + COMPREPLY=( $( _xfunc apt-cache _apt_cache_packages ) ) + return + ;; + purge|remove|reinstall|forbid-version) + COMPREPLY=( \ + $( _xfunc dpkg _comp_dpkg_installed_packages "$cur" ) ) + return + ;; + unhold) + COMPREPLY=( $( _comp_dpkg_hold_packages "$cur" ) ) + return + ;; + esac fi case $prev in # don't complete anything if these options are found - autoclean|clean|forget-new|search|safe-upgrade|upgrade|update|keep-all) - return 0 + autoclean|clean|forget-new|search|upgrade|update|keep-all) + return ;; -S) _filedir - return 0 + return ;; -t|--target-release|--default-release) COMPREPLY=( $( apt-cache policy | \ command grep "release.o=Debian,a=$cur" | \ - sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2> /dev/null ) ) - return 0 + command sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2> /dev/null ) ) + return ;; esac @@ -81,8 +81,7 @@ _aptitude() remove-user-tag versions' -- "$cur" ) ) fi - return 0 } && complete -F _aptitude -o default aptitude -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/arch b/completions/arch index 74e9adec..cd33b4f0 100644 --- a/completions/arch +++ b/completions/arch @@ -11,19 +11,18 @@ _arch() case $prev in -w|-g|-d|--welcome-msg|--goodbye-msg|--digest) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) - return 0 + return ;; -d|--file) _filedir - return 0 + return ;; esac - $split && return 0 + $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '--wipe --start --end --quiet --help' \ - -- "$cur" ) ) + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) else local args=$cword for (( i=1; i < cword; i++ )); do @@ -44,4 +43,4 @@ _arch() } && complete -F _arch arch -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/arping b/completions/arping index 231a63be..a719e916 100644 --- a/completions/arping +++ b/completions/arping @@ -28,4 +28,4 @@ _arping() } && complete -F _arping arping -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/arpspoof b/completions/arpspoof index cf9c497a..7b515edb 100644 --- a/completions/arpspoof +++ b/completions/arpspoof @@ -8,11 +8,11 @@ _arpspoof() case $prev in -i) _available_interfaces -a - return 0 + return ;; -t) _known_hosts_real "$cur" - return 0 + return ;; esac @@ -25,4 +25,4 @@ _arpspoof() } && complete -F _arpspoof arpspoof -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/asciidoc b/completions/asciidoc index 722614f6..fb29fad4 100644 --- a/completions/asciidoc +++ b/completions/asciidoc @@ -49,4 +49,4 @@ _asciidoc() } && complete -F _asciidoc asciidoc asciidoc.py -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/aspell b/completions/aspell index b1cd4c5d..9457a5fa 100644 --- a/completions/aspell +++ b/completions/aspell @@ -2,15 +2,15 @@ _aspell_dictionary() { - local datadir - datadir=$( aspell config data-dir 2>/dev/null || echo /usr/lib/aspell ) + local datadir aspell=${1:-aspell} + datadir=$( $aspell config data-dir 2>/dev/null || echo /usr/lib/aspell ) # First, get aliases (dicts dump does not list them) - COMPREPLY=( $( command ls $datadir/*.alias 2>/dev/null ) ) - COMPREPLY=( ${COMPREPLY[@]%.alias} ) - COMPREPLY=( ${COMPREPLY[@]#$datadir/} ) + COMPREPLY=( $( printf '%s\n' $datadir/*.alias ) ) + COMPREPLY=( "${COMPREPLY[@]%.alias}" ) + COMPREPLY=( "${COMPREPLY[@]#$datadir/}" ) # Then, add the canonical dicts - COMPREPLY+=( $( aspell dicts 2>/dev/null ) ) - COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) ) + COMPREPLY+=( $( $aspell dicts 2>/dev/null ) ) + COMPREPLY=( $( compgen -X '\*' -W '${COMPREPLY[@]}' -- "$cur" ) ) } _aspell() @@ -21,42 +21,42 @@ _aspell() case $prev in -c|-p|check|--conf|--personal|--repl|--per-conf) _filedir - return 0 + return ;; --conf-dir|--data-dir|--dict-dir|--home-dir|--local-data-dir|--prefix) _filedir -d - return 0 + return ;; dump|create|merge) COMPREPLY=( $( compgen -W 'master personal repl' -- "$cur" ) ) - return 0 + return ;; --mode) COMPREPLY=( $( compgen -W "$( $1 modes 2>/dev/null | \ awk '{ print $1 }' )" -- "$cur" ) ) - return 0 + return ;; --sug-mode) COMPREPLY=( $( compgen -W 'ultra fast normal bad-speller' \ -- "$cur" ) ) - return 0 + return ;; --keymapping) COMPREPLY=( $( compgen -W 'aspell ispell' -- "$cur" ) ) - return 0 + return ;; -d|--master) - _aspell_dictionary - return 0 + _aspell_dictionary "$1" + return ;; --add-filter|--rem-filter) COMPREPLY=( $( compgen -W "$( $1 filters 2>/dev/null | \ awk '{ print $1 }' )" -- "$cur" ) ) - return 0 + return ;; esac - $split && return 0 + $split && return if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '--conf= --conf-dir= --data-dir= --dict-dir= @@ -85,4 +85,4 @@ _aspell() } && complete -F _aspell aspell -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/autoconf b/completions/autoconf index fea524e7..c67f1bdb 100644 --- a/completions/autoconf +++ b/completions/autoconf @@ -7,25 +7,25 @@ _autoconf() case "$prev" in --help|-h|--version|-V|--trace|-t) - return 0 + return ;; --output|-o) _filedir - return 0 + return ;; --warnings|-W) local cats=( cross obsolete syntax ) COMPREPLY=( $( compgen -W \ '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) ) - return 0 + return ;; --prepend-include|-B|--include|-I) _filedir -d - return 0 + return ;; esac - $split && return 0 + $split && return if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) @@ -37,4 +37,4 @@ _autoconf() } && complete -F _autoconf autoconf -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/automake b/completions/automake index 78bc6db2..c5fe1a10 100644 --- a/completions/automake +++ b/completions/automake @@ -7,21 +7,21 @@ _automake() case "$prev" in --help|--version) - return 0 + return ;; --warnings|-W) local cats=( gnu obsolete override portability syntax unsupported ) COMPREPLY=( $( compgen -W \ '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) ) - return 0 + return ;; --libdir) _filedir -d - return 0 + return ;; esac - $split && return 0 + $split && return if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) @@ -31,6 +31,6 @@ _automake() _filedir } && -complete -F _automake automake automake-1.11 +complete -F _automake automake automake-1.1{0..5} -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/autoreconf b/completions/autoreconf index 8de40c88..c067cec1 100644 --- a/completions/autoreconf +++ b/completions/autoreconf @@ -7,27 +7,27 @@ _autoreconf() case "$prev" in --help|-h|--version|-V) - return 0 + return ;; --warnings|-W) local cats=( cross gnu obsolete override portability syntax \ unsupported ) COMPREPLY=( $( compgen -W \ '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) ) - return 0 + return ;; --prepend-include|-B|--include|-I) _filedir -d - return 0 + return ;; esac - $split && return 0 + $split && return if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace - return 0 + return fi if [[ $1 == autoheader ]] ; then @@ -38,4 +38,4 @@ _autoreconf() } && complete -F _autoreconf autoreconf autoheader -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/autorpm b/completions/autorpm index 616ad8b6..8c6e299a 100644 --- a/completions/autorpm +++ b/completions/autorpm @@ -11,4 +11,4 @@ _autorpm() } && complete -F _autorpm autorpm -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/autoscan b/completions/autoscan index 80b051cf..054a58af 100644 --- a/completions/autoscan +++ b/completions/autoscan @@ -7,20 +7,20 @@ _autoscan() case "$prev" in --help|-h|--version|-V) - return 0 + return ;; --prepend-include|-B|--include|-I) _filedir -d - return 0 + return ;; esac - $split && return 0 + $split && return if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace - return 0 + return fi if [[ $1 == autoupdate ]] ; then @@ -31,4 +31,4 @@ _autoscan() } && complete -F _autoscan autoscan autoupdate -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/avctrl b/completions/avctrl index bac38cd6..acd9aeb7 100644 --- a/completions/avctrl +++ b/completions/avctrl @@ -17,4 +17,4 @@ _avctrl() } && complete -F _avctrl avctrl -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/badblocks b/completions/badblocks index 2dc8eb43..d70affe2 100644 --- a/completions/badblocks +++ b/completions/badblocks @@ -7,11 +7,11 @@ _badblocks() case $prev in -b|-c|-e|-d|-p|-t) - return 0 + return ;; -i|-o) _filedir - return 0 + return ;; esac @@ -19,9 +19,9 @@ _badblocks() COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) # Filter out -w (dangerous) and -X (internal use) for i in ${!COMPREPLY[@]}; do - [[ ${COMPREPLY[i]} == -[wX] ]] && unset COMPREPLY[i] + [[ ${COMPREPLY[i]} == -[wX] ]] && unset 'COMPREPLY[i]' done - return 0 + return fi cur=${cur:=/dev/} @@ -29,4 +29,4 @@ _badblocks() } && complete -F _badblocks badblocks -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/bind b/completions/bind new file mode 100644 index 00000000..ec5d0b81 --- /dev/null +++ b/completions/bind @@ -0,0 +1,36 @@ +# bash bind completion -*- shell-script -*- + +_bind() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -l|-p|-P|-s|-S|-v|-V|-r|-x|-X) + return + ;; + -m) + COMPREPLY=( $( compgen -W "emacs emacs-standard emacs-meta + emacs-ctlx vi vi-move vi-command vi-insert" -- "$cur" ) ) + return + ;; + -f) + _filedir + return + ;; + -q|-u) + COMPREPLY=( $( compgen -W '$( "$1" -l )' -- "$cur" ) ) + return + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + return + fi + + COMPREPLY=( $( compgen -A binding -- "$cur" ) ) +} && +complete -F _bind bind + +# ex: filetype=sh diff --git a/completions/bk b/completions/bk index 8be6fb76..334e25b4 100644 --- a/completions/bk +++ b/completions/bk @@ -7,13 +7,12 @@ _bk() _init_completion || return local BKCMDS="$( bk help topics 2>/dev/null | \ - awk '/^ bk/ { print $4 }' | xargs printf '%s ' )" + awk '/^ bk/ { print $2 }' | xargs printf '%s ' )" COMPREPLY=( $( compgen -W "$BKCMDS" -- "$cur" ) ) _filedir - return 0 } && complete -F _bk bk -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/brctl b/completions/brctl index 27207158..01370654 100644 --- a/completions/brctl +++ b/completions/brctl @@ -18,7 +18,7 @@ _brctl() show) ;; *) - COMPREPLY=( $( compgen -W "$(brctl show | \ + COMPREPLY=( $( compgen -W "$($1 show | \ awk 'NR>1 {print $1}' )" -- "$cur" ) ) esac ;; @@ -36,4 +36,4 @@ _brctl() } && complete -F _brctl -o default brctl -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/btdownloadheadless.py b/completions/btdownloadheadless.py index dc9789a9..f0b74615 100644 --- a/completions/btdownloadheadless.py +++ b/completions/btdownloadheadless.py @@ -8,11 +8,11 @@ _btdownload() case $prev in --responsefile|--saveas) _filedir - return 0 + return ;; esac - if [[ "$cur" == -* ]]; then + 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 @@ -29,4 +29,4 @@ _btdownload() complete -F _btdownload btdownloadheadless.py btdownloadcurses.py \ btdownloadgui.py -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/bts b/completions/bts new file mode 100644 index 00000000..ba33fd66 --- /dev/null +++ b/completions/bts @@ -0,0 +1,115 @@ +# bts completion -*- shell-script -*- + +# List bug numbers from bugs cache in ~/.devscripts_cache/bts +_cached_bugs() { + [[ -d $HOME/.devscripts_cache/bts ]] && \ + find $HOME/.devscripts_cache/bts -maxdepth 1 -name "$cur[0-9]*.html" \ + -printf "%f\n" | cut -d'.' -f1 +} + +# List APT source packages prefixed with "src:" +_src_packages_with_prefix() { + ppn=${cur:4} # partial package name, after stripping "src:" + compgen -P "src:" -W '$( _xfunc apt-cache _apt_cache_sources "$ppn" )' \ + -- "$ppn" +} + + +_bts() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + show|bugs) + COMPREPLY=( $( compgen -W 'release-critical RC from: tag: + usertag:' -- "$cur" ) $( _cached_bugs ) + $( _src_packages_with_prefix ) ) + return + ;; + select) + COMPREPLY=( $( compgen -W 'package: source: maintainer: submitter: + severity: status: tag: owner: correspondent: affects: bugs: + users: archive:' -- "$cur" ) ) + return + ;; + status) + COMPREPLY=( $( compgen -W 'file: fields: verbose' -- "$cur" ) + $( _cached_bugs ) ) + return + ;; + block|unblock) + COMPREPLY=( $( compgen -W 'by with' -- "$cur" ) ) + return + ;; + severity) + COMPREPLY=( $( compgen -W 'wishlist minor normal important serious + grave critical' -- "$cur" ) ) + return + ;; + limit) + COMPREPLY=( $( compgen -W 'submitter date subject msgid package + source tag severity owner affects archive' -- "$cur" ) ) + return + ;; + clone|done|reopen|archive|unarchive|retitle|summary|submitter|found\ + |notfound|fixed|notfixed|merge|forcemerge|unmerge|claim|unclaim\ + |forwarded|notforwarded|owner|noowner|subscribe|unsubscribe\ + |reportspam|spamreport|affects|usertag|usertags|reassign|tag\ + |tags) + COMPREPLY=( $( _cached_bugs ) ) + return + ;; + package) + COMPREPLY=( $( _xfunc apt-cache _apt_cache_packages ) ) + return + ;; + cache) + COMPREPLY=( $( _xfunc apt-cache _apt_cache_packages ) + $( _src_packages_with_prefix ) + $( compgen -W 'from: release-critical RC' -- "$cur" ) ) + return + ;; + cleancache) + COMPREPLY=( $( _xfunc apt-cache _apt_cache_packages ) + $( _src_packages_with_prefix ) + $( compgen -W 'from: tag: usertag: ALL' -- "$cur" ) ) + return + ;; + user) + # non-predicible arguments + COMPREPLY=( ) + return + ;; + :) + # Chances are that "src:" is being completed + # COMP_WORDS would be: "bts cleancache src : " + pos=$((COMP_CWORD - 2)) + if [[ $pos -gt 0 && "${COMP_WORDS[$pos]}" == "src" ]]; then + COMPREPLY=( $( _xfunc apt-cache _apt_cache_src_packages ) ) + return + fi + ;; + esac + + $split && return + + COMPREPLY=( $( compgen -W '--offline --online --no-offline + --no-action --cache --no-cache --cache-mode --cache-delay --mbox + --mailreader --cc-addr --use-default-cc --no-use-default-cc + --sendmail --mutt --no-mutt --smtp-host --smtp-username + --smtp-helo --bts-server --force-refresh --no-force-refresh + --only-new --include-resolved --no-include-resolved --no-ack --ack + --interactive --force-interactive --no-interactive --quiet + --no-conf --noconf + show bugs select status clone done reopen archive unarchive retitle + summary submitter reassign found notfound fixed notfixed block unblock + merge forcemerge unmerge tag tags affects user usertag usertags claim + unclaim severity forwarded notforwarded package limit owner noowner + subscribe unsubscribe reportspam spamreport cache cleancache version + help' -- "$cur" ) ) + +} && +complete -F _bts bts + +# ex: filetype=sh diff --git a/completions/bzip2 b/completions/bzip2 index 1bc98288..8362a595 100644 --- a/completions/bzip2 +++ b/completions/bzip2 @@ -7,11 +7,11 @@ _bzip2() case $prev in -b|-h|--help|-p) - return 0 + return ;; -n) COMPREPLY=( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) ) - return 0 + return ;; esac @@ -19,22 +19,20 @@ _bzip2() local helpopts=$( _parse_help "$1" ) COMPREPLY=( $( compgen -W "${helpopts//#/} -2 -3 -4 -5 -6 -7 -8 -9" \ -- "$cur" ) ) - return 0 + return fi local IFS=$'\n' xspec="*.bz2" if [[ "$prev" == --* ]]; then - [[ "$prev" == --decompress || \ - "$prev" == --list || \ - "$prev" == --test ]] && xspec="!"$xspec + [[ "$prev" == --@(decompress|list|test) ]] && xspec="!"$xspec [[ "$prev" == --compress ]] && xspec= elif [[ "$prev" == -* ]]; then [[ "$prev" == -*[dt]* ]] && xspec="!"$xspec [[ "$prev" == -*z* ]] && xspec= fi - _expand || return 0 + _expand || return compopt -o filenames COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ @@ -42,4 +40,4 @@ _bzip2() } && complete -F _bzip2 bzip2 pbzip2 lbzip2 -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/cal b/completions/cal deleted file mode 100644 index 880b0b35..00000000 --- a/completions/cal +++ /dev/null @@ -1,34 +0,0 @@ -# cal(1) completion -*- shell-script -*- - -_cal() -{ - local cur prev words cword - _init_completion || return - - case $prev in - -m) - if [[ $OSTYPE == *bsd* ]]; then - COMPREPLY=( $( compgen -W '{1..12}' -- "$cur" ) ) - return - fi - ;; - -s) - [[ $OSTYPE == *bsd* ]] && return - ;; - -A|-B|-d|-H) - return - ;; - esac - - if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) - return - fi - - local args - _count_args - [[ $args -eq 1 ]] && COMPREPLY=( $( compgen -W '{1..12}' -- "$cur" ) ) -} && -complete -F _cal cal ncal - -# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/cancel b/completions/cancel index 3e9a3781..2722d2a8 100644 --- a/completions/cancel +++ b/completions/cancel @@ -9,4 +9,4 @@ _cancel() } && complete -F _cancel cancel -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/cardctl b/completions/cardctl index 5b5bb5d5..273d1a90 100644 --- a/completions/cardctl +++ b/completions/cardctl @@ -12,4 +12,4 @@ _cardctl() } && complete -F _cardctl cardctl pccardctl -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/ccache b/completions/ccache index 63f5a1c6..7184d74e 100644 --- a/completions/ccache +++ b/completions/ccache @@ -5,15 +5,27 @@ _ccache() local cur prev words cword split _init_completion -s || return - if [[ $COMP_CWORD -eq 1 && ${COMP_WORDS[COMP_CWORD]} != -* ]]; then - _command_offset 1 - return - fi + local i + for (( i=1; i <= COMP_CWORD; i++ )); do + if [[ ${COMP_WORDS[i]} != -* ]]; then + _command_offset $i + return + fi + [[ ${COMP_WORDS[i]} == -[oFM] ]] && ((i++)) + done case $prev in -h|--help|-V|--version|-F|--max-files|-M|--max-size) return ;; + -o|--set-config) + if [[ $cur != *=* ]]; then + COMPREPLY=( $( compgen -S = -W "$( $1 -p 2>/dev/null | \ + awk '$3 = "=" { print $2 }' )" -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + fi + return + ;; esac $split && return @@ -23,4 +35,4 @@ _ccache() } && complete -F _ccache ccache -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/cfagent b/completions/cfagent index f3e227a4..fbf364ed 100644 --- a/completions/cfagent +++ b/completions/cfagent @@ -8,7 +8,7 @@ _cfagent() case $prev in -f|--file) _filedir - return 0 + return ;; esac @@ -18,4 +18,4 @@ _cfagent() } && complete -F _cfagent cfagent -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/cfrun b/completions/cfrun index 7dd1beff..f4d1f265 100644 --- a/completions/cfrun +++ b/completions/cfrun @@ -17,7 +17,7 @@ _cfrun() case $prev in -f) _filedir - return 0 + return ;; esac @@ -31,7 +31,7 @@ _cfrun() break fi done - [[ ! -f $hostfile ]] && return 0 + [[ ! -f $hostfile ]] && return COMPREPLY=( $(compgen -W "$( command grep -v \ -E '(=|^$|^#)' $hostfile )" -- "$cur" ) ) @@ -44,4 +44,4 @@ _cfrun() } && complete -F _cfrun cfrun -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/chage b/completions/chage index 1842bb8a..9b11f169 100644 --- a/completions/chage +++ b/completions/chage @@ -8,19 +8,19 @@ _chage() case $prev in -d|--lastday|-E|--expiredate|-h|--help|-I|--inactive|-m|--mindays|\ -M|--maxdays|-W|--warndays) - return 0 + return ;; esac - $split && return 0 + $split && return if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - return 0 + return fi COMPREPLY=( $( compgen -u -- "$cur" ) ) } && complete -F _chage chage -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/change_pw b/completions/change_pw index abc7d6b1..b0f2061f 100644 --- a/completions/change_pw +++ b/completions/change_pw @@ -8,11 +8,11 @@ _change_pw() case $prev in -l|--listname) _xfunc list_lists _mailman_lists - return 0 + return ;; esac - $split && return 0 + $split && return if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '--all --domain --listname --password --quiet @@ -22,4 +22,4 @@ _change_pw() } && complete -F _change_pw change_pw -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/check_db b/completions/check_db index 651b375c..6f666173 100644 --- a/completions/check_db +++ b/completions/check_db @@ -14,4 +14,4 @@ _check_db() } && complete -F _check_db check_db -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/check_perms b/completions/check_perms index 472b9266..0fb05b11 100644 --- a/completions/check_perms +++ b/completions/check_perms @@ -12,4 +12,4 @@ _check_perms() } && complete -F _check_perms check_perms -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/checksec b/completions/checksec new file mode 100644 index 00000000..4e9fb601 --- /dev/null +++ b/completions/checksec @@ -0,0 +1,37 @@ +# bash completion for checksec -*- shell-script -*- + +_checksec() +{ + local cur prev words cword + _init_completion || return + + case $prev in + --version|--help) + return + ;; + --file|--fortify-file) + _filedir + return + ;; + --dir) + _filedir -d + return + ;; + --proc) + _pnames + return + ;; + --proc-libs|--fortify-proc) + _pids + return + ;; + esac + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + return + fi +} && +complete -F _checksec checksec + +# ex: filetype=sh diff --git a/completions/chgrp b/completions/chgrp index 26220d9e..986a77a6 100644 --- a/completions/chgrp +++ b/completions/chgrp @@ -9,10 +9,10 @@ _chgrp() if [[ "$prev" == --reference ]]; then _filedir - return 0 + return fi - $split && return 0 + $split && return # options completion if [[ "$cur" == -* ]]; then @@ -23,18 +23,17 @@ _chgrp() COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes --dereference --no-dereference --silent --quiet --reference --recursive --verbose --help --version $opts' -- "$cur" ) ) - return 0 + return fi # first parameter on line or first since an option? if [[ $cword -eq 1 && "$cur" != -* || "$prev" == -* ]]; then _allowed_groups "$cur" else - _filedir || return 0 + _filedir fi - return 0 } && complete -F _chgrp chgrp -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/chkconfig b/completions/chkconfig index b1dd925e..8766b3a2 100644 --- a/completions/chkconfig +++ b/completions/chkconfig @@ -9,15 +9,15 @@ _chkconfig() --level=[1-6]|[1-6]|--list|--add|--del|--override) _services _xinetd_services - return 0 + return ;; --level) COMPREPLY=( $( compgen -W '{1..6}' -- "$cur" ) ) - return 0 + return ;; esac - $split && return 0 + $split && return if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '--list --add --del --override --level' \ @@ -34,4 +34,4 @@ _chkconfig() } && complete -F _chkconfig chkconfig -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/chown b/completions/chown index 54d89fb8..c4479dd2 100644 --- a/completions/chown +++ b/completions/chown @@ -9,15 +9,15 @@ _chown() case "$prev" in --from) _usergroup - return 0 + return ;; --reference) _filedir - return 0 + return ;; esac - $split && return 0 + $split && return if [[ "$cur" == -* ]]; then # Complete -options @@ -43,4 +43,4 @@ _chown() } && complete -F _chown chown -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/chpasswd b/completions/chpasswd index 499ec93b..93e74f8c 100644 --- a/completions/chpasswd +++ b/completions/chpasswd @@ -9,18 +9,18 @@ _chpasswd() -c|--crypt) COMPREPLY=( $( compgen -W 'DES MD5 NONE SHA256 SHA512' \ -- "$cur" ) ) - return 0 + return ;; -s|--sha-rounds) - return 0 + return ;; esac - $split && return 0 + $split && return COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace } && complete -F _chpasswd chpasswd -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/chronyc b/completions/chronyc index 3544c753..ede6bb09 100644 --- a/completions/chronyc +++ b/completions/chronyc @@ -1,5 +1,16 @@ # chronyc(1) completion -*- shell-script -*- +_chronyc_command_args() +{ + local -a args=( $( compgen -W "$( $1 help 2>/dev/null | \ + awk '/^'$prev'\s[^ []/ { gsub("\\|", " ", $2); print $2 }' )" ) ) + case $args in + \) _known_hosts_real "$cur" ;; + \<*) ;; + *) COMPREPLY+=( $( compgen -W '${args[@]}' -- "$cur" ) ) ;; + esac +} + _chronyc() { local cur prev words cword @@ -16,7 +27,7 @@ _chronyc() esac if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '$( _parse_usage "$1" ) -6' -- "$cur" ) ) return fi @@ -24,40 +35,19 @@ _chronyc() 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" ) ) + awk '!/(^ |: *$)/ { 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 + _chronyc_command_args "$1" + if [[ ! $COMPREPLY && $prev == sources?(tats) ]]; then + # [-v] not handled by _chronyc_command_args yet + COMPREPLY=( $( compgen -W '-v' -- "$cur" ) ) + fi ;; 2) [[ $prev == @(peer|server) ]] && _known_hosts_real "$cur" @@ -66,4 +56,4 @@ _chronyc() } && complete -F _chronyc chronyc -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/chrpath b/completions/chrpath index 29a71851..13e43ad0 100644 --- a/completions/chrpath +++ b/completions/chrpath @@ -24,4 +24,4 @@ _chrpath() } && complete -F _chrpath chrpath -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/chsh b/completions/chsh deleted file mode 100644 index f65291a1..00000000 --- a/completions/chsh +++ /dev/null @@ -1,28 +0,0 @@ -# chsh(1) completion -*- shell-script -*- - -_chsh() -{ - local cur prev words cword - _init_completion || return - - case $prev in - --list-shells|--help|-v|--version) - return 0 - ;; - -s|--shell) - _shells - return 0 - ;; - esac - - if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) - else - _allowed_users - fi - - return 0 -} && -complete -F _chsh chsh - -# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/cksfv b/completions/cksfv index eabe3730..dd90816e 100644 --- a/completions/cksfv +++ b/completions/cksfv @@ -7,23 +7,23 @@ _cksfv() if [[ $cword -eq 1 ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - return 0 + return fi case "$prev" in -C|-g) _filedir -d - return 0 + return ;; -f) _filedir 'sfv' - return 0 + return ;; esac _filedir - return 0 + } && complete -F _cksfv cksfv -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/cleanarch b/completions/cleanarch index 7fb05299..edac34f8 100644 --- a/completions/cleanarch +++ b/completions/cleanarch @@ -13,4 +13,4 @@ _cleanarch() } && complete -F _cleanarch cleanarch -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/clisp b/completions/clisp index cdbf6bd2..23b04f04 100644 --- a/completions/clisp +++ b/completions/clisp @@ -16,8 +16,7 @@ _clisp() _filedir fi - return 0 } && complete -F _clisp -o default clisp -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/clone_member b/completions/clone_member index 9dd55fe8..fe45e494 100644 --- a/completions/clone_member +++ b/completions/clone_member @@ -8,11 +8,11 @@ _clone_member() case $prev in -l|--listname) _xfunc list_lists _mailman_lists - return 0 + return ;; esac - $split && return 0 + $split && return if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '--listname --remove --admin --quiet @@ -22,4 +22,4 @@ _clone_member() } && complete -F _clone_member clone_member -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/complete b/completions/complete index bcac435d..5de2d168 100644 --- a/completions/complete +++ b/completions/complete @@ -9,7 +9,7 @@ _complete() -o) COMPREPLY=( $( compgen -W 'bashdefault default dirnames filenames nospace plusdirs' -- "$cur" ) ) - return 0 + return ;; -A) @@ -17,21 +17,21 @@ _complete() directory disabled enabled export file function group helptopic hostname job keyword running service setopt shopt signal stopped user variable' -- "$cur" ) ) - return 0 + return ;; -C) COMPREPLY=( $( compgen -A command -- "$cur" ) ) - return 0 + return ;; -F) COMPREPLY=( $( compgen -A function -- "$cur" ) ) - return 0 + return ;; -p|-r) - COMPREPLY=( $( complete -p | sed -e 's|.* ||' ) ) + COMPREPLY=( $( complete -p | command sed -e 's|.* ||' ) ) COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) ) - return 0 + return ;; esac @@ -47,4 +47,4 @@ _complete() } && complete -F _complete compgen complete -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/config_list b/completions/config_list index 68ab6cb7..653c628a 100644 --- a/completions/config_list +++ b/completions/config_list @@ -8,11 +8,11 @@ _config_list() case $prev in -i|-o|--inputfile|--outputfile) _filedir - return 0 + return ;; esac - $split && return 0 + $split && return if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '--inputfile --outputfile --checkonly @@ -24,4 +24,4 @@ _config_list() } && complete -F _config_list config_list -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/configure b/completions/configure index 2337c497..0e37726b 100644 --- a/completions/configure +++ b/completions/configure @@ -20,16 +20,16 @@ _configure() ;; esac - $split && return 0 + $split && return # if $COMP_CONFIGURE_HINTS is not null, then completions of the form # --option=SETTING will include 'SETTING' as a contextual hint - [[ "$cur" != -* ]] && return 0 + [[ "$cur" != -* ]] && return if [[ -n $COMP_CONFIGURE_HINTS ]]; then COMPREPLY=( $( compgen -W "$( $1 --help 2>&1 | \ awk '/^ --[A-Za-z]/ { print $1; \ - if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,].*//g' )" \ + if ($2 ~ /--[A-Za-z]/) print $2 }' | command sed -e 's/[[,].*//g' )" \ -- "$cur" ) ) [[ $COMPREPLY == *=* ]] && compopt -o nospace else @@ -39,4 +39,4 @@ _configure() } && complete -F _configure configure -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/convert b/completions/convert index ffb320e2..59647d59 100644 --- a/completions/convert +++ b/completions/convert @@ -6,88 +6,88 @@ _ImageMagick() -channel) COMPREPLY=( $( compgen -W 'Red Green Blue Opacity Matte Cyan Magenta Yellow Black' -- "$cur" ) ) - return 0 + return ;; -colormap) COMPREPLY=( $( compgen -W 'shared private' -- "$cur" ) ) - return 0 + return ;; -colorspace) COMPREPLY=( $( compgen -W 'GRAY OHTA RGB Transparent XYZ YCbCr YIQ YPbPr YUV CMYK' -- "$cur" ) ) - return 0 + return ;; -compose) COMPREPLY=( $( compgen -W 'Over In Out Atop Xor Plus Minus Add Subtract Difference Multiply Bumpmap Copy CopyRed CopyGreen CopyBlue CopyOpacity' -- "$cur" ) ) - return 0 + return ;; -compress) COMPREPLY=( $( compgen -W 'None BZip Fax Group4 JPEG Lossless LZW RLE Zip' -- "$cur" ) ) - return 0 + return ;; -dispose) COMPREPLY=( $( compgen -W 'Undefined None Background Previous' \ -- "$cur" ) ) - return 0 + return ;; -encoding) COMPREPLY=( $( compgen -W 'AdobeCustom AdobeExpert AdobeStandard AppleRoman BIG5 GB2312 Latin2 None SJIScode Symbol Unicode Wansung' -- "$cur" ) ) - return 0 + return ;; -endian) COMPREPLY=( $( compgen -W 'MSB LSB' -- "$cur" ) ) - return 0 + return ;; -filter) COMPREPLY=( $( compgen -W 'Point Box Triangle Hermite Hanning Hamming Blackman Gaussian Quadratic Cubic Catrom Mitchell Lanczos Bessel Sinc' -- "$cur" ) ) - return 0 + return ;; -format) COMPREPLY=( $( compgen -W "$( convert -list format | awk \ '/ [r-][w-][+-] / { sub("[*]$","",$1); print tolower($1) }' )" \ -- "$cur" ) ) - return 0 + return ;; -gravity) COMPREPLY=( $( compgen -W 'Northwest North NorthEast West Center East SouthWest South SouthEast' -- "$cur" ) ) - return 0 + return ;; -intent) COMPREPLY=( $( compgen -W 'Absolute Perceptual Relative Saturation' -- "$cur" ) ) - return 0 + return ;; -interlace) COMPREPLY=( $( compgen -W 'None Line Plane Partition' -- "$cur" ) ) - return 0 + return ;; -limit) COMPREPLY=( $( compgen -W 'Disk File Map Memory' -- "$cur" ) ) - return 0 + return ;; -list) COMPREPLY=( $( compgen -W 'Delegate Format Magic Module Resource Type' -- "$cur" ) ) - return 0 + return ;; -map) COMPREPLY=( $( compgen -W 'best default gray red green blue' \ -- "$cur" ) ) _filedir - return 0 + return ;; -noise) COMPREPLY=( $( compgen -W 'Uniform Gaussian Multiplicative Impulse Laplacian Poisson' -- "$cur" ) ) - return 0 + return ;; -preview) COMPREPLY=( $( compgen -W 'Rotate Shear Roll Hue Saturation @@ -95,32 +95,32 @@ _ImageMagick() ReduceNoise AddNoise Sharpen Blur Treshold EdgeDetect Spread Shade Raise Segment Solarize Swirl Implode Wave OilPaint CharcoalDrawing JPEG' -- "$cur" ) ) - return 0 + return ;; -mask|-profile|-texture|-tile|-write) _filedir - return 0 + return ;; -type) COMPREPLY=( $( compgen -W 'Bilevel Grayscale Palette PaletteMatte TrueColor TrueColorMatte ColorSeparation ColorSeparationlMatte Optimize' -- "$cur" ) ) - return 0 + return ;; -units) COMPREPLY=( $( compgen -W 'Undefined PixelsPerInch PixelsPerCentimeter' -- "$cur" ) ) - return 0 + return ;; -virtual-pixel) COMPREPLY=( $( compgen -W 'Constant Edge mirror tile' -- "$cur" ) ) - return 0 + return ;; -visual) COMPREPLY=( $( compgen -W 'StaticGray GrayScale StaticColor PseudoColor TrueColor DirectColor defaut visualid' \ -- "$cur" ) ) - return 0 + return ;; esac @@ -321,4 +321,4 @@ _stream() } && complete -F _stream stream -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/cowsay b/completions/cowsay index 8e96b91e..4f4411ac 100644 --- a/completions/cowsay +++ b/completions/cowsay @@ -9,7 +9,7 @@ _cowsay() -f) COMPREPLY=( $( compgen -W \ '$( cowsay -l 2>/dev/null | tail -n +2 )' -- "$cur" ) ) - return 0 + return ;; esac @@ -20,4 +20,4 @@ _cowsay() } && complete -F _cowsay -o default cowsay cowthink -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/cpan2dist b/completions/cpan2dist index f6a67ac6..9704782d 100644 --- a/completions/cpan2dist +++ b/completions/cpan2dist @@ -11,11 +11,11 @@ _cpan2dist() COMPREPLY=( $( compgen -W '$(perl -MCPANPLUS::Dist -e \ "print map { \"\$_\n\" } CPANPLUS::Dist->dist_types")' \ -- "$cur" ) ) - return 0 + return ;; --banlist|--ignorelist|--modulelist|--logfile) _filedir - return 0 + return ;; esac @@ -29,9 +29,9 @@ _cpan2dist() packagelist="$dir/02packages.details.txt.gz" done [[ $packagelist ]] && COMPREPLY=( $( zgrep "^${cur//-/::}" \ - $packagelist 2>/dev/null | awk '{print $1}' | sed -e 's/::/-/g' ) ) + $packagelist 2>/dev/null | awk '{print $1}' | command sed -e 's/::/-/g' ) ) fi } && complete -F _cpan2dist -o default cpan2dist -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/cpio b/completions/cpio index d63d15a9..36e3fe90 100644 --- a/completions/cpio +++ b/completions/cpio @@ -10,24 +10,24 @@ _cpio() -H|--format) COMPREPLY=( $( compgen -W \ 'bin odc newc crc tar ustar hpbin hpodc' -- "$cur" ) ) - return 0 + return ;; -E|-F|-I|--file|--pattern-file) _filedir - return 0 + return ;; -R|--owner) _usergroup - return 0 + return ;; --rsh-command) compopt -o filenames COMPREPLY=( $( compgen -c -- "$cur" ) ) - return 0 + return ;; esac - $split && return 0 + $split && return if [[ $cword -eq 1 ]]; then COMPREPLY=( $( compgen -W '-o --create -i --extract -p --pass-through @@ -75,4 +75,4 @@ _cpio() } && complete -F _cpio cpio -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/cppcheck b/completions/cppcheck index 64bb9b02..86990dd5 100644 --- a/completions/cppcheck +++ b/completions/cppcheck @@ -6,12 +6,13 @@ _cppcheck() _init_completion -s || return case $prev in - --append|--exitcode-suppressions|--file-list|--rule-file|\ + --append|--exitcode-suppressions|--rule-file|--config-excludes-file|\ --suppressions-list|--includes-file|--include|-i) _filedir return ;; - -D|-U|--rule|--suppress|--template|--max-configs) + -D|-U|--rule|--suppress|--template|--max-configs|-h|--help|--version|\ + --errorlist|--config-exclude|-l) return ;; --enable) @@ -22,8 +23,9 @@ _cppcheck() cur="${cur##*,}" split=true fi - COMPREPLY=( $( compgen -W 'all style performance portability - information unusedFunction missingInclude' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'all warning style performance + portability information unusedFunction missingInclude' \ + -- "$cur" ) ) $split && COMPREPLY=( ${COMPREPLY[@]/#/"$prev,"} ) return ;; @@ -31,6 +33,11 @@ _cppcheck() COMPREPLY=( $( compgen -W '{0..255}' -- "$cur" ) ) return ;; + --file-list) + _filedir + [[ -z $cur || $cur == - ]] && COMPREPLY+=( - ) + return + ;; -I) _filedir -d return @@ -49,8 +56,9 @@ _cppcheck() return ;; --platform) - COMPREPLY=( $( compgen -W 'unix32 unix64 win32A win32W win64' \ - -- "$cur" ) ) + _filedir + COMPREPLY+=( $( compgen -W 'unix32 unix64 win32A win32W win64 + native' -- "$cur" ) ) return ;; -rp|--relative-paths) @@ -59,6 +67,10 @@ _cppcheck() return fi ;; + --library) + _filedir cfg + return + ;; --xml-version) COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) return @@ -71,9 +83,9 @@ _cppcheck() COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace else - _filedir @(cpp|cxx|cc|c++|c|h|hpp|hxx|h++|tpp|txx) + _filedir '@([cht]pp|[cht]xx|cc|[ch]++|[ch])' fi } && complete -F _cppcheck cppcheck -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/crontab b/completions/crontab index ddd0066c..bb8d0e24 100644 --- a/completions/crontab +++ b/completions/crontab @@ -8,7 +8,7 @@ _crontab() case $prev in -u) _allowed_users - return 0 + return ;; esac @@ -18,31 +18,31 @@ _crontab() local i for (( i=0; i < ${#words[@]}-1; i++ )); do - [[ ${words[i]} ]] && unset opts[${words[i]}] + [[ ${words[i]} ]] && unset "opts[${words[i]}]" case "${words[i]}" in -l) - unset opts[-r] opts[-e] opts[-i] opts[-s] + unset 'opts[-r]' 'opts[-e]' 'opts[-i]' 'opts[-s]' ;; -e) - unset opts[-l] opts[-r] opts[-i] + unset 'opts[-l]' 'opts[-r]' 'opts[-i]' ;; -r) - unset opts[-l] opts[-e] + unset 'opts[-l]' 'opts[-e]' ;; -u) - unset opts[-i] + unset 'opts[-i]' ;; esac done if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '${!opts[@]}' -- "$cur" ) ) - return 0 + return fi # do filenames only if we did not have -l, -r, or -e - [[ "${words[@]}" == *\ -@(l|r|e)* ]] || _filedir + [[ "${words[@]}" == *\ -[lre]* ]] || _filedir } && complete -F _crontab crontab -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/cryptsetup b/completions/cryptsetup index a295a147..9411ad7a 100644 --- a/completions/cryptsetup +++ b/completions/cryptsetup @@ -20,7 +20,7 @@ _cryptsetup() case $prev in --key-file|--master-key-file|--header-backup-file|-d) _filedir - return 0 + return ;; esac @@ -99,8 +99,7 @@ _cryptsetup() esac fi - return 0 } && complete -F _cryptsetup cryptsetup -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/curl b/completions/curl index 6b56aa57..8251674c 100644 --- a/completions/curl +++ b/completions/curl @@ -92,4 +92,4 @@ _curl() } && complete -F _curl curl -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/cvs b/completions/cvs index 71277556..fee256f2 100644 --- a/completions/cvs +++ b/completions/cvs @@ -51,7 +51,7 @@ _cvs() _init_completion -n : || return local count mode i cvsroot cvsroots pwd - local -a flags miss files entries changed newremoved + local -a flags files entries changed newremoved count=0 for i in "${words[@]}"; do @@ -64,7 +64,7 @@ _cvs() case $i in -H|--help) COMPREPLY=( $( compgen -W "$( _cvs_commands )" -- "$cur" ) ) - return 0 + return ;; -d) mode=cvsroot @@ -131,7 +131,7 @@ _cvs() mode=version ;; esac - elif [[ "$i" = -* ]]; then + elif [[ "$i" == -* ]]; then flags+=( $i ) fi count=$((++count)) @@ -141,11 +141,11 @@ _cvs() add) case $prev in -m) - return 0 + return ;; -k) _cvs_kflags - return 0 + return ;; esac @@ -156,11 +156,11 @@ _cvs() local f for i in ${!files[@]}; do if [[ ${files[i]} == ?(*/)CVS ]]; then - unset files[i] + unset 'files[i]' else for f in "${entries[@]}"; do if [[ ${files[i]} == $f && ! -d $f ]]; then - unset files[i] + unset 'files[i]' break fi done @@ -175,19 +175,19 @@ _cvs() admin) case $prev in -a|-A|-b|-c|-e|-l|-m|-n|-N|-o|-s|-t-|-u) - return 0 + return ;; -t) _filedir - return 0 + return ;; -k) _cvs_kflags - return 0 + return ;; esac - if [[ "$cur" = -* ]]; then + if [[ "$cur" == -* ]]; then _cvs_command_options "$1" $mode else _cvs_entries @@ -195,9 +195,9 @@ _cvs() fi ;; annotate) - [[ "$prev" == -@(r|D) ]] && return 0 + [[ "$prev" == -[rD] ]] && return - if [[ "$cur" = -* ]]; then + if [[ "$cur" == -* ]]; then _cvs_command_options "$1" $mode else _cvs_entries @@ -206,16 +206,16 @@ _cvs() ;; checkout) case $prev in - -r|-D|j) - return 0 + -r|-D|-j) + return ;; -d) _filedir -d - return 0 + return ;; -k) _cvs_kflags - return 0 + return ;; esac @@ -231,11 +231,11 @@ _cvs() commit) case $prev in -m|-r) - return 0 + return ;; -F) _filedir - return 0 + return ;; esac @@ -248,9 +248,9 @@ _cvs() # far, but other changes (something other than # changed/removed/new) may be missing changed=( $( cvs -q diff --brief 2>&1 | \ - sed -ne 's/^Files [^ ]* and \([^ ]*\) differ$/\1/p' ) ) + command sed -ne 's/^Files [^ ]* and \([^ ]*\) differ$/\1/p' ) ) newremoved=( $( cvs -q diff --brief 2>&1 | \ - sed -ne 's/^cvs diff: \([^ ]*\) .*, no comparison available$/\1/p' ) ) + command sed -ne 's/^cvs diff: \([^ ]*\) .*, no comparison available$/\1/p' ) ) COMPREPLY=( $( compgen -W '${changed[@]:-} \ ${newremoved[@]:-}' -- "$cur" ) ) else @@ -274,7 +274,7 @@ _cvs() fi ;; editors|watchers) - if [[ "$cur" = -* ]]; then + if [[ "$cur" == -* ]]; then _cvs_command_options "$1" $mode else _cvs_entries @@ -284,15 +284,15 @@ _cvs() export) case $prev in -r|-D) - return 0 + return ;; -d) _filedir -d - return 0 + return ;; -k) _cvs_kflags - return 0 + return ;; esac @@ -307,11 +307,11 @@ _cvs() import) case $prev in -I|-b|-m|-W) - return 0 + return ;; -k) _cvs_kflags - return 0 + return ;; esac @@ -334,11 +334,13 @@ _cvs() remove) if [[ "$cur" != -* ]]; then _cvs_entries - # find out what files are missing - for i in "${entries[@]}"; do - [[ ! -r $i ]] && miss+=( $i ) - done - COMPREPLY=( $( compgen -W '${miss[@]:-}' -- "$cur" ) ) + if [[ "$prev" != -f ]]; then + # find out what files are missing + for i in ${!entries[@]}; do + [[ -r "${entries[i]}" ]] && unset 'entries[i]' + done + fi + COMPREPLY=( $( compgen -W '${entries[@]:-}' -- "$cur" ) ) else _cvs_command_options "$1" $mode fi @@ -346,15 +348,15 @@ _cvs() update) case $prev in -r|-D|-j|-I|-W) - return 0 + return ;; -k) _cvs_kflags - return 0 + return ;; esac - if [[ "$cur" = -* ]]; then + if [[ "$cur" == -* ]]; then _cvs_command_options "$1" $mode else _cvs_entries @@ -365,14 +367,14 @@ _cvs() case $prev in -T) _filedir -d - return 0 + return ;; -e|-s) - return 0 + return ;; -z) COMPREPLY=( $( compgen -W '{1..9}' -- "$cur" ) ) - return 0 + return ;; esac @@ -382,8 +384,7 @@ _cvs() ;; esac - return 0 } && complete -F _cvs cvs -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/cvsps b/completions/cvsps index 8b986f57..64dab54f 100644 --- a/completions/cvsps +++ b/completions/cvsps @@ -7,43 +7,43 @@ _cvsps() case $prev in -h|-z|-f|-d|-l|--diff-opts|--debuglvl) - return 0 + return ;; -s) - COMPREPLY=( $( compgen -W "$( cvsps 2>/dev/null | + COMPREPLY=( $( compgen -W "$( $1 2>/dev/null | awk '/^PatchSet:?[ \t]/ { print $2 }' )" -- "$cur" ) ) - return 0 + return ;; -a) - COMPREPLY=( $( compgen -W "$( cvsps 2>/dev/null | + COMPREPLY=( $( compgen -W "$( $1 2>/dev/null | awk '/^Author:[ \t]/ { print $2 }' )" -- "$cur" ) ) - return 0 + return ;; -b) - COMPREPLY=( $( compgen -W "$( cvsps 2>/dev/null | + COMPREPLY=( $( compgen -W "$( $1 2>/dev/null | awk '/^Branch:[ \t]/ { print $2 }' )" -- "$cur" ) ) - return 0 + return ;; -r) - COMPREPLY=( $( compgen -W "$( cvsps 2>/dev/null | + COMPREPLY=( $( compgen -W "$( $1 2>/dev/null | awk '/^Tag:[ \t]+[^(]/ { print $2 }' )" -- "$cur" ) ) - return 0 + return ;; -p) _filedir -d - return 0 + return ;; --test-log) _filedir - return 0 + return ;; -Z) COMPREPLY=( $( compgen -W '{1..9}' -- "$cur" ) ) - return 0 + return ;; --root) _xfunc cvs _cvs_roots - return 0 + return ;; esac @@ -55,4 +55,4 @@ _cvsps() } && complete -F _cvsps cvsps -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/dd b/completions/dd index 53132dcc..daaebbe1 100644 --- a/completions/dd +++ b/completions/dd @@ -9,22 +9,35 @@ _dd() if=*|of=*) cur=${cur#*=} _filedir - return 0 + return ;; conv=*) cur=${cur#*=} COMPREPLY=( $( compgen -W 'ascii ebcdic ibm block unblock lcase - notrunc ucase swab noerror sync' -- "$cur" ) ) - return 0 + ucase sparse swab sync excl nocreat notrunc noerror fdatasync + fsync' -- "$cur" ) ) + return + ;; + iflag=*|oflag=*) + cur=${cur#*=} + COMPREPLY=( $( compgen -W 'append direct directory dsync sync + fullblock nonblock noatime nocache noctty nofollow count_bytes + skip_bytes seek_bytes' -- "$cur" ) ) + return + ;; + status=*) + cur=${cur#*=} + COMPREPLY=( $( compgen -W 'none noxfer progress' -- "$cur" ) ) + return ;; esac - _expand || return 0 + _expand || return COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) \ - $( compgen -W 'bs cbs conv count ibs if obs of seek skip' \ - -S '=' -- "$cur" ) ) + $( compgen -W 'bs cbs conv count ibs if iflag obs of oflag + seek skip status' -S '=' -- "$cur" ) ) } && complete -F _dd -o nospace dd -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/deja-dup b/completions/deja-dup new file mode 100644 index 00000000..a508bb1e --- /dev/null +++ b/completions/deja-dup @@ -0,0 +1,33 @@ +# bash completion for deja-dup(1) -*- shell-script -*- + +_deja_dup() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + -'?'|--help|--help-*) + return + ;; + --restore) + _filedir + return + ;; + --restore-missing) + _filedir -d + return + ;; + esac + + $split && return + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help-all )' \ + -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + fi +} && +complete -F _deja_dup deja-dup + +# ex: filetype=sh diff --git a/completions/desktop-file-validate b/completions/desktop-file-validate index faae6c37..93f21061 100644 --- a/completions/desktop-file-validate +++ b/completions/desktop-file-validate @@ -20,4 +20,4 @@ _desktop_file_validate() } && complete -F _desktop_file_validate desktop-file-validate -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/dhclient b/completions/dhclient index 54d89d31..8b44f6c3 100644 --- a/completions/dhclient +++ b/completions/dhclient @@ -8,11 +8,11 @@ _dhclient() case $prev in -cf|-lf|-pf|-sf) _filedir - return 0 + return ;; -s) _known_hosts_real "$cur" - return 0 + return ;; esac @@ -25,4 +25,4 @@ _dhclient() } && complete -F _dhclient dhclient -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/dict b/completions/dict index a2ecd9b1..ac7df3fc 100644 --- a/completions/dict +++ b/completions/dict @@ -2,8 +2,8 @@ _dictdata() { - dict $host $port $1 2>/dev/null | sed -ne \ - 's/^['$'\t '']['$'\t '']*\([^'$'\t '']*\).*$/\1/p' + dict $host $port $1 2>/dev/null | command sed -ne \ + 's/^[[:blank:]]\{1,\}\([^[:blank:]]*\).*$/\1/p' } _dict() @@ -30,26 +30,22 @@ _dict() [[ -n $db ]] && host="-d $db" i=$((++i)) ;; - *) - ;; esac done - if [[ "$cur" = -* ]]; then + if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - return 0 + return fi case $prev in -d|--database|-i|-info) COMPREPLY=( $( compgen -W '$( _dictdata -D )' -- "$cur" ) ) - return 0 + return ;; -s|--strategy) COMPREPLY=( $( compgen -W '$( _dictdata -S )' -- "$cur" ) ) - return 0 - ;; - *) + return ;; esac @@ -68,4 +64,4 @@ _dict() } && complete -F _dict -o default dict rdict -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/dmesg b/completions/dmesg deleted file mode 100644 index 3d9bc662..00000000 --- a/completions/dmesg +++ /dev/null @@ -1,31 +0,0 @@ -# dmesg(1) completion -*- shell-script -*- - -_dmesg() -{ - [[ $OSTYPE == *solaris* ]] && return # no args there - - local cur prev words cword - _init_completion || return - - case $prev in - -h|--help|-V|--version|-s|--buffer-size|-M|-N) - return - ;; - -f|--facility) - COMPREPLY=( $( compgen -W 'kern user mail daemon auth syslog lpr - news' -- "$cur" ) ) - return - ;; - -l|--level|-n|--console-level) - COMPREPLY=( $( compgen -W '{1..8}' -- "$cur" ) ) - return - ;; - esac - - local opts=$( _parse_help "$1" ) - [[ $opts ]] || opts=$( _parse_usage "$1" ) - COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) ) -} && -complete -F _dmesg dmesg - -# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/dnsspoof b/completions/dnsspoof index 2518af69..d6b7872b 100644 --- a/completions/dnsspoof +++ b/completions/dnsspoof @@ -8,11 +8,11 @@ _dnsspoof() case $prev in -i) _available_interfaces -a - return 0 + return ;; -f) _filedir - return 0 + return ;; esac @@ -23,4 +23,4 @@ _dnsspoof() } && complete -F _dnsspoof dnsspoof -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/dot b/completions/dot index ef946e4b..bc3531bb 100644 --- a/completions/dot +++ b/completions/dot @@ -5,7 +5,7 @@ _dot() local cur prev words cword _init_completion -n := || return - [[ $prev == -@(V|\?) ]] && return + [[ $prev == -[V?] ]] && return case $cur in -G*|-N*|-E*|-l?*|-q?*|-s?*|-Ln*|-LU*|-LC*|-LT*) @@ -13,13 +13,13 @@ _dot() ;; -T*) local langs=( $( "$1" -TNON_EXISTENT 2>&1 | \ - sed -ne 's/.*one of://p' ) ) + command sed -ne 's/.*one of://p' ) ) COMPREPLY=( $( compgen -P -T -W '${langs[@]}' -- "${cur#-T}" ) ) return ;; -K*) local layouts=( $( "$1" -KNON_EXISTENT 2>&1 | \ - sed -ne 's/.*one of://p' ) ) + command sed -ne 's/.*one of://p' ) ) COMPREPLY=( $( compgen -P -K -W '${layouts[@]}' -- "${cur#-K}" ) ) return ;; @@ -34,7 +34,7 @@ _dot() if [[ $cur == -* ]]; then COMPREPLY=( $( compgen -W '-V -v -G -N -E -T -K -l -o -O -P -q -s -y -n -n1 -n2 -x -Lg -LO -Ln -LU -LC -LT -m -c -?' -- "$cur" ) ) - [[ $COMPREPLY == -@(G|N|E|T|K|o|L[nUCT]) ]] && compopt -o nospace + [[ $COMPREPLY == -@([GNETKo]|L[nUCT]) ]] && compopt -o nospace return fi @@ -42,4 +42,4 @@ _dot() } && complete -F _dot dot -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/dpkg b/completions/dpkg index d14e5e3e..725542a7 100644 --- a/completions/dpkg +++ b/completions/dpkg @@ -8,11 +8,11 @@ _comp_dpkg_installed_packages() } || { _comp_dpkg_installed_packages() { - command grep -A 1 "Package: $1" /var/lib/dpkg/status | \ + command grep -A 1 "Package: $1" /var/lib/dpkg/status 2>/dev/null | \ command grep -B 1 -Ee "ok installed|half-installed|unpacked| \ half-configured" \ -Ee "^Essential: yes" | \ - command grep "Package: $1" | cut -d\ -f2 + awk "/Package: $1/ { print \$2 }" 2>/dev/null } } @@ -24,11 +24,11 @@ _comp_dpkg_purgeable_packages() } || { _comp_dpkg_purgeable_packages() { - command grep -A 1 "Package: $1" /var/lib/dpkg/status | \ + command grep -A 1 "Package: $1" /var/lib/dpkg/status 2>/dev/null | \ command grep -B 1 -Ee "ok installed|half-installed|unpacked| \ half-configured|config-files" \ -Ee "^Essential: yes" | \ - command grep "Package: $1" | cut -d\ -f2 + awk "/Package: $1/ { print \$2 }" 2>/dev/null } } @@ -39,8 +39,6 @@ _dpkg() local cur prev words cword split _init_completion -s || return - _expand || return 0 - local i=$cword # find the last option flag @@ -55,28 +53,28 @@ _dpkg() -c|-i|-A|-I|-f|-e|-x|-X|-W|--install|--unpack|--record-avail| \ --contents|--info|--fsys-tarfile|--field|--control|--extract| \ --show) - _filedir '?(u)deb' - return 0 + _filedir '?(u|d)deb' + return ;; -b|--build) _filedir -d - return 0 + return ;; -s|-p|-l|--status|--print-avail|--list) COMPREPLY=( $( apt-cache pkgnames "$cur" 2>/dev/null ) ) - return 0 + return ;; -S|--search) _filedir - return 0 + return ;; -r|--remove) COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) ) - return 0 + return ;; -L|-P|--listfiles|--purge) COMPREPLY=( $( _comp_dpkg_purgeable_packages "$cur" ) ) - return 0 + return ;; esac @@ -98,25 +96,25 @@ _dpkg_reconfigure() case $prev in -f|--frontend) - opt=( $( printf '%s\n' /usr/share/perl5/Debconf/FrontEnd/* ) ) - opt=( ${opt[@]##*/} ) - opt=( ${opt[@]%.pm} ) - COMPREPLY=( $( compgen -W '${opt[@]}' -- "$cur" ) ) - return 0 - ;; + opt=( $( printf '%s\n' /usr/share/perl5/Debconf/FrontEnd/* ) ) + opt=( ${opt[@]##*/} ) + opt=( ${opt[@]%.pm} ) + COMPREPLY=( $( compgen -W '${opt[@]}' -- "$cur" ) ) + return + ;; -p|--priority) - COMPREPLY=( $( compgen -W 'low medium high critical' -- "$cur" ) ) - return 0 - ;; + COMPREPLY=( $( compgen -W 'low medium high critical' -- "$cur" ) ) + return + ;; esac if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W '--frontend --priority --all --unseen-only - --help --showold --force --terse' -- "$cur" ) ) + --help --showold --force --terse' -- "$cur" ) ) else COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) ) fi } && complete -F _dpkg_reconfigure -o default dpkg-reconfigure -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/dpkg-source b/completions/dpkg-source index 6cd9bde3..54403851 100644 --- a/completions/dpkg-source +++ b/completions/dpkg-source @@ -8,7 +8,7 @@ _dpkg_source() local options work i action packopts unpackopts fields packopts="-c -l -F -V -T -D -U -W -E -sa -i -I -sk -sr -ss -sA -sK -sP \ - -sU -sR" + -sU -sR" unpackopts="-sp -sn -su" options="-x -b $packopts $unpackopts" fields="Format Source Version Binary Maintainer Uploader Architecture \ @@ -31,22 +31,19 @@ _dpkg_source() -x) _filedir -d _filedir 'dsc' - return 0 ;; *) COMPREPLY=( $( compgen -W "$unpackopts" -- "$cur" ) ) _filedir -d _filedir - return 0 ;; esac - return 0 + return ;; pack) case $prev in -b) _filedir -d - return 0 ;; -c|-l|-T|-i|-I) # -c: get controlfile @@ -57,19 +54,16 @@ _dpkg_source() # return directory names and file names _filedir -d _filedir - return 0 ;; -F) # -F: force change log format COMPREPLY=( $( command ls /usr/lib/dpkg/parsechangelog ) ) - return 0 ;; -V|-D) # -V: set a substitution variable # we don't know anything about possible variables or values # so we don't try to suggest any completion. COMPREPLY=() - return 0 ;; -D) # -D: override or add a .dsc field and value @@ -77,31 +71,28 @@ _dpkg_source() if [[ "$cur" == *=* ]]; then # $cur contains a "=" COMPREPLY=() - return 0 else COMPREPLY=( $( compgen -W "$fields" -- "$cur" ) ) - return 0 fi ;; -U) # -U: remove a field # Suggest possible fieldnames COMPREPLY=( $( compgen -W "$fields" -- "$cur" ) ) - return 0 ;; *) - COMPREPLY=( $( compgen -W "$packopts $unpackopts" -- "$cur" ) ) - return 0 + COMPREPLY=( $( compgen -W "$packopts $unpackopts" \ + -- "$cur" ) ) ;; esac - return 0 + return ;; *) COMPREPLY=( $( compgen -W "$options" -- "$cur" ) ) - return 0 + return ;; esac } && complete -F _dpkg_source dpkg-source -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/dselect b/completions/dselect index ee3cb2a7..e5f148cb 100644 --- a/completions/dselect +++ b/completions/dselect @@ -8,11 +8,11 @@ _dselect() case $prev in --admindir) _filedir -d - return 0 + return ;; -D|-debug) _filedir - return 0 + return ;; esac @@ -24,8 +24,7 @@ _dselect() quit' -- "$cur" ) ) fi - return 0 } && complete -F _dselect dselect -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/dsniff b/completions/dsniff index db9b02ac..165ab74b 100644 --- a/completions/dsniff +++ b/completions/dsniff @@ -8,11 +8,11 @@ _dsniff() case $prev in -r|-w|-f|-p) _filedir - return 0 + return ;; -i) _available_interfaces -a - return 0 + return ;; esac @@ -23,4 +23,4 @@ _dsniff() } && complete -F _dsniff dsniff -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/dumpdb b/completions/dumpdb index f097f895..ced754f5 100644 --- a/completions/dumpdb +++ b/completions/dumpdb @@ -15,4 +15,4 @@ _dumpdb() } && complete -F _dumpdb dumpdb -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/dumpe2fs b/completions/dumpe2fs index 127b46fc..90f84791 100644 --- a/completions/dumpe2fs +++ b/completions/dumpe2fs @@ -7,17 +7,17 @@ _dumpe2fs() case $prev in -o|-V) - return 0 + return ;; -i) _filedir - return 0 + return ;; esac if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) - return 0 + return fi cur=${cur:=/dev/} @@ -25,4 +25,4 @@ _dumpe2fs() } && complete -F _dumpe2fs dumpe2fs -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/e2freefrag b/completions/e2freefrag index 6a971156..bee4a169 100644 --- a/completions/e2freefrag +++ b/completions/e2freefrag @@ -7,13 +7,13 @@ _e2freefrag() case $prev in -c|-h) - return 0 + return ;; esac if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" -h )' -- "$cur" ) ) - return 0 + return fi cur=${cur:=/dev/} @@ -21,4 +21,4 @@ _e2freefrag() } && complete -F _e2freefrag e2freefrag -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/e2label b/completions/e2label index 94bcc1c8..c145c3a0 100644 --- a/completions/e2label +++ b/completions/e2label @@ -12,4 +12,4 @@ _e2label() } && complete -F _e2label e2label -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/eject b/completions/eject deleted file mode 100644 index d6b1f6d9..00000000 --- a/completions/eject +++ /dev/null @@ -1,30 +0,0 @@ -# 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 index 6da35e15..d5621119 100644 --- a/completions/eog +++ b/completions/eog @@ -20,8 +20,8 @@ _eog() return fi - _filedir '@(ani|?(w)bmp|gif|ico|j2k|jp[cefgx2]|jpeg|pcx|pn[gm]|ras|svg?(z)|tga|tif?(f)|x[bp]m)' + _filedir '@(ani|?(w)bmp|gif|ico|j2[ck]|jp[cefgx2]|jpeg|jpg2|pcx|p[gp]m|pn[gm]|ras|svg?(z)|tga|tif?(f)|x[bp]m)' } && complete -F _eog eog -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/ether-wake b/completions/ether-wake index 4957e055..387b2d64 100644 --- a/completions/ether-wake +++ b/completions/ether-wake @@ -8,20 +8,20 @@ _ether_wake() case $prev in -i) _available_interfaces -a - return 0 + return ;; -p) - return 0 + return ;; esac if [[ $cur == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" -u ) -V' -- "$cur" ) ) - return 0 + return fi _mac_addresses } && complete -F _ether_wake ether-wake -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/evince b/completions/evince index 8ef75160..eb6c7305 100644 --- a/completions/evince +++ b/completions/evince @@ -17,7 +17,7 @@ _evince() ;; esac - $split && return 0 + $split && return if [[ $cur == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help-all )' \ @@ -30,4 +30,4 @@ _evince() } && complete -F _evince evince -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/explodepkg b/completions/explodepkg index b6914750..a281f81e 100644 --- a/completions/explodepkg +++ b/completions/explodepkg @@ -2,4 +2,4 @@ complete -o plusdirs -f -X '!*.t[bglx]z' explodepkg -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/export b/completions/export index 42273a9e..31715f9a 100644 --- a/completions/export +++ b/completions/export @@ -24,7 +24,12 @@ _export() break done - [[ $cur == *=\$* ]] && { cur=${cur#*=}; _variables; } && return + if [[ $cur == *=* ]]; then + local ocur=$cur oprev=$prev + prev=${cur%%=*} cur=${cur#*=} + _variables && return + cur=$ocur prev=$oprev + fi case $cur in *=) @@ -58,4 +63,4 @@ _export() } && complete -F _export export -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/faillog b/completions/faillog index 77ca9c72..3b4a23d0 100644 --- a/completions/faillog +++ b/completions/faillog @@ -7,22 +7,21 @@ _faillog() case $prev in -h|--help|-l|--lock-time|-m|--maximum|-t|--time) - return 0 + return ;; -u|--user) COMPREPLY=( $( compgen -u -- "$cur" ) ) - return 0 + return ;; esac - $split && return 0 + $split && return if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace - return 0 fi } && complete -F _faillog faillog -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/fbgs b/completions/fbgs index 8058e01a..c58a7af9 100644 --- a/completions/fbgs +++ b/completions/fbgs @@ -12,7 +12,7 @@ _fbgs() return ;; -m|--mode) - COMPREPLY=( $( compgen -W '$( sed \ + COMPREPLY=( $( compgen -W '$( command sed \ -n "/^mode/{s/^mode \{1,\}\"\([^\"]\{1,\}\)\"/\1/g;p}" \ /etc/fb.modes 2> /dev/null )' -- "$cur" ) ) return @@ -44,6 +44,7 @@ _fbgs() fi _filedir '?(e)ps|pdf' -} && complete -F _fbgs fbgs +} && +complete -F _fbgs fbgs -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/fbi b/completions/fbi index 5073607a..75b46b61 100644 --- a/completions/fbi +++ b/completions/fbi @@ -20,7 +20,7 @@ _fbi() return ;; -m|--mode) - COMPREPLY=( $( compgen -W '$( sed \ + COMPREPLY=( $( compgen -W '$( command sed \ -n "/^mode/{s/^mode \{1,\}\"\([^\"]\{1,\}\)\"/\1/g;p}" \ /etc/fb.modes 2> /dev/null )' -- "$cur" ) ) return @@ -48,6 +48,7 @@ _fbi() # FIXME: It is hard to determine correct supported extensions. # fbi can handle any format that imagemagick can plus some others _filedir 'bmp|gif|jp?(e)g|pcd|png|p[pgb]m|tif?(f)|webp|xpm|xwd|?(e)ps|pdf|dvi|txt|svg?(z)|cdr|[ot]tf' -} && complete -F _fbi fbi +} && +complete -F _fbi fbi -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/feh b/completions/feh index e53ca2b1..1cd75420 100644 --- a/completions/feh +++ b/completions/feh @@ -52,8 +52,8 @@ _feh() return ;; -S|--sort) - COMPREPLY=( $( compgen -W 'name filename width height pixels size - format' -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'name filename mtime width height + pixels size format' -- "$cur" ) ) return ;; -R|--reload|-H|--limit-height|-W|--limit-width|-E|--thumb-height|\ @@ -100,6 +100,7 @@ _feh() $split && return if [[ "$cur" == -* ]]; then + # Some versions of feh just output "See 'man feh'" for --help :( COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace [[ $COMPREPLY ]] && return @@ -108,6 +109,7 @@ _feh() # FIXME: It is hard to determine correct supported extensions. # feh can handle any format that imagemagick can plus some others _filedir 'xpm|tif?(f)|png|p[npgba]m|iff|?(i)lbm|jp?(e)g|jfi?(f)|gif|bmp|arg?(b)|tga|xcf|ani|ico|?(e)ps|pdf|dvi|txt|svg?(z)|cdr|[ot]tf' -} && complete -F _feh feh +} && +complete -F _feh feh -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/file b/completions/file index 172fd5e0..f3f6df88 100644 --- a/completions/file +++ b/completions/file @@ -29,4 +29,4 @@ _file() } && complete -F _file file -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/file-roller b/completions/file-roller index c05565d9..3c627585 100644 --- a/completions/file-roller +++ b/completions/file-roller @@ -5,7 +5,7 @@ _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)' + local exts='@(7z|ace|alz|ar|arj|[bglx]z|bz2|tb?(z)2|cab|cb[rz]|iso?(9660)|Z|t[abglx]z|cpio|deb|rar|?(g)tar|gem|lh[az]|lzh|?(t)lrz|lzma|lzo|wim|swm|rpm|sit|zoo)' case $prev in -'?'|--help|--help-all|--help-gtk|--help-sm-client) @@ -16,6 +16,7 @@ _file_roller() return ;; -a|--add-to) + _filedir_xspec unzip _filedir "$exts" return ;; @@ -34,8 +35,9 @@ _file_roller() return fi + _filedir_xspec unzip _filedir "$exts" } && complete -F _file_roller file-roller -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/filefrag b/completions/filefrag index ee9d0d81..b4866dc0 100644 --- a/completions/filefrag +++ b/completions/filefrag @@ -7,11 +7,11 @@ _filefrag() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) - return 0 + return fi _filedir } && complete -F _filefrag filefrag -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/filesnarf b/completions/filesnarf index dbadd434..0cdcfe27 100644 --- a/completions/filesnarf +++ b/completions/filesnarf @@ -8,7 +8,7 @@ _snarf() case $prev in -i) _available_interfaces -a - return 0 + return ;; esac @@ -19,4 +19,4 @@ _snarf() } && complete -F _snarf filesnarf mailsnarf msgsnarf -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/find b/completions/find index 1896fc22..39029345 100644 --- a/completions/find +++ b/completions/find @@ -10,70 +10,70 @@ _find() case $prev in -maxdepth|-mindepth) COMPREPLY=( $( compgen -W '{0..9}' -- "$cur" ) ) - return 0 + return ;; -newer|-anewer|-cnewer|-fls|-fprint|-fprint0|-fprintf|-name|-iname|\ -lname|-ilname|-wholename|-iwholename|-samefile) _filedir - return 0 + return ;; -fstype) _fstypes [[ $OSTYPE == *bsd* ]] && \ COMPREPLY+=( $( compgen -W 'local rdonly' -- "$cur" ) ) - return 0 + return ;; -gid) _gids - return 0 + return ;; -group) COMPREPLY=( $( compgen -g -- "$cur" 2>/dev/null) ) - return 0 + return ;; -xtype|-type) COMPREPLY=( $( compgen -W 'b c d p f l s' -- "$cur" ) ) - return 0 + return ;; -uid) _uids - return 0 + return ;; -user) COMPREPLY=( $( compgen -u -- "$cur" ) ) - return 0 + return ;; -exec|-execdir|-ok|-okdir) words=(words[0] "$cur") cword=1 _command - return 0 + return ;; -[acm]min|-[acm]time|-iname|-lname|-wholename|-iwholename|-lwholename|\ -ilwholename|-inum|-path|-ipath|-regex|-iregex|-links|-perm|-size|\ -used|-printf|-context) # do nothing, just wait for a parameter to be given - return 0 + return ;; -regextype) COMPREPLY=( $( compgen -W 'emacs posix-awk posix-basic posix-egrep posix-extended' -- "$cur" ) ) - return 0 + return ;; esac - _expand || return 0 + _expand || return local i exprfound=false # set exprfound to true if there is already an expression present for i in ${words[@]}; do - [[ "$i" = [-\(\),\!]* ]] && exprfound=true && break + [[ "$i" == [-\(\),\!]* ]] && exprfound=true && break done # handle case where first parameter is not a dash option if ! $exprfound && [[ "$cur" != [-\(\),\!]* ]]; then _filedir -d - return 0 + return fi # complete using basic options @@ -101,15 +101,14 @@ _find() for i in "${words[@]}"; do [[ $i && ${onlyonce[$i]} ]] || continue for j in ${!COMPREPLY[@]}; do - [[ ${COMPREPLY[j]} == $i ]] && unset COMPREPLY[j] + [[ ${COMPREPLY[j]} == $i ]] && unset 'COMPREPLY[j]' done done fi _filedir - return 0 } && complete -F _find find -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/find_member b/completions/find_member index b1fcaf62..df1a24f9 100644 --- a/completions/find_member +++ b/completions/find_member @@ -8,11 +8,11 @@ _find_member() case $prev in -l|-x|--listname|--exclude) _xfunc list_lists _mailman_lists - return 0 + return ;; esac - $split && return 0 + $split && return if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '--listname --exclude --owners --help' \ @@ -22,4 +22,4 @@ _find_member() } && complete -F _find_member find_member -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/flake8 b/completions/flake8 new file mode 100644 index 00000000..60ad9e2b --- /dev/null +++ b/completions/flake8 @@ -0,0 +1,35 @@ +# flake8 completion -*- shell-script -*- + +_flake8() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + -h|--help|--version|--exclude|--filename|--select|--ignore|\ + --max-line-length|--max-complexity|--builtins) + return + ;; + --format) + COMPREPLY=( $( compgen -W 'default pylint' -- "$cur" ) ) + return + ;; + --config) + _filedir + return + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + fi + + _filedir py +} && +complete -F _flake8 flake8 + +# ex: filetype=sh diff --git a/completions/freebsd-update b/completions/freebsd-update new file mode 100644 index 00000000..6ee2438b --- /dev/null +++ b/completions/freebsd-update @@ -0,0 +1,29 @@ +# bash completion for FreeBSD update tool - freebsd-update -*- shell-script -*- + +[[ $OSTYPE == *freebsd* ]] || return 1 + +_freebsd_update() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -b|-d) + _filedir -d + return + ;; + -f) + _filedir + return + ;; + -k|-r|-s|-t) + return + ;; + esac + + COMPREPLY=( $(compgen -W "fetch cron upgrade install rollback IDS" -- \ + $cur) ) +} && +complete -F _freebsd_update freebsd-update + +# ex: filetype=sh diff --git a/completions/freeciv-gtk2 b/completions/freeciv-gtk2 index c818433d..246d4f20 100644 --- a/completions/freeciv-gtk2 +++ b/completions/freeciv-gtk2 @@ -8,15 +8,15 @@ _civclient() case $prev in -l|-S|-t|--log|--Sound|--tiles) _filedir - return 0 + return ;; -P|--Plugin) COMPREPLY=( $( compgen -W 'none esd sdl' -- "$cur" ) ) - return 0 + return ;; -s|--server) _known_hosts_real "$cur" - return 0 + return ;; esac @@ -27,4 +27,4 @@ _civclient() } && complete -F _civclient civclient freeciv-gtk2 freeciv-sdl freeciv-xaw -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/freeciv-server b/completions/freeciv-server index 7daa30ce..78f57afa 100644 --- a/completions/freeciv-server +++ b/completions/freeciv-server @@ -8,7 +8,7 @@ _civserver() case $prev in -f|-g|-l|-r|--file|--log|--gamelog|--read) _filedir - return 0 + return ;; esac @@ -19,4 +19,4 @@ _civserver() } && complete -F _civserver civserver freeciv-server -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/function b/completions/function index e8e4d751..fbcf10d2 100644 --- a/completions/function +++ b/completions/function @@ -6,17 +6,32 @@ _function() _init_completion || return if [[ $1 == @(declare|typeset) ]]; then - if [[ $prev == -f ]]; then - COMPREPLY=( $( compgen -A function -- "$cur" ) ) - elif [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) + if [[ $cur == [-+]* ]]; then + local opts + opts=( $( _parse_usage "$1" ) ) + # Most options also have a '+' form. We'll exclude the ones that don't with compgen. + opts+=( ${opts[*]/-/+} ) + COMPREPLY=( $( compgen -W "${opts[*]}" -X '+[Ffgp]' -- "$cur" ) ) + else + local i=1 + while [[ ${words[i]} == [-+]* ]]; do + if [[ ${words[i]} == -*[fF]* ]]; then + COMPREPLY=( $( compgen -A function -- "$cur" ) ) + return + fi + ((i++)) + done + if [[ $i -gt 1 ]]; then + # There was at least one option and it was not one that limited operations to functions + COMPREPLY=( $( compgen -A variable -- "$cur" ) ) + fi fi elif [[ $cword -eq 1 ]]; then COMPREPLY=( $( compgen -A function -- "$cur" ) ) else - COMPREPLY=( "() $( type -- ${words[1]} | sed -e 1,2d )" ) + COMPREPLY=( "() $( type -- ${words[1]} | command sed -e 1,2d )" ) fi } && complete -F _function function declare typeset -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/fusermount b/completions/fusermount index e711e791..23671bd6 100644 --- a/completions/fusermount +++ b/completions/fusermount @@ -7,13 +7,13 @@ _fusermount() case $prev in -h|-V|-o) - return 0 + return ;; -u) COMPREPLY=( $( compgen -W "$( awk \ '{ if ($3 ~ /^fuse(\.|$)/) print $2 }' /etc/mtab \ 2>/dev/null )" -- "$cur" ) ) - return 0 + return ;; esac @@ -25,4 +25,4 @@ _fusermount() } && complete -F _fusermount fusermount -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/gcc b/completions/gcc index c86fd7e6..174e0718 100644 --- a/completions/gcc +++ b/completions/gcc @@ -13,7 +13,7 @@ _gcc() local cur prev words cword _init_completion || return - _expand || return 0 + _expand || return local cc backend @@ -27,6 +27,9 @@ _gcc() *77) backend=f771 ;; + *95) + backend=f951 + ;; *) backend=cc1 # (near-)universal backend ;; @@ -39,16 +42,26 @@ _gcc() # for C/C++/ObjectiveC it's useless # for FORTRAN/Java it's an error COMPREPLY=( $( compgen -W "$( $cc --help 2>/dev/null | tr '\t' ' ' |\ - sed -e '/^ *-/!d' -e 's/ *-\([^][ <>]*\).*/-\1/' )" -- "$cur" ) ) + command sed -e '/^ *-/!d' -e 's/ *-\([^][ <>]*\).*/-\1/' )" -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace else _filedir fi } && -complete -F _gcc gcc g++ g77 gcj gpc && +complete -F _gcc gcc g++ gfortran g77 g95 gcj gpc && { - cc --version 2>/dev/null | grep -q GCC && complete -F _gcc cc || : - c++ --version 2>/dev/null | grep -q GCC && complete -F _gcc c++ || : + cc --version 2>/dev/null | command grep -q GCC || \ + [[ $( _realcommand cc ) == *gcc* ]] && \ + complete -F _gcc cc || complete -F _minimal cc + c++ --version 2>/dev/null | command grep -q GCC || \ + [[ $( _realcommand c++ ) == *g++* ]] && \ + complete -F _gcc c++ || complete -F _minimal c++ + f77 --version 2>/dev/null | command grep -q GCC || \ + [[ $( _realcommand f77 ) == *gfortran* ]] && \ + complete -F _gcc f77 || complete -F _minimal f77 + f95 --version 2>/dev/null | command grep -q GCC || \ + [[ $( _realcommand f95 ) == *gfortran* ]] && \ + complete -F _gcc f95 || complete -F _minimal f95 } -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/gcl b/completions/gcl index 385a2e06..5d1ca5f3 100644 --- a/completions/gcl +++ b/completions/gcl @@ -15,8 +15,7 @@ _gcl() _filedir fi - return 0 } && complete -F _gcl -o default gcl -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/gdb b/completions/gdb index 125d0b15..75414782 100644 --- a/completions/gdb +++ b/completions/gdb @@ -2,9 +2,18 @@ _gdb() { - local cur prev words cword + local cur prev words cword i _init_completion || return + # gdb [options] --args executable-file [inferior-arguments ...] + for (( i=1; i < cword; i++ )); do + if [[ "${words[i]}" == --args ]]; then + _command_offset $((i+1)) + return $? + fi + done + + # gdb [options] [executable-file [core-file or process-id]] if [[ $cword -eq 1 ]]; then local IFS compopt -o filenames @@ -18,7 +27,7 @@ _gdb() # names manually. IFS=":" local path_array=( $( \ - sed -e 's/:\{2,\}/:/g' -e 's/^://' -e 's/:$//' <<<"$PATH" ) ) + command sed -e 's/:\{2,\}/:/g' -e 's/^://' -e 's/:$//' <<<"$PATH" ) ) IFS=$'\n' COMPREPLY=( $( compgen -d -W '$(find "${path_array[@]}" . \ -mindepth 1 -maxdepth 1 -not -type d -executable \ @@ -34,4 +43,4 @@ _gdb() } && complete -F _gdb gdb -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/genaliases b/completions/genaliases index 32f5919a..f9a9890a 100644 --- a/completions/genaliases +++ b/completions/genaliases @@ -12,4 +12,4 @@ _genaliases() } && complete -F _genaliases genaliases -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/gendiff b/completions/gendiff index 38c0828e..cb9bab39 100644 --- a/completions/gendiff +++ b/completions/gendiff @@ -3,10 +3,10 @@ _gendiff() { local cur prev words cword - _init_completion -o @(diff|patch) || return + _init_completion -o '@(diff|patch)' || return [[ $cword -eq 1 ]] && _filedir -d } && complete -F _gendiff gendiff -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/genisoimage b/completions/genisoimage index 1d8f0401..caf6d457 100644 --- a/completions/genisoimage +++ b/completions/genisoimage @@ -9,20 +9,20 @@ _mkisofs() -o|-abstract|-biblio|-check-session|-copyright|-log-file| \ -root-info|-prep-boot|-*-list) _filedir - return 0 + return ;; -*-charset) COMPREPLY=( $( compgen -W '$( mkisofs -input-charset \ help 2>&1 | tail -n +3 )' -- "$cur" ) ) - return 0 + return ;; -uid) _uids - return 0 + return ;; -gid) _gids - return 0 + return ;; esac @@ -35,4 +35,4 @@ _mkisofs() } && complete -F _mkisofs mkisofs genisoimage -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/getent b/completions/getent index 2e99f524..0658b0bb 100644 --- a/completions/getent +++ b/completions/getent @@ -26,30 +26,30 @@ _getent() case $db in passwd) - COMPREPLY=( $( compgen -u "$cur" ) ) - return 0 + COMPREPLY=( $( compgen -u -- "$cur" ) ) + return ;; group) - COMPREPLY=( $( compgen -g "$cur" ) ) - return 0 + COMPREPLY=( $( compgen -g -- "$cur" ) ) + return ;; services) - COMPREPLY=( $( compgen -s "$cur" ) ) - return 0 + COMPREPLY=( $( compgen -s -- "$cur" ) ) + return ;; hosts) - COMPREPLY=( $( compgen -A hostname "$cur" ) ) - return 0 + COMPREPLY=( $( compgen -A hostname -- "$cur" ) ) + return ;; protocols|networks|ahosts|ahostsv4|ahostsv6|rpc) - COMPREPLY=( $( compgen -W "$( getent $db | \ + COMPREPLY=( $( compgen -W "$( $1 $db | \ awk '{ print $1 }' )" -- "$cur" ) ) - return 0 + return ;; aliases|shadow|gshadow) - COMPREPLY=( $( compgen -W "$( getent $db | cut -d: -f1 )" \ + COMPREPLY=( $( compgen -W "$( $1 $db | cut -d: -f1 )" \ -- "$cur" ) ) - return 0 + return ;; ethers|netgroup) return @@ -75,4 +75,4 @@ _getent() } && complete -F _getent getent -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/gkrellm b/completions/gkrellm index db439ebd..cfe65429 100644 --- a/completions/gkrellm +++ b/completions/gkrellm @@ -8,27 +8,27 @@ _gkrellm() case $prev in -t|--theme) _filedir -d - return 0 + return ;; -p|--plugin) _filedir so - return 0 + return ;; -s|--server) _known_hosts_real "$cur" - return 0 + return ;; -l|--logfile) _filedir - return 0 + return ;; -g|--geometry|-c|--config|-P|--port|-d|--debug-level) # Argument required but no completions available - return 0 + return ;; -h|--help|-v|--version) # All other options are noop with these - return 0 + return ;; esac @@ -36,4 +36,4 @@ _gkrellm() } && complete -F _gkrellm gkrellm gkrellm2 -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/gm b/completions/gm new file mode 100644 index 00000000..88c233c6 --- /dev/null +++ b/completions/gm @@ -0,0 +1,40 @@ +# bash completion for gm(1) -*- shell-script -*- + +_gm_commands() +{ + COMPREPLY+=( $( compgen -W '$( "$1" help | + awk "/^ +[^ ]+ +- / { print \$1 }" )' -- "$cur" ) ) +} + +_gm() +{ + local cur prev words cword + _init_completion || return + + if [[ $cword -eq 1 ]]; then + _gm_commands "$1" + return + elif [[ $cword -eq 2 && ${words[1]} == time ]]; then + _gm_commands "$1" + return + fi + + local gmcmd=${words[1]} + [[ $gmcmd == time ]] && gmcmd=${words[2]} + + case $gmcmd in + help) + [[ $prev == help ]] && _gm_commands "$1" + return + ;; + version) + return + ;; + esac + + # TODO... defer some commnds to the imagemagick "gm"less completions etc? + compopt -o default +} && +complete -F _gm gm + +# ex: filetype=sh diff --git a/completions/gnatmake b/completions/gnatmake index 458ad070..4cd24d2e 100644 --- a/completions/gnatmake +++ b/completions/gnatmake @@ -9,13 +9,13 @@ _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" ) ) + -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)' @@ -23,4 +23,4 @@ _gnatmake() } && complete -F _gnatmake gnatmake -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/gnokii b/completions/gnokii new file mode 100644 index 00000000..95ccaeae --- /dev/null +++ b/completions/gnokii @@ -0,0 +1,235 @@ +# gnokii(1) completion -*- shell-script -*- + +_gnokii_memory_type() +{ + # TODO: reduce the number of choices + COMPREPLY=( $( compgen -W "IN OU SM ME MT" -- "$cur" ) ) +} + +_gnokii() +{ + local cur prev words cword pprev tprev fprev + _init_completion || return + + case $prev in + --config) + _filedir + return + ;; + --phone) + local config_file + for config_file in "$XDG_CONFIG_HOME/gnokii/config" \ + "$HOME/.config/gnokii/config" "$HOME/.gnokiirc" \ + "$XDG_CONFIG_DIRS/gnokii/config" /etc/gnokiirc ; do + [[ -f $config_file ]] && break + done + [[ ! -f $config_file ]] && return + COMPREPLY=( $( compgen -W \ + "$( command sed -n 's/^\[phone_\(.*\)\]/\1/p' $config_file )" \ + -- "$cur" ) ) + return + ;; + --help) + COMPREPLY=( $( compgen -W 'all monitor sms mms phonebook calendar + todo dial profile settings wap logo ringtone security file + other' -- "$cur" ) ) + return + ;; + --version|--shell|ping) + return + ;; + + # MONITOR + --monitor) + COMPREPLY=( $( compgen -W 'delay once' -- "$cur" ) ) + return + ;; + --getdisplaystatus|--displayoutput) + return + ;; + --netmonitor) + COMPREPLY=( $( compgen -W 'reset off field devel next nr' \ + -- "$cur" ) ) + return + ;; + + # SMS + --sendsms) + # (how)TODO ? + return + ;; + --savesms) + COMPREPLY=( $( compgen -W '--sender --smsc --smscno --folder + --location --sent --read --deliver --datetime' -- "$cur" ) ) + return + ;; + --memory-type|--memory|--getsms|--deletesms|--getmms|--deletemms|\ + --getphonebook|--deletephonebook) + _gnokii_memory_type + return + ;; + --getsmsc|--getcalendarnote|--deletecalendarnote|--gettodo|\ + --getspeeddial) + # TODO: grab a specific entry ID + return + ;; + --setsmsc|--smsreader|--createsmsfolder|--deletealltodos|\ + --showsmsfolderstatus) + return + ;; + --deletesmsfolder|--folder) + # TODO: folderid + return + ;; + --writephonebook) + COMPREPLY=( $( compgen -W '--overwrite --find-free --memory-type + --location --vcard --ldif' -- "$cur" ) ) + return + ;; + --writecalendarnote|--writetodo) + _filedir vcf + return + ;; + + # DIAL + --setspeeddial|--dialvoice|--senddtmf|--answercall|--hangup) + # TODO + return + ;; + --divert) + COMPREPLY=( $( compgen -W '--op' -- "$cur" ) ) + return + ;; + + # PROFILE + --getprofile|--setactiveprofile) + # TODO + return + ;; + --setprofile|--getactiveprofile) + return + ;; + + # SETTINGS + --reset) + COMPREPLY=( $( compgen -W 'soft hard' -- "$cur" ) ) + return + ;; + --setdatetime|--setalarm) + # TODO + return + ;; + --getdatetime|--getalarm) + return + ;; + + # WAP + --getwapbookmark|--writewapbookmark|--deletewapbookmark|\ + --getwapsetting|--writewapsetting|--activatewapsetting) + return + ;; + + # LOGOS + --sendlogo) + COMPREPLY=( $( compgen -W 'caller op picture' -- "$cur" ) ) + return + ;; + --setlogo|--getlogo) + COMPREPLY=( $( compgen -W 'op startup caller dealer text' \ + -- "$cur" ) ) + return + ;; + --viewlogo) + # TODO: logofile + return + ;; + + --entersecuritycode) + COMPREPLY=( $( compgen -W 'PIN PIN2 PUK PUK2 SEC' -- "$cur" ) ) + return + ;; + + # TODO: RINGTONES + esac + + # second level completion + if [[ $((cword-2)) -ge 1 && ${words[cword-2]} =~ --* ]]; then + pprev=${words[cword-2]} + case $pprev in + --setspeeddial) + _gnokii_memory_type + return + ;; + --getsms|--deletesms|--getmms|--deletemms|--getphonebook|\ + --writetodo|--writecalendarnote) + # TODO: start number + return + ;; + --gettodo|--getcalendarnote) + COMPREPLY=( $( compgen -W '{1..9} end --vCal' -- "$cur" ) ) + return + ;; + --deletecalendarnote) + COMPREPLY=( $( compgen -W '{1..9} end' -- "$cur" ) ) + return + ;; + --divert) + COMPREPLY=( $( compgen -W 'register enable query disable + erasure' -- "$cur" ) ) + return + ;; + esac + fi + + # third level completion + if [[ $((cword-3)) -ge 1 && ${words[cword-3]} =~ --* ]]; then + tprev=${words[cword-3]} + case $tprev in + --deletesms|--deletemms) + COMPREPLY=( $( compgen -W 'end' -- "$cur" ) ) + return + ;; + --getphonebook|--writetodo|--writecalendarnote) + COMPREPLY=( $( compgen -W '{1..9} end' -- "$cur" ) ) + return + ;; + --gettodo|--getcalendarnote) + [[ ${words[cword-1]} == end ]] && \ + COMPREPLY=( $( compgen -W '--vCal' -- "$cur" ) ) + return + ;; + --divert) + COMPREPLY=( $( compgen -W '--type' -- "$cur" ) ) + return + esac + fi + + # fourth level completion + if [[ $((cword-4)) -ge 1 && ${words[cword-4]} =~ --* ]]; then + fprev=${words[cword-4]} + case $fprev in + --getphonebook) + COMPREPLY=( $( compgen -W '--raw --vcard --ldif' -- "$cur" ) ) + return + ;; + --divert) + COMPREPLY=( $( compgen -W 'all busy noans outofreach notavail' \ + -- "$cur" ) ) + return + esac + fi + + # safer to use LANG=C + local all_cmd="$( LANG=C _parse_help $1 "--help all" )" + # these 2 below are allowed in combination with others + local main_cmd=$( command grep -v -- '--config\|--phone' <<<"$all_cmd" ) + + # don't provide main command completions if one is + # already on the command line + [[ $COMP_LINE =~ $( tr ' ' '\b|'<<<$main_cmd ) ]] && return + + COMPREPLY=( $( compgen -W "$all_cmd" -- "$cur" ) ) +} && +complete -F _gnokii gnokii + +# ex: filetype=sh diff --git a/completions/gnome-mplayer b/completions/gnome-mplayer index 00701702..9a250419 100644 --- a/completions/gnome-mplayer +++ b/completions/gnome-mplayer @@ -36,4 +36,4 @@ _gnome_mplayer() } && complete -F _gnome_mplayer gnome-mplayer -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/gpasswd b/completions/gpasswd index eb5a7e48..ada12b8d 100644 --- a/completions/gpasswd +++ b/completions/gpasswd @@ -8,18 +8,18 @@ _gpasswd() case $prev in -a|--add|-d|--delete|-A|--administrators|-M|--members) COMPREPLY=( $( compgen -u -- "$cur" ) ) - return 0 + return ;; esac if [[ "$cur" == -* ]]; then # TODO: only -A and -M can be combined COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - return 0 + return fi COMPREPLY=( $( compgen -g -- "$cur" ) ) } && complete -F _gpasswd gpasswd -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/gpg b/completions/gpg index 91436f7a..3fee3df3 100644 --- a/completions/gpg +++ b/completions/gpg @@ -8,31 +8,31 @@ _gpg() case $prev in -s|--sign|--clearsign|--decrypt-files|--load-extension) _filedir - return 0 + return ;; --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' \ - -ne 's@^.*\(<\([^>]*\)>\).*$@\2@p' )" -- "$cur" ) ) - return 0 + COMPREPLY=( $( compgen -W "$( $1 --list-keys 2>/dev/null | command sed -ne \ + 's@^pub.*/\([^ ]*\).*$@\1@p' -ne \ + 's@^.*\(<\([^>]*\)>\).*$@\2@p' )" -- "$cur" ) ) + return ;; -r|--recipient) - COMPREPLY=( $( compgen -W "$( gpg --list-keys 2>/dev/null | \ - sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "$( $1 --list-keys 2>/dev/null | command sed -ne \ + 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" ) ) if [[ -e ~/.gnupg/gpg.conf ]]; then - COMPREPLY+=( $( compgen -W "$( sed -ne \ + COMPREPLY+=( $( compgen -W "$( command sed -ne \ 's@^[ \t]*group[ \t][ \t]*\([^=]*\).*$@\1@p' \ ~/.gnupg/gpg.conf )" -- "$cur" ) ) fi - return 0 + return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$(gpg --dump-options)' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '$($1 --dump-options)' -- "$cur" ) ) fi } && complete -F _gpg -o default gpg -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/gpg2 b/completions/gpg2 index 3efc2dbb..66630590 100644 --- a/completions/gpg2 +++ b/completions/gpg2 @@ -8,35 +8,35 @@ _gpg2() case $prev in --homedir) _filedir -d - return 0 + return ;; -s|--sign|--clearsign|--options|--decrypt) _filedir - return 0 + return ;; --export|--sign-key|--lsign-key|--nrsign-key|--nrlsign-key|--edit-key) # return list of public keys - COMPREPLY=( $( compgen -W "$( gpg2 --list-keys 2>/dev/null | \ - sed -ne 's@^pub.*/\([^ ]*\).*$@\1@p' \ - -ne 's@^.*\(<\([^>]*\)>\).*$@\2@p' )" -- "$cur" ) ) - return 0 + COMPREPLY=( $( compgen -W "$( $1 --list-keys 2>/dev/null | command sed -ne \ + 's@^pub.*/\([^ ]*\).*$@\1@p' -ne \ + 's@^.*\(<\([^>]*\)>\).*$@\2@p' )" -- "$cur" ) ) + return ;; -r|--recipient) - COMPREPLY=( $( compgen -W "$( gpg2 --list-keys 2>/dev/null | \ - sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" ) ) + COMPREPLY=( $( compgen -W "$( $1 --list-keys 2>/dev/null | \ + command sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" ) ) if [[ -e ~/.gnupg/gpg.conf ]]; then - COMPREPLY+=( $( compgen -W "$( sed -ne \ + COMPREPLY+=( $( compgen -W "$( command sed -ne \ 's@^[ \t]*group[ \t][ \t]*\([^=]*\).*$@\1@p' \ ~/.gnupg/gpg.conf)" -- "$cur" ) ) fi - return 0 + return ;; esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $( compgen -W '$(gpg2 --dump-options)' -- "$cur" ) ) + COMPREPLY=( $( compgen -W '$($1 --dump-options)' -- "$cur" ) ) fi } && complete -F _gpg2 -o default gpg2 -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/gphoto2 b/completions/gphoto2 index 02ddf785..94bf0634 100644 --- a/completions/gphoto2 +++ b/completions/gphoto2 @@ -3,49 +3,52 @@ _gphoto2() { local cur prev words cword split - _init_completion -s || return + _init_completion -s -n : || return case $prev in --debug-logfile) _filedir - return 0 + return ;; --hook-script) _filedir - return 0 + return ;; --filename) _filedir - return 0 + return ;; -u|--upload-file) _filedir - return 0 + return ;; --port) - COMPREPLY=( $(compgen -W "$( gphoto2 --list-ports 2>/dev/null | \ - tail -n +4 | awk '{ print $1 }' )" -- "$cur") ) - return 0 + COMPREPLY=( $(compgen -W "$( $1 --list-ports 2>/dev/null | \ + awk 'NR>3 { print $1 }' )" -- "$cur") ) + __ltrim_colon_completions "$cur" + return ;; --camera) local IFS=$'\n' - COMPREPLY=( $(compgen -W "$( gphoto2 --list-cameras 2>/dev/null | \ - tail -n +3 | awk -F'"' '{ print $2 }' )" -- "$cur") ) - return 0 + COMPREPLY=( $(compgen -W "$( $1 --list-cameras 2>/dev/null | \ + awk -F'"' 'NR>2 { print $2 }' )" -- "$cur") ) + return ;; --get-config|--set-config|--set-config-index|--set-config-value) - COMPREPLY=( $(compgen -W "$( gphoto2 --list-config 2>/dev/null \ + COMPREPLY=( $(compgen -W "$( $1 --list-config 2>/dev/null \ )" -- "$cur") ) - return 0 + return ;; esac + $split && return + if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - return 0 + [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && complete -F _gphoto2 gphoto2 -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/gprof b/completions/gprof index 810255a4..b9692bad 100644 --- a/completions/gprof +++ b/completions/gprof @@ -62,4 +62,4 @@ _gprof() } && complete -F _gprof gprof -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/groupadd b/completions/groupadd index db5ff872..c5a74b7a 100644 --- a/completions/groupadd +++ b/completions/groupadd @@ -10,18 +10,17 @@ _groupadd() case $prev in -g|--gid|-K|--key|-p|--password) - return 0 + return ;; esac - $split && return 0 + $split && return if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace - return 0 fi } && complete -F _groupadd groupadd -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/groupdel b/completions/groupdel index bf6e5c6a..91ba3583 100644 --- a/completions/groupdel +++ b/completions/groupdel @@ -2,4 +2,4 @@ complete -g groupdel -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/groupmems b/completions/groupmems index 9c993eb7..3bb5d820 100644 --- a/completions/groupmems +++ b/completions/groupmems @@ -8,15 +8,15 @@ _groupmems() case $prev in -a|--add|-d|--delete) COMPREPLY=( $( compgen -u -- "$cur" ) ) - return 0 + return ;; -g|--group) COMPREPLY=( $( compgen -g -- "$cur" ) ) - return 0 + return ;; -R|--root) _filedir -d - return 0 + return ;; esac @@ -24,4 +24,4 @@ _groupmems() } && complete -F _groupmems groupmems -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/groupmod b/completions/groupmod index 1a0241a7..51e23b5c 100644 --- a/completions/groupmod +++ b/completions/groupmod @@ -10,20 +10,20 @@ _groupmod() case $prev in -g|--gid|-h|--help|-n|--new-name|-p|--password) - return 0 + return ;; esac - $split && return 0 + $split && return if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace - return 0 + return fi COMPREPLY=( $( compgen -g -- "$cur" ) ) } && complete -F _groupmod groupmod -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/growisofs b/completions/growisofs index c4cb7162..04b29a55 100644 --- a/completions/growisofs +++ b/completions/growisofs @@ -7,19 +7,19 @@ _growisofs() case $prev in -version|-speed) - return 0 + return ;; -Z|-M) compopt -o nospace _dvd_devices - return 0 + return ;; /?(r)dev/*) if [[ $cur == =* ]] ; then # e.g. /dev/dvd=foo.iso, /dev/dvdrw=/dev/zero cur="${cur#=}" _filedir - return 0 + return fi ;; esac @@ -29,11 +29,11 @@ _growisofs() COMPREPLY=( $( compgen -W '-dvd-compat -overburn -speed= -Z -M' \ -- "$cur" ) ) [[ ${COMPREPLY[@]} == *= ]] && compopt -o nospace - return 0 + return fi _filedir } && complete -F _growisofs growisofs -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/grpck b/completions/grpck index 0aff1439..18a53920 100644 --- a/completions/grpck +++ b/completions/grpck @@ -7,11 +7,11 @@ _grpck() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) - return 0 + return fi _filedir } && complete -F _grpck grpck -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/gzip b/completions/gzip index 35e5f231..8093e41e 100644 --- a/completions/gzip +++ b/completions/gzip @@ -7,11 +7,11 @@ _gzip() case $prev in -b|--blocksize|-S|--suffix|-h|--help|-V|--version) - return 0 + return ;; -p|--processes) COMPREPLY=( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) ) - return 0 + return ;; esac @@ -19,22 +19,21 @@ _gzip() COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) {-1..-9}' \ -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace - return 0 + return fi local IFS=$'\n' xspec="*.@(gz|t[ag]z)" + [[ ${1##*/} == pigz ]] && xspec="*.@([gz]z|t[ag]z)" if [[ "$prev" == --* ]]; then - [[ "$prev" == --decompress || \ - "$prev" == --list || \ - "$prev" == --test ]] && xspec="!"$xspec + [[ "$prev" == --@(decompress|list|test) ]] && xspec="!"$xspec [[ "$prev" == --force ]] && xspec= elif [[ "$prev" == -* ]]; then [[ "$prev" == -*[dlt]* ]] && xspec="!"$xspec [[ "$prev" == -*f* ]] && xspec= fi - _expand || return 0 + _expand || return compopt -o filenames COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ @@ -42,4 +41,4 @@ _gzip() } && complete -F _gzip gzip pigz -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/hcitool b/completions/hcitool index b650e205..38d66427 100644 --- a/completions/hcitool +++ b/completions/hcitool @@ -1,6 +1,6 @@ # bash completion for bluez utils -*- shell-script -*- -_bluetooth_adresses() +_bluetooth_addresses() { if [[ -n ${COMP_BLUETOOTH_SCAN:-} ]]; then COMPREPLY+=( $( compgen -W "$( hcitool scan | \ @@ -35,19 +35,19 @@ _hcitool() case $prev in -i) _bluetooth_devices - return 0 + return ;; --role) COMPREPLY=( $( compgen -W 'm s' -- "$cur" ) ) - return 0 + return ;; --pkt-type) _bluetooth_packet_types - return 0 + return ;; esac - $split && return 0 + $split && return local arg _get_first_arg @@ -60,11 +60,12 @@ _hcitool() clock' -- "$cur" ) ) fi else + local args case $arg in name|info|dc|rssi|lq|afh|auth|key|clkoff|lst) _count_args if [[ $args -eq 2 ]]; then - _bluetooth_adresses + _bluetooth_addresses fi ;; cc) @@ -73,14 +74,14 @@ _hcitool() else _count_args if [[ $args -eq 2 ]]; then - _bluetooth_adresses + _bluetooth_addresses fi fi ;; sr) _count_args if [[ $args -eq 2 ]]; then - _bluetooth_adresses + _bluetooth_addresses else COMPREPLY=( $( compgen -W 'master slave' -- "$cur" ) ) fi @@ -88,7 +89,7 @@ _hcitool() cpt) _count_args if [[ $args -eq 2 ]]; then - _bluetooth_adresses + _bluetooth_addresses else _bluetooth_packet_types fi @@ -96,7 +97,7 @@ _hcitool() tpl|enc|clock) _count_args if [[ $args -eq 2 ]]; then - _bluetooth_adresses + _bluetooth_addresses else COMPREPLY=( $( compgen -W '0 1' -- "$cur" ) ) fi @@ -113,12 +114,12 @@ _sdptool() case $prev in --bdaddr) - _bluetooth_adresses - return 0 + _bluetooth_addresses + return ;; esac - $split && return 0 + $split && return local arg _get_first_arg @@ -143,7 +144,7 @@ _sdptool() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '--tree --raw --xml' -- "$cur" ) ) else - _bluetooth_adresses + _bluetooth_addresses fi ;; add) @@ -172,17 +173,17 @@ _l2ping() case $prev in -i) _bluetooth_devices - return 0 + return ;; -s|-c|-t|-d) - return 0 + return ;; esac if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) ) else - _bluetooth_adresses + _bluetooth_addresses fi } && complete -F _l2ping l2ping @@ -195,12 +196,12 @@ _rfcomm() case $prev in -f|--config) _filedir - return 0 + return ;; -i) _bluetooth_devices - _bluetooth_adresses - return 0 + _bluetooth_addresses + return ;; esac @@ -214,6 +215,7 @@ _rfcomm() release' -- "$cur" ) ) fi else + local args _count_args if [[ $args -eq 2 ]]; then _bluetooth_devices @@ -221,7 +223,7 @@ _rfcomm() case $arg in connect|bind) if [[ $args -eq 3 ]]; then - _bluetooth_adresses + _bluetooth_addresses fi ;; esac @@ -238,8 +240,8 @@ _ciptool() case $prev in -i) _bluetooth_devices - _bluetooth_adresses - return 0 + _bluetooth_addresses + return ;; esac @@ -253,11 +255,12 @@ _ciptool() -- "$cur" ) ) fi else + local args case $arg in connect|release|loopback) _count_args if [[ $args -eq 2 ]]; then - _bluetooth_adresses + _bluetooth_addresses fi ;; esac @@ -273,7 +276,7 @@ _dfutool() case $prev in -d|--device) _bluetooth_devices - return 0 + return ;; esac @@ -313,11 +316,12 @@ _hciconfig() version revision lm' -- "$cur" ) ) fi else + local args case $arg in putkey|delkey) _count_args if [[ $args -eq 2 ]]; then - _bluetooth_adresses + _bluetooth_addresses fi ;; lm) @@ -366,11 +370,11 @@ _hciattach() COMPREPLY=( $( compgen -W 'flow noflow' -- "$cur" ) ) ;; 5) - _bluetooth_adresses + _bluetooth_addresses ;; esac fi } && complete -F _hciattach hciattach -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/hddtemp b/completions/hddtemp index 75641045..123b74a1 100644 --- a/completions/hddtemp +++ b/completions/hddtemp @@ -35,4 +35,4 @@ _hddtemp() } && complete -F _hddtemp hddtemp -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/hexdump b/completions/hexdump deleted file mode 100644 index c566f9d6..00000000 --- a/completions/hexdump +++ /dev/null @@ -1,29 +0,0 @@ -# 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 d840166a..9221c4d0 100644 --- a/completions/hid2hci +++ b/completions/hid2hci @@ -12,4 +12,4 @@ _hid2hci() } && complete -F _hid2hci hid2hci -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/hostname b/completions/hostname new file mode 100644 index 00000000..48f4222f --- /dev/null +++ b/completions/hostname @@ -0,0 +1,23 @@ +# hostname(1) completion -*- shell-script -*- + +_hostname() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -h|--help|-V|--version) + return + ;; + -F|--file) + _filedir + return + ;; + esac + + [[ $cur == -* ]] && \ + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) +} && +complete -F _hostname hostname + +# ex: filetype=sh diff --git a/completions/hping2 b/completions/hping2 index 45c2c4c6..9d454622 100644 --- a/completions/hping2 +++ b/completions/hping2 @@ -8,19 +8,19 @@ _hping2() case $prev in -I|--interface) _available_interfaces - return 0 + return ;; -a|--spoof) _known_hosts_real "$cur" - return 0 + return ;; -o|--tos) COMPREPLY=( $( compgen -W '02 04 08 10' ) ) - return 0 + return ;; -E|--file) _filedir - return 0 + return ;; esac @@ -32,4 +32,4 @@ _hping2() } && complete -F _hping2 hping hping2 hping3 -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/htop b/completions/htop index 7735f9b5..13c06b15 100644 --- a/completions/htop +++ b/completions/htop @@ -27,6 +27,7 @@ _htop() [[ $COMPREPLY == *= ]] && compopt -o nospace return fi -} && complete -F _htop htop +} && +complete -F _htop htop -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/htpasswd b/completions/htpasswd index b0990fe1..bf3acb22 100644 --- a/completions/htpasswd +++ b/completions/htpasswd @@ -30,4 +30,4 @@ _htpasswd() } && complete -F _htpasswd htpasswd -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/hwclock b/completions/hwclock deleted file mode 100644 index 9f8f9b15..00000000 --- a/completions/hwclock +++ /dev/null @@ -1,23 +0,0 @@ -# hwclock(8) completion -*- shell-script -*- - -_hwclock() -{ - local cur prev words cword - _init_completion || return - - case $prev in - -h|--help|-V|--version|--date|--epoch) - return - ;; - -f|--rtc|--adjfile) - _filedir - return - ;; - esac - - COMPREPLY=( - $( PATH="$PATH:/sbin" compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) -} && -complete -F _hwclock hwclock - -# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/iconv b/completions/iconv index b33cc704..50edb4c5 100644 --- a/completions/iconv +++ b/completions/iconv @@ -8,27 +8,26 @@ _iconv() case $prev in -'?'|--help|--usage|-V|--version|--unicode-subst|--byte-subst|\ --widechar-subst) - return 0 + return ;; -f|--from-code|-t|--to-code) COMPREPLY=( $( compgen -W '$( iconv -l | \ - sed -e "s@/*\$@@" -e "s/[,()]//g" )' -- "$cur" ) ) - return 0 + command sed -e "s@/*\$@@" -e "s/[,()]//g" )' -- "$cur" ) ) + return ;; -o|--output) _filedir - return 0 + return ;; esac - $split && return 0 + $split && return - if [[ "$cur" = -* ]]; then + if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace - return 0 fi } && complete -F _iconv -o default iconv -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/id b/completions/id index c985c9eb..137a5f7e 100644 --- a/completions/id +++ b/completions/id @@ -15,4 +15,4 @@ _id() } && complete -F _id id -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/idn b/completions/idn index 14e4cc1a..12f4bdd1 100644 --- a/completions/idn +++ b/completions/idn @@ -23,4 +23,4 @@ _idn() } && complete -F _idn idn -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/iftop b/completions/iftop index 8c606172..831e327b 100644 --- a/completions/iftop +++ b/completions/iftop @@ -7,15 +7,15 @@ _iftop() case $prev in -h|-f|-F|-m) - return 0 + return ;; -i) _available_interfaces -a - return 0 + return ;; -c) _filedir - return 0 + return ;; esac @@ -23,4 +23,4 @@ _iftop() } && complete -F _iftop iftop -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/ifup b/completions/ifup index fcd34994..42cb8f80 100644 --- a/completions/ifup +++ b/completions/ifup @@ -12,8 +12,7 @@ _ifupdown() COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") ) fi - return 0 } && complete -F _ifupdown ifup ifdown ifstatus -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/info b/completions/info index 36550449..f71cbf5b 100644 --- a/completions/info +++ b/completions/info @@ -5,12 +5,12 @@ _info() local cur prev words cword split _init_completion -s || return - _expand || return 0 + _expand || return # default completion if parameter looks like a path if [[ "$cur" == @(*/|[.~])* ]]; then _filedir - return 0 + return fi case $prev in @@ -62,14 +62,13 @@ _info() COMPREPLY=( ${COMPREPLY[@]##*/?(:)} ) # weed out info dir file for (( i=0 ; i < ${#COMPREPLY[@]} ; ++i )); do - [[ ${COMPREPLY[$i]} == dir ]] && unset COMPREPLY[$i] + [[ ${COMPREPLY[$i]} == dir ]] && unset "COMPREPLY[$i]" done # strip suffix from info pages COMPREPLY=( ${COMPREPLY[@]%.@(gz|bz2|xz|lzma)} ) COMPREPLY=( $( compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}" ) ) - return 0 } && complete -F _info info pinfo -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/inject b/completions/inject index da2d9a9e..20ea9b7f 100644 --- a/completions/inject +++ b/completions/inject @@ -8,11 +8,11 @@ _inject() case $prev in -l|--listname) _xfunc list_lists _mailman_lists - return 0 + return ;; esac - $split && return 0 + $split && return if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '--listname --queue --help' -- "$cur" ) ) @@ -23,4 +23,4 @@ _inject() } && complete -F _inject inject -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/insmod b/completions/insmod index 545f8bc5..ec81c93e 100644 --- a/completions/insmod +++ b/completions/insmod @@ -15,4 +15,4 @@ _insmod() } && complete -F _insmod insmod insmod.static -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/installpkg b/completions/installpkg index cdaf816c..f002f775 100644 --- a/completions/installpkg +++ b/completions/installpkg @@ -8,25 +8,26 @@ _installpkg() case "$prev" in --root) _filedir -d - return 0 + return ;; --priority) COMPREPLY=( $( compgen -W 'ADD REC OPT SKP' -- "$cur" ) ) - return 0 + return ;; --tagfile) _filedir - return 0 + return ;; esac if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '--warn --md5sum --root --infobox --terse --menu --ask --priority --tagfile' -- "$cur" ) ) - return 0 + return fi - _filedir "t[bglx]z" -} && complete -F _installpkg installpkg + _filedir 't[bglx]z' +} && +complete -F _installpkg installpkg -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/interdiff b/completions/interdiff index 8b07572f..cf71002e 100644 --- a/completions/interdiff +++ b/completions/interdiff @@ -30,4 +30,4 @@ _interdiff() } && complete -F _interdiff interdiff -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/invoke-rc.d b/completions/invoke-rc.d index d4e0d245..777f6ace 100644 --- a/completions/invoke-rc.d +++ b/completions/invoke-rc.d @@ -20,20 +20,19 @@ _invoke_rc_d() if [[ ($cword -eq 1) || ("$prev" == --* ) ]]; then valid_options=( $( \ tr " " "\n" <<<"${words[@]} ${options[@]}" \ - | sed -ne "/$( sed "s/ /\\\\|/g" <<<"${options[@]}" )/p" \ + | command sed -ne "/$( command sed "s/ /\\\\|/g" <<<"${options[@]}" )/p" \ | sort | uniq -u \ ) ) COMPREPLY=( $( compgen -W '${valid_options[@]} ${services[@]}' -- "$cur" ) ) elif [[ -x $sysvdir/$prev ]]; then - COMPREPLY=( $( compgen -W '`sed -e "y/|/ /" \ + COMPREPLY=( $( compgen -W '`command sed -e "y/|/ /" \ -ne "s/^.*Usage:[ ]*[^ ]*[ ]*{*\([^}\"]*\).*$/\1/p" \ $sysvdir/$prev`' -- "$cur" ) ) else COMPREPLY=() fi - return 0 } && complete -F _invoke_rc_d invoke-rc.d -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/ionice b/completions/ionice deleted file mode 100644 index 6d9bdd46..00000000 --- a/completions/ionice +++ /dev/null @@ -1,57 +0,0 @@ -# ionice(1) completion -*- shell-script -*- - -_ionice() -{ - local cur prev words cword - _init_completion || return - - local offset=0 i - for (( i=1; i <= cword; i++ )); do - case ${words[i]} in - -h) - return - ;; - -p) - offset=0 - break - ;; - -c|-n) - (( i++ )) - continue - ;; - -*) - continue - ;; - esac - offset=$i - break - done - - if [[ $offset -gt 0 ]]; then - _command_offset $offset - return - fi - - case $prev in - -c) - COMPREPLY=( $( compgen -W '{0..3}' -- "$cur" ) ) - return - ;; - -n) - COMPREPLY=( $( compgen -W '{0..7}' -- "$cur" ) ) - return - ;; - -p) - _pids - return - ;; - esac - - if [[ $cur == -* ]]; then - COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) ) - return - fi -} && -complete -F _ionice ionice - -# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/ip b/completions/ip index b073c36f..00dd839d 100644 --- a/completions/ip +++ b/completions/ip @@ -14,25 +14,25 @@ _ip() case $prev in -V|-Version|-rc|-rcvbuf) - return 0 + return ;; -f|-family) COMPREPLY=( $( compgen -W 'inet inet6 ipx dnet link' -- "$cur" ) ) - return 0 + return ;; -b|-batch) _filedir - return 0 + return ;; -force) COMPREPLY=( $( compgen -W '-batch' -- "$cur" ) ) - return 0 + return ;; esac local subcword cmd subcmd for (( subcword=1; subcword < ${#words[@]}-1; subcword++ )); do - [[ ${words[subcword]} == -b?(atch) ]] && return 0 + [[ ${words[subcword]} == -b?(atch) ]] && return [[ -n $cmd ]] && subcmd=${words[subcword]} && break [[ ${words[subcword]} != -* && \ ${words[subcword-1]} != -@(f?(amily)|rc?(vbuf)) ]] && \ @@ -46,21 +46,23 @@ _ip() -oneline -timestamp -batch -rcvbuf" [[ $cword -eq 1 ]] && c+=" -force" COMPREPLY=( $( compgen -W "$c" -- "$cur" ) ) - return 0 + return ;; *) - COMPREPLY=( $( compgen -W "help $( ip help 2>&1 | \ - sed -e '/OBJECT := /,/}/!d' \ - -e 's/.*{//' -e 's/}.*//' -e 's/|//g' )" -- "$cur" ) ) - return 0 + COMPREPLY=( $( compgen -W "help $( ip help 2>&1 | command sed -e \ + '/OBJECT := /,/}/!d' -e \ + 's/.*{//' -e \ + 's/}.*//' -e \ + 's/|//g' )" -- "$cur" ) ) + return ;; esac fi - [[ $subcmd == help ]] && return 0 + [[ $subcmd == help ]] && return case $cmd in - link) + l|link) case $subcmd in add) # TODO @@ -120,13 +122,25 @@ _ip() esac ;; - addr) + a|addr|address) case $subcmd in add|change|replace) - # TODO + if [[ $prev == dev ]]; then + _available_interfaces + elif [[ $prev == scope ]]; then + _iproute2_etc rt_scopes + else + : # TODO + fi ;; del) - # TODO + if [[ $prev == dev ]]; then + _available_interfaces + elif [[ $prev == scope ]]; then + _iproute2_etc rt_scopes + else + : # TODO + fi ;; show|flush) if [[ $cword -eq $subcword+1 ]]; then @@ -151,7 +165,11 @@ _ip() addrlabel) case $subcmd in list|add|del|flush) - # TODO + if [[ $prev == dev ]]; then + _available_interfaces + else + : # TODO + fi ;; *) [[ $cword -eq $subcword ]] && \ @@ -164,7 +182,11 @@ _ip() route) case $subcmd in list|flush) - # TODO + if [[ $prev == proto ]]; then + _iproute2_etc rt_protos + else + : # TODO + fi ;; get) # TODO @@ -275,7 +297,7 @@ _ip() esac ;; - monitor) + monitor) case $subcmd in all) ;; *) @@ -285,7 +307,7 @@ _ip() esac ;; - xfrm) + xfrm) case $subcmd in state|policy|monitor) # TODO @@ -301,4 +323,4 @@ _ip() } && complete -F _ip ip -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/iperf b/completions/iperf index 721825e2..4652879c 100644 --- a/completions/iperf +++ b/completions/iperf @@ -45,10 +45,10 @@ _iperf() for i in ${words[@]}; do case $i in -s|--server) - filter='sed -e /^Client.specific/,/^$/d' + filter='command sed -e /^Client.specific/,/^$/d' ;; -c|--client) - filter='sed -e /^Server.specific/,/^$/d' + filter='command sed -e /^Server.specific/,/^$/d' ;; esac done @@ -60,4 +60,4 @@ _iperf() } && complete -F _iperf iperf -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/ipmitool b/completions/ipmitool index 281d9eac..8e2637c7 100644 --- a/completions/ipmitool +++ b/completions/ipmitool @@ -3,7 +3,7 @@ _ipmitool_singleline_help() { COMPREPLY=( $( compgen -W "$( $1 $2 2>&1 | \ - sed -ne 's/[,\r]//g' -e 's/^.*[Cc]ommands://p' )" -- "$cur" ) ) + command sed -ne 's/[,\r]//g' -e 's/^.*[Cc]ommands://p' )" -- "$cur" ) ) } _ipmitool() @@ -13,53 +13,53 @@ _ipmitool() case $prev in -h|-V|-p|-U|-e|-k|-y|-P|-m|-b|-t|-B|-T|-l) - return 0 + return ;; -d) COMPREPLY=( $( compgen -W "$( \ command ls -d /dev/ipmi* /dev/ipmi/* /dev/ipmidev/* \ - 2>/dev/null | sed -ne 's/^[^0-9]*\([0-9]\{1,\}\)/\1/p' )" \ + 2>/dev/null | command sed -ne 's/^[^0-9]*\([0-9]\{1,\}\)/\1/p' )" \ -- "$cur" ) ) - return 0 + return ;; -I) COMPREPLY=( $( compgen -W "$( $1 -h 2>&1 | \ - sed -e '/^Interfaces:/,/^[[:space:]]*$/!d' \ + command sed -e '/^Interfaces:/,/^[[:space:]]*$/!d' \ -ne 's/^[[:space:]]\{1,\}\([^[:space:]]\{1,\}\).*/\1/p' )" \ -- "$cur" ) ) - return 0 + return ;; -H) _known_hosts_real "$cur" - return 0 + return ;; -f|-S|-O) _filedir - return 0 + return ;; -C) COMPREPLY=( $( compgen -W '{0..14}' -- "$cur" ) ) - return 0 + return ;; -L) COMPREPLY=( $( compgen -W 'CALLBACK USER OPERATOR ADMINISTRATOR' \ -- "$cur" ) ) - return 0 + return ;; -A) COMPREPLY=( $( compgen -W 'NONE PASSWORD MD2 MD5 OEM' -- "$cur" ) ) - return 0 + return ;; -o) COMPREPLY=( $( compgen -W "$( $1 -o list 2>&1 | \ awk '/^[ \t]+/ { print $1 }' ) list" -- "$cur" ) ) - return 0 + return ;; esac if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h)' -- "$cur" ) ) - return 0 + return fi # Find out command and subcommand @@ -77,7 +77,7 @@ _ipmitool() if [[ -z $cmd ]]; then COMPREPLY=( $( compgen -W '${cmds[@]}' -- "$cur" ) ) - return 0 + return fi # Command/subcommand completions @@ -197,4 +197,4 @@ _ipmitool() } && complete -F _ipmitool ipmitool -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/ipsec b/completions/ipsec index b1161b0a..357d5055 100644 --- a/completions/ipsec +++ b/completions/ipsec @@ -7,7 +7,7 @@ _ipsec_connections() { local keyword name while read -r keyword name; do - if [[ $keyword = [#]* ]]; then continue; fi + if [[ $keyword == [#]* ]]; then continue; fi [[ $keyword == conn && $name != '%default' ]] && COMPREPLY+=( "$name" ) done COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) ) @@ -22,7 +22,7 @@ _ipsec_freeswan() COMPREPLY=( $( compgen -W 'auto barf eroute klipsdebug look manual pluto ranbits rsasigkey setup showdefaults showhostkey spi spigrp tncfg whack' -- "$cur" ) ) - return 0 + return fi case ${words[1]} in @@ -45,8 +45,6 @@ _ipsec_freeswan() *) ;; esac - - return 0 } _ipsec_strongswan() @@ -64,7 +62,7 @@ _ipsec_strongswan() scencrypt scepclient secrets start starter status statusall stop stroke unroute uci up update version whack --confdir --copyright --directory --help --version --versioncode' -- "$cur" ) ) - return 0 + return fi case ${words[1]} in @@ -91,8 +89,6 @@ _ipsec_strongswan() *) ;; esac - - return 0 } case "$( ipsec --version 2>/dev/null )" in @@ -104,4 +100,4 @@ case "$( ipsec --version 2>/dev/null )" in ;; esac -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/iptables b/completions/iptables index 0d54afbd..0ecb1ebd 100644 --- a/completions/iptables +++ b/completions/iptables @@ -18,7 +18,7 @@ _iptables() case $prev in -*[AIDRPFXLZ]) COMPREPLY=( $( compgen -W '`iptables $table -nL | \ - sed -ne "s/^Chain \([^ ]\{1,\}\).*$/\1/p"`' -- "$cur" ) ) + command sed -ne "s/^Chain \([^ ]\{1,\}\).*$/\1/p"`' -- "$cur" ) ) ;; -*t) COMPREPLY=( $( compgen -W 'nat filter mangle' -- "$cur" ) ) @@ -26,17 +26,17 @@ _iptables() -j) if [[ "$table" == "-t filter" || -z "$table" ]]; then COMPREPLY=( $( compgen -W 'ACCEPT DROP LOG ULOG REJECT - `iptables $table -nL | sed -ne "$chain" \ + `iptables $table -nL | command 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 | \ - sed -ne "$chain" -e "s/OUTPUT|PREROUTING|POSTROUTING//"`' \ + command 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" \ + `iptables $table -nL | command sed -ne "$chain" \ -e "s/INPUT|OUTPUT|FORWARD|PREROUTING|POSTROUTING//"`' -- \ "$cur" ) ) fi @@ -57,4 +57,4 @@ _iptables() } && complete -F _iptables iptables -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/ipv6calc b/completions/ipv6calc index 5db7271f..0dacff94 100644 --- a/completions/ipv6calc +++ b/completions/ipv6calc @@ -7,25 +7,25 @@ _ipv6calc() case "$prev" in -d|--debug) - return 0 + return ;; -I|--in|-O|--out|-A|--action) # With ipv6calc < 0.73.0, -m does nothing here, so use sed instead. - COMPREPLY=( $( compgen -W "$( ipv6calc "$prev" -h 2>&1 | \ - sed -ne 's/^[[:space:]]\{1,\}\([^[:space:]:]\{1,\}\)[[:space:]]*:.*/\1/p' )" \ + COMPREPLY=( $( compgen -W "$( $1 "$prev" -h 2>&1 | \ + command sed -ne 's/^[[:space:]]\{1,\}\([^[:space:]:]\{1,\}\)[[:space:]]*:.*/\1/p' )" \ -- "$cur" ) ) - return 0 + return ;; --db-geoip|--db-ip2location-ipv4|--db-ip2location-ipv6) _filedir - return 0 + return ;; --printstart|--printend) - return 0 + return ;; esac - $split && return 0 + $split && return if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '--help --debug --quiet --in --out --action @@ -35,11 +35,9 @@ _ipv6calc() --masksuffix --printstart --printend --printcompressed --printuncompressed --printfulluncompressed --printmirrored' \ -- "$cur" ) ) - return 0 fi - return 0 } && complete -F _ipv6calc ipv6calc -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/iscsiadm b/completions/iscsiadm index 326dc208..e5218d75 100644 --- a/completions/iscsiadm +++ b/completions/iscsiadm @@ -9,23 +9,23 @@ _iscsiadm() -m|--mode) COMPREPLY=( $( compgen -W 'discovery node session iface fw host' \ -- "$cur" ) ) - return 0 + return ;; -o|--op) COMPREPLY=( $( compgen -W 'new delete update show' -- "$cur" ) ) - return 0 + return ;; -t|--type) COMPREPLY=( $( compgen -W 'sendtargets st slp isns fw' -- "$cur" ) ) - return 0 + return ;; -L|-U|--loginall|--logoutall) COMPREPLY=( $( compgen -W 'all manual automatic' -- "$cur" ) ) - return 0 + return ;; esac - $split && return 0 + $split && return local options if [[ $cword -gt 1 ]] ; then @@ -63,4 +63,4 @@ _iscsiadm() } && complete -F _iscsiadm iscsiadm -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/isql b/completions/isql index 43cd6dd3..862a9304 100644 --- a/completions/isql +++ b/completions/isql @@ -7,8 +7,8 @@ _isql() _init_completion || return [[ -f $ODBCINI ]] \ - && COMPREPLY=( $( command grep \\["$cur" "$ODBCINI" | tr -d \\[\\] ) ) + && COMPREPLY=( $( command grep "\[$cur" "$ODBCINI" | tr -d \[\] ) ) } && complete -F _isql isql -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/iwconfig b/completions/iwconfig index 36213d2c..114081dd 100644 --- a/completions/iwconfig +++ b/completions/iwconfig @@ -9,7 +9,7 @@ _iwconfig() mode) COMPREPLY=( $( compgen -W 'managed ad-hoc master repeater secondary monitor' -- "$cur" ) ) - return 0 + return ;; essid) COMPREPLY=( $( compgen -W 'on off any' -- "$cur" ) ) @@ -18,22 +18,22 @@ _iwconfig() "$( iwlist ${words[1]} scan | \ awk -F'\"' '/ESSID/ {print $2}' )" -- "$cur" ) ) fi - return 0 + return ;; nwid) COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) - return 0 + return ;; channel) COMPREPLY=( $( compgen -W "$( iwlist ${words[1]} channel | \ awk '/^[ \t]*Channel/ {print $2}' )" -- "$cur" ) ) - return 0 + return ;; freq) COMPREPLY=( $( compgen -W "$( iwlist ${words[1]} channel | \ awk '/^[ \t]*Channel/ {print $4"G"}')" -- "$cur" ) ) - return 0 + return ;; ap) COMPREPLY=( $( compgen -W 'on off any' -- "$cur" ) ) @@ -42,34 +42,34 @@ _iwconfig() "$( iwlist ${words[1]} scan | \ awk -F ': ' '/Address/ {print $2}' )" -- "$cur" ) ) fi - return 0 + return ;; rate) COMPREPLY=( $( compgen -W 'auto fixed' -- "$cur" ) ) COMPREPLY+=( $( compgen -W \ "$( iwlist ${words[1]} rate | \ awk '/^[ \t]*[0-9]/ {print $1"M"}' )" -- "$cur" ) ) - return 0 + return ;; rts|frag) COMPREPLY=( $( compgen -W 'auto fixed off' -- "$cur" ) ) - return 0 + return ;; key|enc) COMPREPLY=( $( compgen -W 'off on open restricted' -- "$cur" ) ) - return 0 + return ;; power) COMPREPLY=( $( compgen -W 'period timeout off on' -- "$cur" ) ) - return 0 + return ;; txpower) COMPREPLY=( $( compgen -W 'off on auto' -- "$cur" ) ) - return 0 + return ;; retry) COMPREPLY=( $( compgen -W 'limit lifetime' -- "$cur" ) ) - return 0 + return ;; esac @@ -87,4 +87,4 @@ _iwconfig() } && complete -F _iwconfig iwconfig -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/iwlist b/completions/iwlist index 78c15b71..b27dbe8b 100644 --- a/completions/iwlist +++ b/completions/iwlist @@ -19,4 +19,4 @@ _iwlist() } && complete -F _iwlist iwlist -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/iwpriv b/completions/iwpriv index 05952c5e..c7f8209e 100644 --- a/completions/iwpriv +++ b/completions/iwpriv @@ -8,11 +8,11 @@ _iwpriv() case $prev in roam) COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) ) - return 0 + return ;; port) COMPREPLY=( $( compgen -W 'ad-hoc managed' -- "$cur" ) ) - return 0 + return ;; esac @@ -28,4 +28,4 @@ _iwpriv() } && complete -F _iwpriv iwpriv -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/iwspy b/completions/iwspy index b59b0693..1cf3a283 100644 --- a/completions/iwspy +++ b/completions/iwspy @@ -17,4 +17,4 @@ _iwspy() } && complete -F _iwspy iwspy -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/jar b/completions/jar index 8af86a17..b7de930f 100644 --- a/completions/jar +++ b/completions/jar @@ -7,7 +7,7 @@ _jar() if [[ $cword -eq 1 ]]; then COMPREPLY=( $( compgen -W 'c t x u' -- "$cur" ) ) - return 0 + return fi case ${words[1]} in @@ -24,4 +24,4 @@ _jar() } && complete -F _jar jar -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/jarsigner b/completions/jarsigner index c1c72af7..2441bd1a 100644 --- a/completions/jarsigner +++ b/completions/jarsigner @@ -9,23 +9,24 @@ _jarsigner() -keystore) COMPREPLY=( $( compgen -W 'NONE' -- "$cur" ) ) _filedir '@(jks|ks|p12|pfx)' - return 0 + return ;; - -storepass|-keypass|-sigfile|-digestalg|-sigalg|-tsacert|-altsigner|\ - -altsignerpath|-providerName|-providerClass|-providerArg) - return 0 + -storepass|-keypass|-sigfile|-digestalg|-sigalg|-tsacert|-tsapolicyid|\ + -tsadigestalg|-altsigner|-altsignerpath|-providerName|-providerClass|\ + -providerArg) + return + ;; + -certchain|-sigfile|-tsa) + _filedir + return ;; -storetype) COMPREPLY=( $( compgen -W 'JKS PKCS11 PKCS12' -- "$cur" ) ) - return 0 + return ;; -signedjar) _filedir jar - return 0 - ;; - -tsa) - _filedir - return 0 + return ;; esac @@ -53,4 +54,4 @@ _jarsigner() } && complete -F _jarsigner jarsigner -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/java b/completions/java index c302d1e5..7d1cf1fe 100644 --- a/completions/java +++ b/completions/java @@ -71,9 +71,9 @@ _java_classes() elif [[ -d $i ]]; then COMPREPLY+=( - $( compgen -d -- "$i/$cur" | sed -e "s|^$i/\(.*\)|\1.|" ) + $( compgen -d -- "$i/$cur" | command sed -e "s|^$i/\(.*\)|\1.|" ) $( compgen -f -X '!*.class' -- "$i/$cur" | \ - sed -e '/\$/d' -e "s|^$i/||" ) + command sed -e '/\$/d' -e "s|^$i/||" ) ) [[ $COMPREPLY == *.class ]] || compopt -o nospace @@ -103,7 +103,7 @@ _java_packages() for i in ${sourcepath//:/ }; do if [[ -d $i ]]; then COMPREPLY+=( $( command ls -F -d $i/$cur* 2>/dev/null | \ - sed -e 's|^'$i'/||' ) ) + command sed -e 's|^'$i'/||' ) ) fi done # keep only packages @@ -134,7 +134,7 @@ _java() *) # once we've seen a class, just do filename completion _filedir - return 0 + return ;; esac done @@ -143,70 +143,70 @@ _java() # standard option completions -verbose:*) COMPREPLY=( $( compgen -W 'class gc jni' -- "${cur#*:}" ) ) - return 0 + return ;; -javaagent:*) cur=${cur#*:} _filedir '@(jar|zip)' - return 0 + return ;; -agentpath:*) cur=${cur#*:} _filedir so - return 0 + return ;; # various non-standard option completions -splash:*) cur=${cur#*:} _filedir '@(gif|jp?(e)g|png)' - return 0 + return ;; -Xbootclasspath*:*) _java_path - return 0 + return ;; -Xcheck:*) COMPREPLY=( $( compgen -W 'jni' -- "${cur#*:}" ) ) - return 0 + return ;; -Xgc:*) COMPREPLY=( $( compgen -W 'singlecon gencon singlepar genpar' \ -- "${cur#*:}" ) ) - return 0 + return ;; -Xgcprio:*) COMPREPLY=( $( compgen -W 'throughput pausetime deterministic' \ -- "${cur#*:}" ) ) - return 0 + return ;; -Xloggc:*|-Xverboselog:*) cur=${cur#*:} _filedir - return 0 + return ;; -Xshare:*) COMPREPLY=( $( compgen -W 'auto off on' -- "${cur#*:}" ) ) - return 0 + return ;; -Xverbose:*) COMPREPLY=( $( compgen -W 'memory load jni cpuinfo codegen opt gcpause gcreport' -- "${cur#*:}" ) ) - return 0 + return ;; -Xverify:*) COMPREPLY=( $( compgen -W 'all none remote' -- "${cur#*:}" ) ) - return 0 + return ;; # the rest that we have no completions for -D*|-*:*) - return 0 + return ;; esac case $prev in -cp|-classpath) _java_path - return 0 + return ;; esac @@ -238,19 +238,29 @@ _javadoc() case $prev in -overview|-helpfile) _filedir '?(x)htm?(l)' - return 0 + return + ;; + -doclet|-exclude|-subpackages|-source|-locale|-encoding|-windowtitle|\ + -doctitle|-header|-footer|-top|-bottom|-group|-noqualifier|-tag|\ + -charset|-sourcetab|-docencoding) + return ;; -stylesheetfile) _filedir css - return 0 + return ;; -d|-link|-linkoffline) _filedir -d - return 0 + return ;; - -classpath|-bootclasspath|-docletpath|-sourcepath|-extdirs) + -classpath|-cp|-bootclasspath|-docletpath|-sourcepath|-extdirs|\ + -excludedocfilessubdir) _java_path - return 0 + return + ;; + -helpfile) + _filedir + return ;; esac @@ -279,11 +289,11 @@ _javac() case $prev in -d) _filedir -d - return 0 + return ;; - -classpath|-bootclasspath|-sourcepath|-extdirs) + -cp|-classpath|-bootclasspath|-sourcepath|-extdirs) _java_path - return 0 + return ;; esac @@ -294,7 +304,7 @@ _javac() # For some reason there may be -g:none AND -g:{lines,source,vars}; # convert the none case to the curly brace format so it parses like # the others. - local opts=$( "$1" $helpopt 2>&1 | sed -e 's/-g:none/-g:{none}/' -ne \ + local opts=$( "$1" $helpopt 2>&1 | command sed -e 's/-g:none/-g:{none}/' -ne \ "s/^[[:space:]]*${cur%%:*}:{\([^}]\{1,\}\)}.*/\1/p" ) COMPREPLY=( $( compgen -W "${opts//,/ }" -- "${cur#*:}" ) ) return @@ -315,4 +325,4 @@ _javac() } && complete -F _javac javac -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/javaws b/completions/javaws index b9afefd7..7d6e22c8 100644 --- a/completions/javaws +++ b/completions/javaws @@ -7,28 +7,28 @@ _javaws() case $prev in -help|-license|-about|-viewer|-arg|-param|-property|-update|-umask) - return 0 + return ;; -basedir|-codebase) _filedir -d - return 0 + return ;; -uninstall|-import) _filedir jnlp - return 0 + return ;; esac if [[ $cur == *= ]]; then - return 0 + return elif [[ $cur == -* ]]; then COMPREPLY=( $( compgen -W "$( _parse_help "$1" -help ) " -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace - return 0 + return fi _filedir jnlp } && complete -F _javaws javaws -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/jpegoptim b/completions/jpegoptim new file mode 100644 index 00000000..754f16a2 --- /dev/null +++ b/completions/jpegoptim @@ -0,0 +1,38 @@ +# jpegoptim(1) completion -*- shell-script -*- + +_jpegoptim() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + -h|--help|-V|--version) + return + ;; + -d|--dest) + _filedir -d + return + ;; + -m|--max|-T|--threshold) + COMPREPLY=( $( compgen -W '{0..100}' -- "$cur" ) ) + return + ;; + -S|--size) + COMPREPLY=( $( compgen -W '{1..99}%' -- "$cur" ) ) + return + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + fi + + _filedir 'jp?(e)g' +} && +complete -F _jpegoptim jpegoptim + +# ex: filetype=sh diff --git a/completions/jps b/completions/jps index 774ad6ce..42f8d1a5 100644 --- a/completions/jps +++ b/completions/jps @@ -22,4 +22,4 @@ _jps() } && complete -F _jps jps -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/jshint b/completions/jshint new file mode 100644 index 00000000..ea9bbeb5 --- /dev/null +++ b/completions/jshint @@ -0,0 +1,38 @@ +# bash completion for jshint -*- shell-script -*- + +_jshint() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + -v|--version|-h|--help|--exclude|--filename|-e|--extra-ext) + return + ;; + -c|--config) + _filedir + return + ;; + --reporter) + COMPREPLY=( $( compgen -W "jslint checkstyle unix" -- "$cur" ) ) + return + ;; + --extract) + COMPREPLY=( $( compgen -W "auto always never" -- "$cur" ) ) + return + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + return + fi + + _filedir js +} && +complete -F _jshint jshint + +# ex: filetype=sh diff --git a/completions/k3b b/completions/k3b index 9c03642f..2cbcbb1b 100644 --- a/completions/k3b +++ b/completions/k3b @@ -7,32 +7,32 @@ _k3b() case $prev in --help*|--author|-v|--version|--license|--lang) - return 0 + return ;; --datacd|--audiocd|--videocd|--mixedcd|--emovixcd|--videodvd) _filedir - return 0 + return ;; --copydvd|--formatdvd|--videodvdrip) _dvd_devices - return 0 + return ;; --copycd|--erasecd|--cddarip|--videocdrip) _cd_devices _dvd_devices - return 0 + return ;; --cdimage|--image) - _filedir @(cue|iso|toc) - return 0 + _filedir '@(cue|iso|toc)' + return ;; --dvdimage) _filedir iso - return 0 + return ;; --ao) COMPREPLY=( $( compgen -W 'alsa arts' -- "$cur" ) ) - return 0 + return ;; esac @@ -45,4 +45,4 @@ _k3b() } && complete -F _k3b k3b -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/kcov b/completions/kcov index 86d2d10c..7e9aa1e0 100644 --- a/completions/kcov +++ b/completions/kcov @@ -3,7 +3,7 @@ _kcov() { local cur prev words cword split - _init_completion -s || return + _init_completion -s -n : || return case "$prev" in --pid|-p) @@ -11,25 +11,31 @@ _kcov() return ;; --sort-type|-s) - COMPREPLY=( $( compgen -W 'filename percentage lines uncovered' \ - -- "$cur" ) ) + COMPREPLY=( $( compgen -W 'filename percent reverse lines + uncovered' -- "$cur" ) ) return ;; --include-path|--exclude-path) _filedir return ;; + --replace-src-path) + if [[ "$cur" == ?*:* ]]; then + cur="${cur##*:}" + _filedir + else + _filedir + compopt -o nospace + fi + return + ;; --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,"} ) + COMPREPLY=( $( compgen -P "$prev," -W "{0..100}" -- "$cur" ) ) else + COMPREPLY=( $( compgen -W "{0..100}" -- "$cur" ) ) compopt -o nospace fi return @@ -49,6 +55,7 @@ _kcov() fi _filedir -} && complete -F _kcov kcov +} && +complete -F _kcov kcov -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/kill b/completions/kill index ed5ae585..ac179cd9 100644 --- a/completions/kill +++ b/completions/kill @@ -26,4 +26,4 @@ _kill() } && complete -F _kill kill -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/killall b/completions/killall index ed502f97..6d1532c3 100644 --- a/completions/killall +++ b/completions/killall @@ -33,4 +33,4 @@ _killall() } && complete -F _killall killall -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/kldload b/completions/kldload index f362db69..0442e95e 100644 --- a/completions/kldload +++ b/completions/kldload @@ -15,8 +15,7 @@ _kldload() COMPREPLY=( ${COMPREPLY[@]#$moddir} ) COMPREPLY=( ${COMPREPLY[@]%.ko} ) - return 0 } && complete -F _kldload kldload -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/kldunload b/completions/kldunload index adb268d8..82770189 100644 --- a/completions/kldunload +++ b/completions/kldunload @@ -7,9 +7,9 @@ _kldunload() local cur prev words cword _init_completion || return - COMPREPLY=( $( kldstat | \ - sed -ne "s/^.*[ \t]\{1,\}\($cur[a-z_]\{1,\}\).ko$/\1/p" ) ) + COMPREPLY=( $( kldstat | command sed -ne \ + "s/^.*[[:blank:]]\{1,\}\($cur[a-z_]\{1,\}\).ko$/\1/p" ) ) } && complete -F _kldunload kldunload -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/koji b/completions/koji index bd6cb2fd..30b8d49a 100644 --- a/completions/koji +++ b/completions/koji @@ -244,4 +244,4 @@ _koji() } && complete -F _koji koji arm-koji ppc-koji s390-koji sparc-koji -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/ktutil b/completions/ktutil index 88eb5275..384db329 100644 --- a/completions/ktutil +++ b/completions/ktutil @@ -29,27 +29,27 @@ _ktutil() case $prev in -p|--principal) _heimdal_principals - return 0 + return ;; -e|--enctype) _heimdal_encodings - return 0 + return ;; -a|--admin-server) _known_hosts_real "$cur" - return 0 + return ;; -r|--realm) _heimdal_realms - return 0 + return ;; -s|-k|--srvtab|--keytab) _filedir - return 0 + return ;; esac - $split && return 0 + $split && return commands='add change copy get list remove rename purge srvconvert srv2keytab srvcreate key2srvtab' @@ -117,4 +117,4 @@ _ktutil() } && complete -F _ktutil ktutil -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/larch b/completions/larch index 79716a5f..5b7ebd14 100644 --- a/completions/larch +++ b/completions/larch @@ -33,8 +33,7 @@ _larch() "$cur" ) ) fi - return 0 } && complete -F _larch -o default larch -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/lastlog b/completions/lastlog index a8724029..4ac6b520 100644 --- a/completions/lastlog +++ b/completions/lastlog @@ -7,19 +7,19 @@ _lastlog() case $prev in -b|--before|-h|--help|-t|--time) - return 0 + return ;; -u|--user) COMPREPLY=( $( compgen -u -- "$cur" ) ) - return 0 + return ;; esac - $split && return 0 + $split && return COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace } && complete -F _lastlog lastlog -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/ldapsearch b/completions/ldapsearch index 6a9b7b1b..282760f7 100644 --- a/completions/ldapsearch +++ b/completions/ldapsearch @@ -18,32 +18,32 @@ _ldapsearch() case $prev in -h) _known_hosts_real "$cur" - return 0 + return ;; -H) _ldap_uris - return 0 + return ;; -T) _filedir -d - return 0 + return ;; -f|-y) _filedir - return 0 + return ;; -s) COMPREPLY=( $( compgen -W 'base one sub children' -- "$cur" ) ) - return 0 + return ;; -a) COMPREPLY=( $( compgen -W 'never always search find' \ -- "$cur" ) ) - return 0 + return ;; -P) _ldap_protocols - return 0 + return ;; esac @@ -61,19 +61,19 @@ _ldapaddmodify() case $prev in -h) _known_hosts_real "$cur" - return 0 + return ;; -H) _ldap_uris - return 0 + return ;; -S|-f|-y) _filedir - return 0 + return ;; -P) _ldap_protocols - return 0 + return ;; esac @@ -91,19 +91,19 @@ _ldapdelete() case $prev in -h) _known_hosts_real "$cur" - return 0 + return ;; -H) _ldap_uris - return 0 + return ;; -f|-y) _filedir - return 0 + return ;; -P) _ldap_protocols - return 0 + return ;; esac @@ -121,19 +121,19 @@ _ldapcompare() case $prev in -h) _known_hosts_real "$cur" - return 0 + return ;; -H) _ldap_uris - return 0 + return ;; -y) _filedir - return 0 + return ;; -P) _ldap_protocols - return 0 + return ;; esac @@ -151,19 +151,19 @@ _ldapmodrdn() case $prev in -h) _known_hosts_real "$cur" - return 0 + return ;; -H) _ldap_uris - return 0 + return ;; -f|-y) _filedir - return 0 + return ;; -P) _ldap_protocols - return 0 + return ;; esac @@ -181,19 +181,19 @@ _ldapwhoami() case $prev in -h) _known_hosts_real "$cur" - return 0 + return ;; -H) _ldap_uris - return 0 + return ;; -f|-y) _filedir - return 0 + return ;; -P) _ldap_protocols - return 0 + return ;; esac @@ -211,15 +211,15 @@ _ldappasswd() case $prev in -h) _known_hosts_real "$cur" - return 0 + return ;; -H) _ldap_uris - return 0 + return ;; -t|-T|-y) _filedir - return 0 + return ;; esac @@ -229,4 +229,4 @@ _ldappasswd() } && complete -F _ldappasswd ldappasswd -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/ldapvi b/completions/ldapvi index 9c9b6491..e3c1f103 100644 --- a/completions/ldapvi +++ b/completions/ldapvi @@ -8,37 +8,37 @@ _ldapvi() case $prev in -h|--host) _known_hosts_real "$cur" - return 0 + return ;; -Y|--sasl-mech) COMPREPLY=( $( compgen -W 'EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 PLAIN ANONYMOUS' -- "$cur" ) ) - return 0 + return ;; --bind) COMPREPLY=( $( compgen -W 'simple sasl' -- "$cur" ) ) - return 0 + return ;; --bind-dialog) COMPREPLY=( $( compgen -W 'never auto always' -- "$cur" ) ) - return 0 + return ;; --scope) COMPREPLY=( $( compgen -W 'base one sub' -- "$cur" ) ) - return 0 + return ;; --deref) COMPREPLY=( $( compgen -W 'never searching finding always' \ -- "$cur" ) ) - return 0 + return ;; --encoding) COMPREPLY=( $( compgen -W 'ASCII UTF-8 binary' -- "$cur" ) ) - return 0 + return ;; --tls) COMPREPLY=( $( compgen -W 'never allow try strict' -- "$cur" ) ) - return 0 + return ;; esac @@ -48,4 +48,4 @@ _ldapvi() } && complete -F _ldapvi ldapvi -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/lftp b/completions/lftp index 86706002..edb363b2 100644 --- a/completions/lftp +++ b/completions/lftp @@ -8,16 +8,16 @@ _lftp() case $prev in -f) _filedir - return 0 + return ;; -c|-h|--help|-v|--version|-e|-u|-p) - return 0 + return ;; esac if [[ "$cur" == -* ]] ; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - return 0 + return fi COMPREPLY=( $( compgen -W \ @@ -26,4 +26,4 @@ _lftp() } && complete -F _lftp lftp -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/lftpget b/completions/lftpget index 88ab31f6..8f1d4a2f 100644 --- a/completions/lftpget +++ b/completions/lftpget @@ -11,4 +11,4 @@ _lftpget() } && complete -F _lftpget lftpget -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/lilo b/completions/lilo index 3073183c..1ccca35c 100644 --- a/completions/lilo +++ b/completions/lilo @@ -3,7 +3,7 @@ _lilo_labels() { COMPREPLY=( $( compgen -W "$( awk -F'=' '/label/ {print $2}' \ - /etc/lilo.conf | sed -e 's/\"//g' )" -- "$cur" ) ) + /etc/lilo.conf | command sed -e 's/\"//g' )" -- "$cur" ) ) } _lilo() @@ -14,28 +14,28 @@ _lilo() case $prev in -C|-i|-m|-s|-S) _filedir - return 0 + return ;; -r) _filedir -d - return 0 + return ;; -I|-D|-R) # label completion _lilo_labels - return 0 + return ;; -A|-b|-M|-u|-U) # device completion cur=${cur:=/dev/} _filedir - return 0 + return ;; -T) # topic completion COMPREPLY=( $( compgen -W 'help ChRul EBDA geom geom= table= video' -- "$cur" ) ) - return 0 + return ;; esac @@ -47,4 +47,4 @@ _lilo() } && complete -F _lilo lilo -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/links b/completions/links index abb19900..8c72970e 100644 --- a/completions/links +++ b/completions/links @@ -23,12 +23,11 @@ _links() -- "$cur" ) ) fi _filedir '@(htm|html)' - return 0 + return ;; esac - return 0 } && complete -F _links links -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/lintian b/completions/lintian index 1c9eaa6e..e62a6265 100644 --- a/completions/lintian +++ b/completions/lintian @@ -4,13 +4,13 @@ _lintian_tags() { local match search tags - tags=$( grep -e ^Tag /usr/share/lintian/checks/*.desc | cut -d\ -f2 ) + tags=$( awk '/^Tag/ { print $2 }' /usr/share/lintian/checks/*.desc ) if [[ "$cur" == *, ]]; then search=${cur//,/ } for item in $search; do - match=$(grep -nE "^Tag: $item$" /usr/share/lintian/checks/*.desc \ - | cut -d: -f1 ) - tags=$( sed -e "s/\<$item\>//g" <<<$tags ) + match=$( command grep -nE "^Tag: $item$" \ + /usr/share/lintian/checks/*.desc | cut -d: -f1 ) + tags=$( command sed -e "s/\<$item\>//g" <<<$tags ) done COMPREPLY+=( $(compgen -W "$tags") ) elif [[ "$cur" == *,* ]]; then @@ -18,24 +18,22 @@ _lintian_tags() else COMPREPLY+=( $(compgen -W "$tags" -- "$cur") ) fi - return 0 } _lintian_checks() { local match search todisable checks - checks=$(grep -e ^Check-Script -e ^Abbrev \ - /usr/share/lintian/checks/*.desc | cut -d\ -f2 ) + checks=$( awk '/^(Check-Script|Abbrev)/ { print $2 }' \ + /usr/share/lintian/checks/*.desc ) if [[ "$cur" == *, ]]; then search=${cur//,/ } for item in $search; do - match=$(grep -nE "^(Check-Script|Abbrev): $item$" \ - /usr/share/lintian/checks/*.desc | cut -d: -f1 ) - todisable=$(grep -e ^Check-Script -e ^Abbrev $match | \ - cut -d\ -f2 ) + match=$( command grep -nE "^(Check-Script|Abbrev): $item$" \ + /usr/share/lintian/checks/*.desc | cut -d: -f1 ) + todisable=$( awk '/^(Check-Script|Abbrev)/ { print $2 }' $match ) for name in $todisable; do - checks=$( sed -e "s/\<$name\>//g" <<<$checks ) + checks=$( command sed -e "s/\<$name\>//g" <<<$checks ) done done COMPREPLY+=( $(compgen -W "$checks") ) @@ -44,21 +42,20 @@ _lintian_checks() else COMPREPLY+=( $(compgen -W "$checks" -- "$cur") ) fi - return 0 } _lintian_infos() { local match search infos - infos=$(grep -e ^Collector /usr/share/lintian/collection/*.desc \ - | cut -d\ -f2 ) + infos=$( awk '/^Collector/ { print $2 }' \ + /usr/share/lintian/collection/*.desc ) if [[ "$cur" == *, ]]; then search=${cur//,/ } for item in $search; do - match=$( grep -nE "^Collector: $item$" \ - /usr/share/lintian/collection/*.desc | cut -d: -f1 ) - infos=$( sed -e "s/\<$item\>//g" <<<$infos ) + match=$( command grep -nE "^Collector: $item$" \ + /usr/share/lintian/collection/*.desc | cut -d: -f1 ) + infos=$( command sed -e "s/\<$item\>//g" <<<$infos ) done COMPREPLY+=( $(compgen -W "$infos") ) elif [[ "$cur" == *,* ]]; then @@ -66,12 +63,6 @@ _lintian_infos() else COMPREPLY+=( $(compgen -W "$infos" -- "$cur") ) fi - return 0 -} - -_lintian_arches() -{ - return 0 } _lintian() @@ -94,7 +85,7 @@ _lintian() --root" selection_opts="--all --binary --source --udeb --packages-file" - if [[ "$prev" = -* ]]; then + if [[ "$prev" == -* ]]; then case $prev in -C|--check-part|-X|--dont-check-part) _lintian_checks @@ -176,4 +167,4 @@ _lintian_info() } && complete -F _lintian_info lintian-info -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/lisp b/completions/lisp index 45cd4e6f..279ffcdb 100644 --- a/completions/lisp +++ b/completions/lisp @@ -16,8 +16,7 @@ _lisp() _filedir fi - return 0 } && complete -F _lisp -o default lisp -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/list_admins b/completions/list_admins index 6c05a7d3..06542f91 100644 --- a/completions/list_admins +++ b/completions/list_admins @@ -14,4 +14,4 @@ _list_admins() } && complete -F _list_admins list_admins -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/list_lists b/completions/list_lists index 04471e1e..629e4c07 100644 --- a/completions/list_lists +++ b/completions/list_lists @@ -18,4 +18,4 @@ _list_lists() } && complete -F _list_lists list_lists -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/list_members b/completions/list_members index d432b36c..e60f61da 100644 --- a/completions/list_members +++ b/completions/list_members @@ -8,20 +8,20 @@ _list_members() case $prev in -o|--output) _filedir - return 0 + return ;; -d|--digest) COMPREPLY=( $( compgen -W 'mime plain' -- "$cur" ) ) - return 0 + return ;; -n|--nomail) COMPREPLY=( $( compgen -W 'byadmin byuser bybounce unknown' \ -- "$cur" ) ) - return 0 + return ;; esac - $split && return 0 + $split && return if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '--output --regular --digest --nomail @@ -33,4 +33,4 @@ _list_members() } && complete -F _list_members list_members -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/list_owners b/completions/list_owners index a780265b..88b25bb3 100644 --- a/completions/list_owners +++ b/completions/list_owners @@ -15,4 +15,4 @@ _list_owners() } && complete -F _list_owners list_owners -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/look b/completions/look deleted file mode 100644 index df914452..00000000 --- a/completions/look +++ /dev/null @@ -1,14 +0,0 @@ -# look(1) completion -*- shell-script -*- - -_look() -{ - local cur prev words cword - _init_completion || return - - if [[ $cword -eq 1 ]]; then - COMPREPLY=( $( compgen -W '$(look "$cur" 2>/dev/null)' -- "$cur" ) ) - fi -} && -complete -F _look -o default look - -# ex: ts=4 sw=4 et filetype=sh diff --git a/completions/lpq b/completions/lpq index d667713e..b02705af 100644 --- a/completions/lpq +++ b/completions/lpq @@ -8,21 +8,21 @@ _lpq() case $prev in -P) COMPREPLY=( $( compgen -W "$( lpstat -a 2>/dev/null | cut -d' ' -f1 )" -- "$cur" ) ) - return 0 + return ;; -U) COMPREPLY=( $( compgen -u -- "$cur" ) ) - return 0 + return ;; esac if [[ "$cur" == - ]]; then COMPREPLY=( $( compgen -W '-E -P -U -a -h -l' -- "$cur" ) ) - return 0 + return fi _filedir } && complete -F _lpq lpq -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/lpr b/completions/lpr index 35ddd625..b1515bd5 100644 --- a/completions/lpr +++ b/completions/lpr @@ -8,26 +8,26 @@ _lpr() case $prev in -P) COMPREPLY=( $( compgen -W "$( lpstat -a 2>/dev/null | cut -d' ' -f1 )" -- "$cur" ) ) - return 0 + return ;; -U) COMPREPLY=( $( compgen -u -- "$cur" ) ) - return 0 + return ;; -o) COMPREPLY=( $( compgen -W "media= landscape orientation-requested= sides= fitplot number-up= scaling= cpi= lpi= page-bottom= page-top= page-left= page-right=" -- "$cur" ) ) [[ $COMPREPLY == *= ]] && compopt -o nospace - return 0 + return ;; esac if [[ "$cur" == - ]]; then COMPREPLY=( $( compgen -W '-E -H -C -J -T -P -U -h -l -m -o -p -q -r' -- "$cur" ) ) - return 0 + return fi _filedir } && complete -F _lpr lpr -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/lrzip b/completions/lrzip index d4106fb2..f8e2cf1c 100644 --- a/completions/lrzip +++ b/completions/lrzip @@ -8,39 +8,39 @@ _lrzip() local xspec="*.lrz" case $prev in - -w|-S|-V|-h|-'?') - return 0 + -w|-S|-V|-h|-'?'|-m) + return ;; -d) xspec="!"$xspec ;; -o) _filedir - return 0 + return ;; -O) _filedir -d - return 0 + return ;; -L) COMPREPLY=( $( compgen -W '{1..9}' -- "$cur" ) ) - return 0 + return ;; -N) COMPREPLY=( $( compgen -W '{-20..19}' -- "$cur" ) ) - return 0 + return ;; -p) COMPREPLY=( $( compgen -W "{1..$(_ncpus)}" -- "$cur" ) ) - return 0 + return ;; esac - _expand || return 0 + _expand || return if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) ) - return 0 + return fi local IFS=$'\n' @@ -50,4 +50,4 @@ _lrzip() } && complete -F _lrzip lrzip -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/lsof b/completions/lsof index 6ff7786c..329946d5 100644 --- a/completions/lsof +++ b/completions/lsof @@ -7,38 +7,38 @@ _lsof() case $prev in -'?'|-h|+c|-c|-d|-F|-i|+r|-r|-s|-S|-T) - return 0 + return ;; -A|-k|-m|+m|-o) _filedir - return 0 + return ;; +d|+D) _filedir -d - return 0 + return ;; -D) COMPREPLY=( $( compgen -W '? b i r u' -- "$cur" ) ) - return 0 + return ;; -f) COMPREPLY=( $( compgen -W 'c f g G n' -- "$cur" ) ) - return 0 + return ;; -g) # TODO: handle ^foo exclusions, comma separated lists _pgids - return 0 + return ;; -p) # TODO: handle ^foo exclusions, comma separated lists _pids - return 0 + return ;; -u) # TODO: handle ^foo exclusions, comma separated lists COMPREPLY=( $( compgen -u -- "$cur" ) ) - return 0 + return ;; esac @@ -46,11 +46,11 @@ _lsof() COMPREPLY=( $( compgen -W '-h -a -A -b -c +c -C +d -d +D -D +f -f -F -g -i -k -l +L -L +m -m +M -M -n -N -o -O -p -P +r -r -R -s -S -T -t -u -U -v -V +w -w -x -X -z -Z' -- "$cur" ) ) - return 0 + return fi _filedir } && complete -F _lsof lsof -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/lua b/completions/lua index 83dc7368..9413319e 100644 --- a/completions/lua +++ b/completions/lua @@ -20,4 +20,4 @@ _lua() } && complete -F _lua lua -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/luac b/completions/luac index a0330735..9c91f25a 100644 --- a/completions/luac +++ b/completions/luac @@ -24,4 +24,4 @@ _luac() } && complete -F _luac luac -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/luseradd b/completions/luseradd index e5b00c3c..41769b00 100644 --- a/completions/luseradd +++ b/completions/luseradd @@ -37,4 +37,4 @@ _luseradd() } && complete -F _luseradd luseradd lusermod -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/luserdel b/completions/luserdel index 05faaac2..83e1818b 100644 --- a/completions/luserdel +++ b/completions/luserdel @@ -20,4 +20,4 @@ _luserdel() } && complete -F _luserdel luserdel -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/lvm b/completions/lvm index ba0720ed..fb83a3fb 100644 --- a/completions/lvm +++ b/completions/lvm @@ -1,26 +1,38 @@ # bash completion for lvm -*- shell-script -*- +_lvm_filedir() +{ + cur=${cur:-/dev/} + _filedir +} + _lvm_volumegroups() { COMPREPLY=( $(compgen -W "$( vgscan 2>/dev/null | \ - sed -n -e 's|.*Found.*"\(.*\)".*$|\1|p' )" -- "$cur" ) ) + command sed -n -e 's|.*Found.*"\(.*\)".*$|\1|p' )" -- "$cur" ) ) +} + +_lvm_physicalvolumes_all() +{ + COMPREPLY=( $(compgen -W "$( pvscan 2>/dev/null | \ + command sed -n -e 's|^.*PV \([^ ]*\) .*|\1|p' )" -- "$cur" ) ) } _lvm_physicalvolumes() { COMPREPLY=( $(compgen -W "$( pvscan 2>/dev/null | \ - sed -n -e 's|^.*PV \(.*\) VG.*$|\1|p' )" -- "$cur" ) ) + command sed -n -e 's|^.*PV \(.*\) VG.*$|\1|p' )" -- "$cur" ) ) } _lvm_logicalvolumes() { COMPREPLY=( $(compgen -W "$( lvscan 2>/dev/null | \ - sed -n -e "s|^.*'\(.*\)'.*$|\1|p" )" -- "$cur" ) ) + command 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] + [[ ${COMPREPLY[i]} == */control ]] && unset 'COMPREPLY[i]' done fi } @@ -85,18 +97,18 @@ _pvs() -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" ) ) - return 0 + return ;; --units) _lvm_units - return 0 + return ;; esac if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _lvm_physicalvolumes + _lvm_physicalvolumes_all fi } && complete -F _pvs pvs @@ -109,14 +121,14 @@ _pvdisplay() case $prev in --units) _lvm_units - return 0 + return ;; esac if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _lvm_physicalvolumes + _lvm_physicalvolumes_all fi } && complete -F _pvdisplay pvdisplay @@ -129,14 +141,14 @@ _pvchange() case $prev in -A|-x|--autobackup|--allocatable) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) - return 0 + return ;; esac if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _lvm_physicalvolumes + _lvm_physicalvolumes_all fi } && complete -F _pvchange pvchange @@ -149,26 +161,26 @@ _pvcreate() case $prev in --restorefile) _filedir - return 0 + return ;; -M|--metadatatype) COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) - return 0 + return ;; --metadatacopies) COMPREPLY=( $( compgen -W '0 1 2' -- "$cur" ) ) - return 0 + return ;; --metadatasize|--setphysicalvolumesize) _lvm_sizes - return 0 + return ;; esac if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _lvm_physicalvolumes + _lvm_filedir fi } && complete -F _pvcreate pvcreate @@ -181,11 +193,11 @@ _pvmove() case $prev in -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) - return 0 + return ;; -n|--name) _lvm_logicalvolumes - return 0 + return esac if [[ "$cur" == -* ]]; then @@ -206,7 +218,7 @@ _pvremove() if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else - _lvm_physicalvolumes + _lvm_physicalvolumes_all fi } && complete -F _pvremove pvremove @@ -233,11 +245,11 @@ _vgs() 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 + return ;; --units) _lvm_units - return 0 + return ;; esac @@ -257,7 +269,7 @@ _vgdisplay() case $prev in --units) _lvm_units - return 0 + return ;; esac @@ -277,7 +289,7 @@ _vgchange() case $prev in -a|-A|-x|--available|--autobackup|--resizeable) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) - return 0 + return ;; esac @@ -300,15 +312,15 @@ _vgcreate() case $prev in -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) - return 0 + return ;; -M|--metadatatype) COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) - return 0 + return ;; -s|--physicalextentsize) _lvm_sizes - return 0 + return ;; esac @@ -318,11 +330,11 @@ _vgcreate() --physicalextentsize --test --verbose --version' -- "$cur" ) ) else local args - _lvm_count_args @(-A|--autobackup|-M|--metadatatype|-s|--physicalextentsize) + _lvm_count_args '@(-A|--autobackup|-M|--metadatatype|-s|--physicalextentsize)' if [[ $args -eq 0 ]]; then _lvm_volumegroups else - _lvm_physicalvolumes + _lvm_physicalvolumes_all fi fi } && @@ -349,7 +361,7 @@ _vgrename() case $prev in -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) - return 0 + return ;; esac @@ -369,7 +381,7 @@ _vgreduce() case $prev in -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) - return 0 + return ;; esac @@ -378,7 +390,7 @@ _vgreduce() else local args - _lvm_count_args @(-A|--autobackup) + _lvm_count_args '@(-A|--autobackup)' if [[ $args -eq 0 ]]; then _lvm_volumegroups else @@ -396,11 +408,11 @@ _vgextend() case $prev in -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) - return 0 + return ;; -L|--size) _lvm_sizes - return 0 + return ;; esac @@ -408,11 +420,11 @@ _vgextend() COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else local args - _lvm_count_args @(-A|--autobackup|-L|--size) + _lvm_count_args '@(-A|--autobackup|-L|--size)' if [[ $args -eq 0 ]]; then _lvm_volumegroups else - _lvm_physicalvolumes + _lvm_physicalvolumes_all fi fi } && @@ -452,15 +464,15 @@ _vgconvert() case $prev in -M|--metadatatype) COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) - return 0 + return ;; --metadatacopies) COMPREPLY=( $( compgen -W '0 1 2' -- "$cur" ) ) - return 0 + return ;; --metadatasize) _lvm_sizes - return 0 + return ;; esac @@ -480,7 +492,7 @@ _vgcfgbackup() case $prev in -f|--file) _filedir - return 0 + return ;; esac @@ -500,15 +512,15 @@ _vgcfgrestore() case $prev in -f|--file) _filedir - return 0 + return ;; -M|--metadatatype) COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) - return 0 + return ;; -n|--name) _lvm_volumegroups - return 0 + return ;; esac @@ -528,7 +540,7 @@ _vgmerge() case $prev in -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) - return 0 + return ;; esac @@ -548,11 +560,11 @@ _vgsplit() case $prev in -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) - return 0 + return ;; -M|--metadatatype) COMPREPLY=( $( compgen -W '1 2' -- "$cur" ) ) - return 0 + return ;; esac @@ -561,7 +573,7 @@ _vgsplit() --metadatatype --test --verbose --version' -- "$cur" ) ) else local args - _lvm_count_args @(-A|--autobackup|-M|--metadatatype) + _lvm_count_args '@(-A|--autobackup|-M|--metadatatype)' if [[ $args -eq 0 || $args -eq 1 ]]; then _lvm_volumegroups else @@ -605,11 +617,11 @@ _lvs() 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 + return ;; --units) _lvm_units - return 0 + return ;; esac @@ -629,7 +641,7 @@ _lvdisplay() case $prev in --units) _lvm_units - return 0 + return ;; esac @@ -649,11 +661,11 @@ _lvchange() case $prev in -a|-A|-C|-M|--available|--autobackup|--contiguous|--persistent) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) - return 0 + return ;; -p|--permission) COMPREPLY=( $( compgen -W 'r rw' -- "$cur" ) ) - return 0 + return ;; esac @@ -673,19 +685,19 @@ _lvcreate() case $prev in -A|-C|-M|-Z|--autobackup|--contiguous|--persistent|--zero) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) - return 0 + return ;; -L|--size) _lvm_sizes - return 0 + return ;; -p|--permission) COMPREPLY=( $( compgen -W 'r rw' -- "$cur" ) ) - return 0 + return ;; -n|--name) _lvm_logicalvolumes - return 0 + return ;; esac @@ -693,7 +705,7 @@ _lvcreate() COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else local args - _lvm_count_args @(-A|-C|-M|-Z|--autobackup|--contiguous|--persistent|--zero|-L|--size|-p|--permission|-n|--name) + _lvm_count_args '@(-A|-C|-M|-Z|--autobackup|--contiguous|--persistent|--zero|-L|--size|-p|--permission|-n|--name)' if [[ $args -eq 0 ]]; then _lvm_volumegroups else @@ -711,7 +723,7 @@ _lvremove() case $prev in -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) - return 0 + return ;; esac @@ -731,7 +743,7 @@ _lvrename() case $prev in -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) - return 0 + return ;; esac @@ -751,11 +763,11 @@ _lvreduce() case $prev in -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) - return 0 + return ;; -L|--size) _lvm_sizes - return 0 + return ;; esac @@ -775,11 +787,11 @@ _lvresize() case $prev in -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) - return 0 + return ;; -L|--size) _lvm_sizes - return 0 + return ;; esac @@ -787,7 +799,7 @@ _lvresize() COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else local args - _lvm_count_args @(-A|--autobackup|-L|--size) + _lvm_count_args '@(-A|--autobackup|-L|--size)' if [[ $args -eq 0 ]]; then _lvm_logicalvolumes else @@ -805,11 +817,11 @@ _lvextend() case $prev in -A|--autobackup) COMPREPLY=( $( compgen -W 'y n' -- "$cur" ) ) - return 0 + return ;; -L|--size) _lvm_sizes - return 0 + return ;; esac @@ -817,7 +829,7 @@ _lvextend() COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) ) else local args - _lvm_count_args @(-A|--autobackup|-L|--size) + _lvm_count_args '@(-A|--autobackup|-L|--size)' if [[ $args -eq 0 ]]; then _lvm_logicalvolumes else @@ -841,118 +853,17 @@ _lvm() vgimport vgmerge vgmknodes vgreduce vgremove vgrename vgs vgscan vgsplit version' -- "$cur" ) ) else - case ${words[1]} in - pvchange) - _pvchange - ;; - pvcreate) - _pvcreate - ;; - pvdisplay) - _pvdisplay - ;; - pvmove) - _pvmove - ;; - pvremove) - _pvremove - ;; - pvresize) - _pvresize - ;; - pvs) - _pvs - ;; - pvscan) - _pvscan - ;; - vgcfgbackup) - _vgcfgbackup - ;; - vgcfgrestore) - _vgcfgrestore - ;; - vgchange) - _vgchange - ;; - vgck) - _vgck - ;; - vgconvert) - _vgconvert - ;; - vgcreate) - _vgcreate - ;; - vgdisplay) - _vgdisplay - ;; - vgexport) - _vgexport - ;; - vgextend) - _vgextend - ;; - vgimport) - _vgimport - ;; - vgmerge) - _vgmerge - ;; - vgmknodes) - _vgmknodes - ;; - vgreduce) - _vgreduce - ;; - vgremove) - _vgremove - ;; - vgrename) - _vgrename - ;; - vgs) - _vgs - ;; - vgscan) - _vgscan - ;; - vgsplit) - _vgsplit - ;; - lvchange) - _lvchange - ;; - lvcreate) - _lvcreate - ;; - lvdisplay) - _lvdisplay - ;; - lvextend) - _lvextend - ;; - lvreduce) - _lvreduce - ;; - lvremove) - _lvremove - ;; - lvrename) - _lvrename - ;; - lvresize) - _lvresize - ;; - lvs) - _lvs - ;; - lvscan) - _lvscan + case "${words[1]}" in + pvchange|pvcreate|pvdisplay|pvmove|pvremove|pvresize|pvs|pvscan|\ + vgcfgbackup|vgcfgrestore|vgchange|vgck|vgconvert|vgcreate|\ + vgdisplay|vgexport|vgextend|vgimport|vgmerge|vgmknodes|vgreduce|\ + vgremove|vgrename|vgs|vgscan|vgsplit|lvchange|lvcreate|lvdisplay|\ + lvextend|lvreduce|lvremove|lvrename|lvresize|lvscan) + _${words[1]} ;; esac fi } && complete -F _lvm lvm -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/lz4 b/completions/lz4 new file mode 100644 index 00000000..56602ca2 --- /dev/null +++ b/completions/lz4 @@ -0,0 +1,53 @@ +# lz4 completion -*- shell-script -*- + +_lz4() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -b) + _filedir + return + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $( compgen -W \ + '$( _parse_help "$1" -h | command sed -e "/#/d" ) -B{4..7} -i{1..9}' \ + -- "$cur" ) ) + return + fi + + local args word xspec="*.?(t)lz4" + _count_args + [[ $args -gt 2 ]] && return + + for word in ${words[@]}; do + case $word in + -*[dt]*) + case $args in + 1) xspec="!"$xspec ;; + 2) [[ $word == *t* ]] && return + esac + break + ;; + -z) + case $args in + 1) xspec= ;; + 2) xspec="!"$xspec ;; + esac + break + ;; + esac + done + + _expand || return + local IFS=$'\n' + compopt -o filenames + COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ + $( compgen -d -- "$cur" ) ) +} && +complete -F _lz4 lz4 lz4c + +# ex: filetype=sh diff --git a/completions/lzip b/completions/lzip index ae35b9d4..c1aab4a8 100644 --- a/completions/lzip +++ b/completions/lzip @@ -46,4 +46,4 @@ _lzip() } && complete -F _lzip clzip lzip pdlzip plzip -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/lzma b/completions/lzma index 30566ed0..74dac25c 100644 --- a/completions/lzma +++ b/completions/lzma @@ -11,22 +11,20 @@ _lzma() --help --decompress --compress --keep --force --suffix --test --stdout --quiet --verbose --license --list --version --small --fast --best --text' -- "$cur" ) ) - return 0 + return fi local IFS=$'\n' xspec="*.@(lzma|tlz)" if [[ "$prev" == --* ]]; then - [[ "$prev" == --decompress || \ - "$prev" == --list || \ - "$prev" == --test ]] && xspec="!"$xspec + [[ "$prev" == --@(decompress|list|test) ]] && xspec="!"$xspec [[ "$prev" == --compress ]] && xspec= elif [[ "$prev" == -* ]]; then [[ "$prev" == -*[dt]* ]] && xspec="!"$xspec [[ "$prev" == -*z* ]] && xspec= fi - _expand || return 0 + _expand || return compopt -o filenames COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \ @@ -34,4 +32,4 @@ _lzma() } && complete -F _lzma lzma -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/lzop b/completions/lzop index e23d5410..f6753529 100644 --- a/completions/lzop +++ b/completions/lzop @@ -8,14 +8,14 @@ _lzop() case $prev in -o|--output) _filedir - return 0 + return ;; --path) _filedir -d - return 0 + return ;; -S|--suffix) - return 0 + return ;; esac @@ -27,7 +27,7 @@ _lzop() --keep --delete --crc32 --no-warn --ignore-warn --quiet --verbose --no-stdin --filter --checksum --no-color --mono --color' \ -- "$cur" ) ) - return 0 + return fi local xspec="*.?(t)lzo" @@ -48,7 +48,7 @@ _lzop() ;; esac - _expand || return 0 + _expand || return local IFS=$'\n' compopt -o filenames @@ -57,4 +57,4 @@ _lzop() } && complete -F _lzop lzop -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/macof b/completions/macof index 264f1c9d..dacae2fd 100644 --- a/completions/macof +++ b/completions/macof @@ -8,7 +8,7 @@ _macof() case $prev in -i) _available_interfaces -a - return 0 + return ;; esac @@ -20,4 +20,4 @@ _macof() } && complete -F _macof macof -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/mailmanctl b/completions/mailmanctl index 5e6ed2ee..717df7b9 100644 --- a/completions/mailmanctl +++ b/completions/mailmanctl @@ -15,4 +15,4 @@ _mailmanctl() } && complete -F _mailmanctl mailmanctl -# ex: ts=4 sw=4 et filetype=sh +# ex: filetype=sh diff --git a/completions/make b/completions/make index b4ad9e73..1075b37a 100644 --- a/completions/make +++ b/completions/make @@ -1,13 +1,12 @@ # bash completion for GNU make -*- shell-script -*- -function _make_target_extract_script() +_make_target_extract_script() { local mode="$1" shift local prefix="$1" - local prefix_pat=$( printf "%s\n" "$prefix" | \ - sed 's/[][\,.*^$(){}?+|/]/\\&/g' ) + local prefix_pat=$( command sed 's/[][\,.*^$(){}?+|/]/\\&/g' <<<"$prefix" ) local basename=${prefix##*/} local dirname_len=$(( ${#prefix} - ${#basename} )) @@ -20,51 +19,63 @@ function _make_target_extract_script() fi cat <