From 019f3cc463db63abc6460f97deb488deec43840b Mon Sep 17 00:00:00 2001 From: "Gabriel F. T. Gomes" Date: Fri, 24 Jan 2020 19:24:09 -0300 Subject: New upstream version 2.10 --- completions/.gitignore | 3 + completions/Makefile.am | 572 ++++++++++++++-------------------------- completions/_cal | 3 +- completions/_chsh | 3 +- completions/apt-get | 18 +- completions/badblocks | 5 +- completions/carton | 78 ++++++ completions/chromium-browser | 21 +- completions/cppcheck | 4 +- completions/curl | 6 +- completions/dmypy | 47 ++++ completions/gcc | 82 +++--- completions/gprof | 10 +- completions/gssdp-discover | 31 +++ completions/iconv | 2 +- completions/influx | 32 +++ completions/ip | 2 +- completions/ipv6calc | 9 +- completions/java | 7 +- completions/lintian | 11 +- completions/lvm | 20 +- completions/lz4 | 5 +- completions/makepkg | 3 +- completions/man | 3 +- completions/op | 2 +- completions/perl | 91 ++++--- completions/perltidy | 2 +- completions/pgrep | 2 +- completions/pkg-get | 2 +- completions/pkg_delete | 4 +- completions/pkgutil | 2 +- completions/postfix | 2 + completions/pwck | 3 +- completions/ri | 2 +- completions/screen | 32 ++- completions/shellcheck | 14 +- completions/smartctl | 7 +- completions/ssh | 75 +++++- completions/ssh-add | 10 +- completions/ssh-copy-id | 2 +- completions/ssh-keygen | 7 +- completions/sysctl | 2 +- completions/tar | 21 +- completions/timeout | 3 +- completions/tipc | 7 +- completions/tox | 13 +- completions/unrar | 2 +- completions/update-alternatives | 4 +- completions/update-rc.d | 11 +- completions/valgrind | 3 +- completions/wine | 2 +- completions/xsltproc | 4 +- completions/xvfb-run | 36 +++ 53 files changed, 773 insertions(+), 571 deletions(-) create mode 100644 completions/carton create mode 100644 completions/dmypy create mode 100644 completions/gssdp-discover create mode 100644 completions/influx create mode 100644 completions/xvfb-run (limited to 'completions') diff --git a/completions/.gitignore b/completions/.gitignore index 06f8d013..34167766 100644 --- a/completions/.gitignore +++ b/completions/.gitignore @@ -71,6 +71,7 @@ google-chrome google-chrome-stable gpc gpgv2 +gtar hciattach hciconfig hd @@ -224,6 +225,8 @@ vgscan vgsplit vigr whatis +wine-development +wine-stable xpovray xvnc4viewer ypcat diff --git a/completions/Makefile.am b/completions/Makefile.am index 94cca466..8f276d66 100644 --- a/completions/Makefile.am +++ b/completions/Makefile.am @@ -1,4 +1,4 @@ -bashcompdir = $(pkgdatadir)/completions +bashcompdir = $(datadir)/$(PACKAGE)/completions bashcomp_DATA = 2to3 \ 7z \ a2x \ @@ -37,6 +37,7 @@ bashcomp_DATA = 2to3 \ _cal \ cancel \ cardctl \ + carton \ ccache \ ccze \ cfagent \ @@ -79,6 +80,7 @@ bashcomp_DATA = 2to3 \ dhclient \ dict \ _dmesg \ + dmypy \ dnssec-keygen \ dnsspoof \ dot \ @@ -143,6 +145,7 @@ bashcomp_DATA = 2to3 \ groupmod \ growisofs \ grpck \ + gssdp-discover \ gzip \ hcitool \ hddtemp \ @@ -160,6 +163,7 @@ bashcomp_DATA = 2to3 \ ifstat \ iftop \ ifup \ + influx \ info \ inject \ inotifywait \ @@ -451,6 +455,7 @@ bashcomp_DATA = 2to3 \ xrandr \ xrdb \ xsltproc \ + xvfb-run \ xxd \ xz \ xzdec \ @@ -560,6 +565,7 @@ CLEANFILES = \ google-chrome-stable \ gpc \ gpgv2 \ + gtar \ hciattach \ hciconfig \ hd \ @@ -724,379 +730,209 @@ CLEANFILES = \ xvnc4viewer \ ypcat -symlinks: $(targetdir) $(DATA) - 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 aclocal-1.16 ; 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 aptitude-curses ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) aptitude $(targetdir)/$$file ; \ - done - for file in asciidoc.py ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) asciidoc $(targetdir)/$$file ; \ - done - for file in automake-1.10 automake-1.11 automake-1.12 automake-1.13 \ - automake-1.14 automake-1.15 automake-1.16 ; 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 google-chrome google-chrome-stable chromium chrome; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) chromium-browser $(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 etherwake ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) ether-wake $(targetdir)/$$file ; \ - done - for file in mailsnarf msgsnarf ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) filesnarf $(targetdir)/$$file ; \ - done - for file in iceweasel mozilla-firefox ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) firefox $(targetdir)/$$file ; \ - done - for file in civclient freeciv-gtk2 freeciv-gtk3 freeciv-sdl \ - freeciv-xaw ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) freeciv $(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 cc c++ g++ g++-5 g++-6 g++-7 g++-8 gfortran gfortran-5 \ - gfortran-6 gfortran-7 gfortran-8 f77 g77 f95 g95 gcj gpc \ - gccgo gccgo-5 gccgo-6 gccgo-7 gccgo-8 gcc-5 gcc-6 gcc-7 \ - gcc-8 ; 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 geoiplookup6 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) geoiplookup $(targetdir)/$$file ; \ - done - for file in gkrellm2 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) gkrellm $(targetdir)/$$file ; \ - done - for file in gpgv2 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) gpgv $(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 ifquery 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 inotifywatch ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) inotifywait $(targetdir)/$$file ; \ - done - for file in insmod.static ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) insmod $(targetdir)/$$file ; \ - done - for file in iperf3 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) iperf $(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 links2 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) links $(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 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 ; \ - 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 createuser dropdb dropuser ; 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 pytest-2 pytest-3 py.test py.test-2 py.test-3 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) pytest $(targetdir)/$$file ; \ - done - for file in pydoc3 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) pydoc $(targetdir)/$$file ; \ - done - for file in pylint-2 pylint-3 ; do \ - rm -f $(targetdir)/$$file && \ - $(LN_S) pylint $(targetdir)/$$file ; \ - done - 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 pyvenv-3.6 pyvenv-3.7 \ - pyvenv-3.8 ; 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 ; \ - 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 sidedoor ; 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 +symlinks: $(DATA) + $(ss) 7z \ + 7za + $(ss) aclocal \ + aclocal-1.10 aclocal-1.11 aclocal-1.12 aclocal-1.13 \ + aclocal-1.14 aclocal-1.15 aclocal-1.16 + $(ss) ant \ + phing + $(ss) aptitude \ + aptitude-curses + $(ss) asciidoc \ + asciidoc.py + $(ss) automake \ + automake-1.10 automake-1.11 automake-1.12 automake-1.13 \ + automake-1.14 automake-1.15 automake-1.16 + $(ss) autoreconf \ + autoheader + $(ss) autoscan \ + autoupdate + $(ss) btdownloadheadless.py \ + btdownloadcurses.py btdownloadgui.py + $(ss) bzip2 \ + lbzip2 pbzip2 + $(ss) _cal \ + ncal + $(ss) cardctl \ + pccardctl + $(ss) chromium-browser \ + chrome chromium google-chrome google-chrome-stable + $(ss) complete \ + compgen + $(ss) convert \ + animate compare composite conjure display identify import \ + mogrify montage stream + $(ss) cowsay \ + cowthink + $(ss) dict \ + rdict + $(ss) dpkg \ + dpkg-deb dpkg-query dpkg-reconfigure + $(ss) ether-wake \ + etherwake + $(ss) filesnarf \ + mailsnarf msgsnarf + $(ss) firefox \ + iceweasel mozilla-firefox + $(ss) freeciv \ + civclient freeciv-gtk2 freeciv-gtk3 freeciv-sdl freeciv-xaw + $(ss) freeciv-server \ + civserver + $(ss) function \ + declare typeset + $(ss) gcc \ + c++ cc f77 f95 g++ g++-5 g++-6 g++-7 g++-8 g77 g95 gcc-5 \ + gcc-6 gcc-7 gcc-8 gccgo gccgo-5 gccgo-6 gccgo-7 gccgo-8 gcj \ + gfortran gfortran-5 gfortran-6 gfortran-7 gfortran-8 gpc + $(ss) genisoimage \ + mkisofs + $(ss) geoiplookup \ + geoiplookup6 + $(ss) gkrellm \ + gkrellm2 + $(ss) gpgv \ + gpgv2 + $(ss) gzip \ + pigz + $(ss) hcitool \ + ciptool dfutool hciattach hciconfig l2ping rfcomm sdptool + $(ss) _hexdump \ + hd + $(ss) hping2 \ + hping hping3 + $(ss) ifup \ + ifdown ifquery ifstatus + $(ss) info \ + pinfo + $(ss) inotifywait \ + inotifywatch + $(ss) insmod \ + insmod.static + $(ss) iperf \ + iperf3 + $(ss) java \ + javac javadoc + $(ss) koji \ + arm-koji ppc-koji s390-koji sparc-koji + $(ss) ldapsearch \ + ldapadd ldapcompare ldapdelete ldapmodify ldapmodrdn \ + ldappasswd ldapwhoami + $(ss) links \ + links2 + $(ss) lintian \ + lintian-info + $(ss) luseradd \ + lusermod + $(ss) lvm \ + lvchange lvcreate lvdisplay lvextend lvmdiskscan lvreduce \ + lvremove lvrename lvresize lvs lvscan pvchange pvcreate \ + pvdisplay pvmove pvremove pvs pvscan vgcfgbackup vgcfgrestore \ + vgchange vgck vgconvert vgcreate vgdisplay vgexport vgextend \ + vgimport vgmerge vgmknodes vgreduce vgremove vgrename vgs \ + vgscan vgsplit + $(ss) lz4 \ + lz4c + $(ss) lzip \ + clzip pdlzip plzip + $(ss) make \ + colormake gmake gnumake pmake + $(ss) man \ + apropos whatis + $(ss) mcrypt \ + mdecrypt + $(ss) mplayer \ + gmplayer kplayer mencoder mplayer2 + $(ss) mutt \ + muttng + $(ss) nslookup \ + host + $(ss) p4 \ + g4 + $(ss) perl \ + perldoc + $(ss) pine \ + alpine + $(ss) ping \ + ping6 + $(ss) pkg_delete \ + pkg_deinstall pkg_info + $(ss) pgrep \ + pkill + $(ss) pm-hibernate \ + pm-suspend pm-suspend-hybrid + $(ss) psql \ + createdb createuser dropdb dropuser + $(ss) postmap \ + postalias + $(ss) povray \ + spovray xpovray + $(ss) puppet \ + filebucket puppetca puppetd puppetdoc puppetmasterd puppetqd \ + puppetrun ralsh + $(ss) pytest \ + py.test py.test-2 py.test-3 pytest-2 pytest-3 + $(ss) pydoc \ + pydoc3 + $(ss) pylint \ + pylint-2 pylint-3 + $(ss) python \ + micropython pypy pypy3 python2 python3 + $(ss) pyvenv \ + pyvenv-3.4 pyvenv-3.5 pyvenv-3.6 pyvenv-3.7 pyvenv-3.8 + $(ss) qdbus \ + dcop + $(ss) qemu \ + qemu-kvm qemu-system-i386 qemu-system-x86_64 + $(ss) quota \ + edquota quotacheck quotaoff quotaon repquota setquota + $(ss) rcs \ + ci co rcsdiff rlog + $(ss) rpm \ + rpmbuild rpmbuild-md5 + $(ss) rpm2tgz \ + rpm2targz rpm2txz + $(ss) smbclient \ + smbcacls smbcquotas smbget smbpasswd smbtar smbtree + $(ss) sbcl \ + sbcl-mt + $(ss) ssh \ + autossh scp sftp sidedoor slogin + $(ss) sudo \ + sudoedit + $(ss) tar \ + bsdtar gtar star + $(ss) tracepath \ + tracepath6 + $(ss) update-alternatives \ + alternatives + $(ss) vipw \ + vigr + $(ss) vncviewer \ + tightvncviewer xvnc4viewer + $(ss) wine \ + wine-development wine-stable + $(ss) wodim \ + cdrecord + $(ss) xz \ + pxz + $(ss) ypmatch \ + ypcat .PHONY: symlinks -all-local: targetdir = . +SETUP_SYMLINKS = $(srcdir)/../setup-symlinks.sh + +all-local: ss = $(SETUP_SYMLINKS) . all-local: symlinks -install-data-hook: targetdir = $(DESTDIR)$(bashcompdir) +install-data-hook: ss = $(SETUP_SYMLINKS) $(DESTDIR)$(bashcompdir) install-data-hook: symlinks check-local: - ret=0 - for file in $(bashcomp_DATA) ; do \ + ret=0; \ + for file in $(bashcomp_DATA); do \ $${bashcomp_bash:-$${BASH:-bash}} \ - -O extglob -n $(srcdir)/$$file || ret=$$? ; \ - done ; \ + -O extglob -n $(srcdir)/$$file || ret=$$?; \ + done; \ exit $$ret diff --git a/completions/_cal b/completions/_cal index 9aefa704..ed304aa7 100644 --- a/completions/_cal +++ b/completions/_cal @@ -24,7 +24,8 @@ _cal() esac if [[ $cur == -* ]]; then - COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) + local opts=$(_parse_help "$1") + COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") ) return fi diff --git a/completions/_chsh b/completions/_chsh index 48473fe8..64ce5a1b 100644 --- a/completions/_chsh +++ b/completions/_chsh @@ -19,7 +19,8 @@ _chsh() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) + local opts=$(_parse_help "$1") + COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") ) else _allowed_users fi diff --git a/completions/apt-get b/completions/apt-get index 3b00c56a..9c88fe60 100644 --- a/completions/apt-get +++ b/completions/apt-get @@ -2,8 +2,8 @@ _apt_get() { - local cur prev words cword - _init_completion -n = || return + local cur prev words cword package + _init_completion -n ':=' || return local special i for (( i=0; i < ${#words[@]}-1; i++ )); do @@ -34,11 +34,15 @@ _apt_get() _filedir deb return elif [[ $cur == *=* ]]; then - COMPREPLY=( $(compgen -W "$(\ - apt-cache --no-generate show "${cur%%=*}" 2>/dev/null | - command sed -ne \ - 's/^Version:[[:space:]]*\([^[:space:]]\)/\1/p')" \ - -- "${cur#*=}") ) + package="${cur%%=*}" + cur="${cur#*=}" + COMPREPLY=($(IFS=$'\n' compgen -W "$( \ + apt-cache --no-generate madison "$package" 2>/dev/null | \ + while IFS=' |' read -r _ version _; do + echo "$version" + done )" \ + -- "$cur")) + __ltrim_colon_completions "$cur" return fi ;;& diff --git a/completions/badblocks b/completions/badblocks index a366338c..221f42b9 100644 --- a/completions/badblocks +++ b/completions/badblocks @@ -16,11 +16,8 @@ _badblocks() esac if [[ "$cur" == -* ]]; then - 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]' - done + COMPREPLY=( $(compgen -X -[wX] -W '$(_parse_usage "$1")' -- "$cur") ) return fi diff --git a/completions/carton b/completions/carton new file mode 100644 index 00000000..0cf6e2ca --- /dev/null +++ b/completions/carton @@ -0,0 +1,78 @@ +# carton(3pm) completion -*- shell-script -*- + +_carton_commands() +{ + local cmds=$("${1:-carton}" usage 2>&1 | \ + command sed -ne '/.*command.* is one of/{n;p;q}') + COMPREPLY+=( $(IFS="$IFS," compgen -W "$cmds" -- "$cur") ) +} + +_carton_command_help() +{ + local help=$(PERLDOC_PAGER=cat PERLDOC=-otext "${1:-carton}" -h $2 2>&1) + COMPREPLY+=( $(compgen -W '$help' -- "$cur") ) +} + +_carton() +{ + local cur prev words cword split + _init_completion -s || return + + local i command + for (( i=1; i < cword; i++ )); do + case ${words[i]} in + -*) ;; + *) command=${words[i]}; break ;; + esac + done + + if [[ -z "$command" ]]; then + _carton_commands "$1" + return + fi + + case $prev in + --version|-v) + return + ;; + --help|-h) + [[ -n "$command" ]] || _carton_commands "$1" + return + ;; + --cpanfile) + if [[ $command == install ]]; then + _filedir + return + fi + ;; + --path) + if [[ $command == install ]]; then + _filedir -d + return + fi + ;; + --without) + if [[ $command == install ]]; then + local phases="configure build test runtime develop" + COMPREPLY+=( $(compgen -W '$phases' -- "$cur") ) + return + fi + ;; + esac + + $split && return + + if [[ $cur == -* ]]; then + [[ $command == @(help|usage) ]] || COMPREPLY=(--help) + _carton_command_help "$1" $command + fi + + case $command in + show|update) + : # TODO modules completion + ;; + esac +} && +complete -F _carton carton + +# ex: filetype=sh diff --git a/completions/chromium-browser b/completions/chromium-browser index f8bebd97..a26b04f2 100644 --- a/completions/chromium-browser +++ b/completions/chromium-browser @@ -3,16 +3,31 @@ _chromium_browser() { local cur prev words cword split - _init_completion -s || return + _init_completion -s -n : || return case $prev in - --help|--app|--proxy-server|--proxy-pac-url|-h) + --help|--app|--proxy-pac-url|-h) return ;; --user-data-dir) _filedir -d return ;; + --proxy-server) + case $cur in + *://*) + local prefix="${cur%%://*}://" + _known_hosts_real -- "${cur#*://}" + COMPREPLY=( "${COMPREPLY[@]/#/$prefix}" ) + __ltrim_colon_completions "$cur" + ;; + *) + compopt -o nospace + COMPREPLY=( $(compgen -S :// -W 'http socks socks4 socks5' -- "$cur") ) + ;; + esac + return + ;; --password-store) COMPREPLY=( $(compgen -W 'basic gnome kwallet' -- "$cur") ) return @@ -27,7 +42,7 @@ _chromium_browser() return fi - _filedir "@(?([xs])htm?(l)|pdf)" + _filedir "@(?([mxs])htm?(l)|pdf)" } && complete -F _chromium_browser chromium-browser google-chrome \ google-chrome-stable chromium chrome diff --git a/completions/cppcheck b/completions/cppcheck index 2e487f81..ebc3ba3b 100644 --- a/completions/cppcheck +++ b/completions/cppcheck @@ -51,8 +51,8 @@ _cppcheck() return ;; --std) - COMPREPLY=( $(compgen -W 'c89 c99 c11 c++03 c++11 posix' \ - -- "$cur") ) + COMPREPLY=( $(compgen -W 'c89 c99 c11 c++03 c++11 c++14 c++17 + c++20' -- "$cur") ) return ;; --platform) diff --git a/completions/curl b/completions/curl index 2fe06272..d744e49a 100644 --- a/completions/curl +++ b/completions/curl @@ -43,6 +43,10 @@ _curl() if [[ $cur == \@* ]]; then cur=${cur:1} _filedir + if [[ ${#COMPREPLY[@]} -eq 1 && -d "${COMPREPLY[0]}" ]]; then + COMPREPLY[0]+=/ + compopt -o nospace + fi COMPREPLY=( "${COMPREPLY[@]/#/@}" ) fi return @@ -72,7 +76,7 @@ _curl() return ;; --pubkey) - _filedir pub + _xfunc ssh _ssh_identityfile pub return ;; --stderr) diff --git a/completions/dmypy b/completions/dmypy new file mode 100644 index 00000000..a8c07437 --- /dev/null +++ b/completions/dmypy @@ -0,0 +1,47 @@ +# dmypy completion -*- shell-script -*- + +_dmypy() +{ + local cur prev words cword + _init_completion || return + + case $prev in + --help|--version|-[hV]) + return + ;; + --status-file) + _filedir + return + ;; + esac + + local cmd i + for (( i=1; i < cword; i++ )); do + if [[ ${words[i]} != -* && ${words[i-1]} != --status-file ]]; then + cmd=${words[i]} + break + fi + done + + case $cmd in + check|run) + _filedir '@(py|pyi)' + return + esac + + if [[ $cur == -* ]]; then + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) + return + fi + + if [[ ! $cmd ]]; then + local cmds=$($1 --help 2>&1 \ + | command sed -ne '/positional arguments/{p;n;p;q}' \ + | command sed -ne 's/{\(.*\)}/\1/p') + COMPREPLY=( $(IFS="," compgen -W '$cmds' -- "$cur") ) + return + fi +} && +complete -F _dmypy dmypy + +# ex: filetype=sh diff --git a/completions/gcc b/completions/gcc index b72bf972..86d0d095 100644 --- a/completions/gcc +++ b/completions/gcc @@ -1,50 +1,58 @@ # gcc(1) completion -*- shell-script -*- -# -# The only unusual feature is that we don't parse "gcc --help -v" output -# directly, because that would include the options of all the other backend -# tools (linker, assembler, preprocessor, etc) without any indication that -# you cannot feed such options to the gcc driver directly. (For example, the -# linker takes a -z option, but you must type -Wl,-z for gcc.) Instead, we -# ask the driver ("g++") for the name of the compiler ("cc1"), and parse the -# --help output of the compiler. _gcc() { - local cur prev words cword + local cur prev prev2 words cword argument prefix prefix_length _init_completion || return - local cc backend + # Test that GCC is recent enough and if not fallback to + # parsing of --completion option. + if ! $1 --completion=" " 2>/dev/null; then + if [[ "$cur" == -* ]]; then + local cc=$($1 -print-prog-name=cc1 2>/dev/null) + [[ $cc ]] || return + COMPREPLY=($( compgen -W "$($cc --help 2>/dev/null | tr '\t' ' ' |\ + command sed -e '/^ *-/!d' -e 's/ *-\([^][ <>]*\).*/-\1/')" \ + -- "$cur" )) + [[ $COMPREPLY == *= ]] && compopt -o nospace + else + _filedir + fi + return + fi - case $1 in - gcj) - backend=jc1 - ;; - gpc) - backend=gpc1 - ;; - *77) - backend=f771 - ;; - *95) - backend=f951 - ;; - *) - backend=cc1 # (near-)universal backend - ;; - esac + # extract also for situations like: -fsanitize=add + if [[ $cword -gt 2 ]]; then + prev2="${COMP_WORDS[$cword - 2]}" + fi + # sample: -fsan if [[ "$cur" == -* ]]; then - cc=$($1 -print-prog-name=$backend 2>/dev/null) - [[ $cc ]] || return - # sink stderr: - # for C/C++/ObjectiveC it's useless - # for FORTRAN/Java it's an error - COMPREPLY=( $(compgen -W "$($cc --help 2>/dev/null | tr '\t' ' ' |\ - command sed -e '/^ *-/!d' -e 's/ *-\([^][ <>]*\).*/-\1/')" \ - -- "$cur") ) - [[ $COMPREPLY == *= ]] && compopt -o nospace - else + argument=$cur + prefix="" + # sample: -fsanitize= + elif [[ "$cur" == "=" && $prev == -* ]]; then + argument=$prev$cur + prefix=$prev$cur + # sample: -fsanitize=add + elif [[ "$prev" == "=" && $prev2 == -* ]]; then + argument=$prev2$prev$cur + prefix=$prev2$prev + # sample: --param lto- + elif [[ "$prev" == --param ]]; then + argument="$prev $cur" + prefix="$prev " + fi + + if [[ -z $argument ]]; then _filedir + else + # In situation like '-fsanitize=add' $cur is equal to last token. + # Thus we need to strip the beginning of suggested option. + prefix_length=$((${#prefix}+1)) + local flags=$($1 --completion="$argument" | cut -c $prefix_length-) + [[ "${flags}" == "=*" ]] && compopt -o nospace 2>/dev/null + COMPREPLY=( $(compgen -W "$flags" -- "") ) fi } && complete -F _gcc gcc{,-5,-6,-7,-8} g++{,-5,-6,-7,-8} g77 g95 \ diff --git a/completions/gprof b/completions/gprof index d1f4a4a3..40a74820 100644 --- a/completions/gprof +++ b/completions/gprof @@ -44,15 +44,7 @@ _gprof() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $(compgen -W '--annotated-source --brief --exec-counts - --file-info --directory-path --no-annotated-source --print-path - --flat-profile --no-flat-profile --graph --no-graph --table-length= - --separate-files --no-exec-counts --function-ordering - --file-ordering --traditional --width= --all-lines --demangle - --no-demangle --no-static --static-call-graph - --ignore-non-functions -k --line --min-count= --time= --no-time= - --external-symbol-table= --display-unused-functions --debug --help - --file-format= --sum --version' -- "$cur") ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/gssdp-discover b/completions/gssdp-discover new file mode 100644 index 00000000..f0fa6955 --- /dev/null +++ b/completions/gssdp-discover @@ -0,0 +1,31 @@ +# bash completion for gssdp-discover -*- shell-script -*- + +_gssdp_discover() +{ + local cur prev words cword split + _init_completion -s || return + + case $prev in + --help|--target|--timeout|--rescan-interval|-[htnr]) + return + ;; + --interface|-i) + _available_interfaces -a + return + ;; + --message-type|-m) + local types=$($1 --help 2>&1 | \ + command sed -ne 's/^.*--message-type=.*(\([^)]*\))$/\1/p') + COMPREPLY=( $(IFS+=,; compgen -W "$types" -- "$cur") ) + return + ;; + esac + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + fi +} && +complete -F _gssdp_discover gssdp-discover + +# ex: filetype=sh diff --git a/completions/iconv b/completions/iconv index 2fb1c92d..372c525b 100644 --- a/completions/iconv +++ b/completions/iconv @@ -2,7 +2,7 @@ _iconv_charsets() { - COMPREPLY+=( $(compgen -W '$(${1:-iconv} -l | \ + COMPREPLY+=( $(compgen -X ... -W '$(${1:-iconv} -l | \ command sed -e "s@/*\$@@" -e "s/[,()]//g")' -- "$cur") ) } diff --git a/completions/influx b/completions/influx new file mode 100644 index 00000000..bbedf10f --- /dev/null +++ b/completions/influx @@ -0,0 +1,32 @@ +# bash completion for influx(8) -*- shell-script -*- + +_influx() +{ + local cur prev words cword + _init_completion || return + + case $prev in + -version|-port|-database|-password|-username|-execute|-pps) + return + ;; + -host) + _known_hosts_real -- "$cur" + return + ;; + -format|-precision|-consistency) + local args=$($1 --help 2>&1 | awk "\$1 == \"$prev\" { print \$2 }") + COMPREPLY=( $(IFS+="\"'|"; compgen -W "$args" -- "$cur") ) + return + ;; + -import|-path) + _filedir + return + ;; + esac + + [[ "$cur" == -* ]] && + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) +} && +complete -F _influx influx + +# ex: filetype=sh diff --git a/completions/ip b/completions/ip index 372d2d85..f7e6e7c2 100644 --- a/completions/ip +++ b/completions/ip @@ -49,7 +49,7 @@ _ip() return ;; *) - COMPREPLY=( $(compgen -W "help $(ip help 2>&1 | command sed -e \ + COMPREPLY=( $(compgen -W "help $($1 help 2>&1 | command sed -e \ '/OBJECT := /,/}/!d' -e \ 's/.*{//' -e \ 's/}.*//' -e \ diff --git a/completions/ipv6calc b/completions/ipv6calc index f001999a..6a5771ef 100644 --- a/completions/ipv6calc +++ b/completions/ipv6calc @@ -28,13 +28,8 @@ _ipv6calc() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '--help --debug --quiet --in --out --action - --examples --showinfo --show_types --machine_readable --db-geoip - --db-geoip-default --db-ip2location-ipv4 --db-ip2location-ipv6 - --lowercase --uppercase --printprefix --printsuffix --maskprefix - --masksuffix --printstart --printend --printcompressed - --printuncompressed --printfulluncompressed --printmirrored' \ - -- "$cur") ) + COMPREPLY=( $(compgen -W '$("$1" -h 2>&1 | + command sed -e "s/[][]//g" | _parse_help -)' -- "$cur") ) fi } && diff --git a/completions/java b/completions/java index 3ca65869..89d207d2 100644 --- a/completions/java +++ b/completions/java @@ -64,7 +64,12 @@ _java_classes() if type zipinfo &>/dev/null; then COMPREPLY+=( $(zipinfo -1 "$i" "$cur*" 2>/dev/null | \ command grep '^[^$]*\.class$') ) - else + elif type unzip &>/dev/null; then + # Last column, between entries consisting entirely of dashes + COMPREPLY+=( $(unzip -lq "$i" "$cur*" 2>/dev/null | \ + awk '$NF ~ /^-+$/ { flag=!flag; next }; + flag && $NF ~ /^[^$]*\.class/ { print $NF }') ) + elif type jar &>/dev/null; then COMPREPLY+=( $(jar tf "$i" "$cur" | \ command grep '^[^$]*\.class$') ) fi diff --git a/completions/lintian b/completions/lintian index fbf54f96..d62d8373 100644 --- a/completions/lintian +++ b/completions/lintian @@ -149,15 +149,22 @@ _lintian_info() _init_completion || return case "$prev" in + --help|--profile) + return + ;; -t|--tags) _lintian_tags - return 0 + return + ;; + --include-dir) + _filedir -d + return ;; esac case "$cur" in --*) - COMPREPLY=($(compgen -W "--annotate --help --tags" -- "$cur")) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) ;; *) _filedir diff --git a/completions/lvm b/completions/lvm index 63048aeb..712838c8 100644 --- a/completions/lvm +++ b/completions/lvm @@ -81,9 +81,7 @@ _pvscan() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '--debug --exported --novolumegroup --help - --ignorelockingfailure --partial --short --uuid --verbose - --version' -- "$cur") ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) fi } && complete -F _pvscan pvscan @@ -201,9 +199,7 @@ _pvmove() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '--abort --autobackup --background --debug - --force --help --interval --test --verbose --version --name' \ - -- "$cur") ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_physicalvolumes fi @@ -294,10 +290,7 @@ _vgchange() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '--autobackup --alloc --partial --debug - --help --ignorelockingfailure --test --uuid --verbose --version - --available --resizeable --logicalvolume --addtag --deltag' \ - -- "$cur") ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else _lvm_volumegroups fi @@ -325,9 +318,7 @@ _vgcreate() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '--autobackup --addtag --alloc --debug --help - --maxlogicalvolumes --metadatatype --maxphysicalvolumes - --physicalextentsize --test --verbose --version' -- "$cur") ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else local args _lvm_count_args '@(-A|--autobackup|-M|--metadatatype|-s|--physicalextentsize)' @@ -569,8 +560,7 @@ _vgsplit() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '--autobackup --debug --help --list - --metadatatype --test --verbose --version' -- "$cur") ) + COMPREPLY=( $(compgen -W '$(_parse_usage "$1" --help)' -- "$cur") ) else local args _lvm_count_args '@(-A|--autobackup|-M|--metadatatype)' diff --git a/completions/lz4 b/completions/lz4 index db8198f8..76c24bfa 100644 --- a/completions/lz4 +++ b/completions/lz4 @@ -13,9 +13,8 @@ _lz4() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W \ - '$(_parse_help "$1" -h | command sed -e "/#/d") -B{4..7} -i{1..9}' \ - -- "$cur") ) + COMPREPLY=( $(compgen -X '-*#*' -W \ + '$(_parse_help "$1" -h) -B{4..7} -i{1..9}' -- "$cur") ) return fi diff --git a/completions/makepkg b/completions/makepkg index 98edda8f..71d4f76d 100644 --- a/completions/makepkg +++ b/completions/makepkg @@ -15,7 +15,8 @@ _makepkg_slackware() if [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W \ - '$1 | command sed -e "s/^options://" | _parse_help -' -- "$cur") ) + '$($1 | command sed -e "s/^options://" | _parse_help -)' \ + -- "$cur") ) return fi diff --git a/completions/man b/completions/man index 02bd4f70..e5a47361 100644 --- a/completions/man +++ b/completions/man @@ -40,7 +40,8 @@ _man() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $(compgen -W '$(_parse_help "$1" -h)' -- "$cur") ) + local opts=$(_parse_help "$1" -h) + COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace return fi diff --git a/completions/op b/completions/op index b99bd2de..ddbe4c73 100644 --- a/completions/op +++ b/completions/op @@ -2,7 +2,7 @@ _op_commands() { - "$@" --help | + "$@" --help 2>/dev/null | awk "/^(Available |Sub)commands/{flag=1;next}/^ /&&flag{print \$1}" } diff --git a/completions/perl b/completions/perl index 98ddb9eb..bf117970 100644 --- a/completions/perl +++ b/completions/perl @@ -27,48 +27,63 @@ _perl() optPrefix=-P$prev optSuffix=-S/ prefix=$prev - fi - case $prev in - -*[DeEiFl]) - return - ;; - -*[Ix]) - local IFS=$'\n' - compopt -o filenames - COMPREPLY=( $(compgen -d $optPrefix $optSuffix -- "$cur") ) - return - ;; - -*[mM]) - temp="${cur#-}" - prefix+="${cur%$temp}" - cur="$temp" - _perl_helper modules $1 - return - ;; - -*V) - if [[ $cur == :* ]]; then - temp="${cur##+(:)}" - prefix+="${cur%$temp}" + case $prev in + -*[DeEiFl]) + return + ;; + -*[Ix]) local IFS=$'\n' - COMPREPLY=( $(compgen -P "$prefix" -W \ - '$($1 -MConfig -e "print join \"\\n\", - keys %Config::Config" 2>/dev/null)' -- "$temp") ) - __ltrim_colon_completions "$prefix$temp" - fi - return - ;; - -*d|-*dt) - if [[ $cur == :* ]]; then - temp="${cur#:}" - prefix="$prefix${cur%$temp}" - cur="Devel::$temp" + compopt -o filenames + COMPREPLY=( $(compgen -d $optPrefix $optSuffix -- "$cur") ) + return + ;; + -*[mM]) + temp="${cur#-}" + prefix+="${cur%$temp}" + cur="$temp" _perl_helper modules $1 - fi - ;; - esac + return + ;; + -*V) + if [[ $cur == :* ]]; then + temp="${cur##+(:)}" + prefix+="${cur%$temp}" + local IFS=$'\n' + COMPREPLY=( $(compgen -P "$prefix" -W \ + '$($1 -MConfig -e "print join \"\\n\", + keys %Config::Config" 2>/dev/null)' -- "$temp") ) + __ltrim_colon_completions "$prefix$temp" + fi + return + ;; + -*d|-*dt) + if [[ $cur == :* ]]; then + temp="${cur#:}" + prefix="$prefix${cur%$temp}" + cur="Devel::$temp" + _perl_helper modules $1 + fi + ;; + esac - if [[ "$cur" == -* ]]; then + # Unlike other perl options, having a space between the `-e' and + # `-E' options and their arguments, e.g. `perl -e "exit 2"', is + # valid syntax. However, the argument is neither a filename nor a + # directory, but one line of perl program, thus do not suggest + # _filedir completion. + elif [[ "$prev" == -e ]] || [[ "$prev" == -E ]]; then + return + + # Likewise, `-I' also accepts a space between option and argument + # and it takes a directory as value. + elif [[ "$prev" == -I ]]; then + local IFS=$'\n' + compopt -o filenames + COMPREPLY=( $(compgen -d $optPrefix $optSuffix -- "$cur") ) + return + + elif [[ "$cur" == -* ]]; then COMPREPLY=( $(compgen -W '-C -s -T -u -U -W -X -h -v -V -c -w -d -D -p -n -a -F -l -0 -I -m -M -P -S -x -i -e' -- "$cur") ) else diff --git a/completions/perltidy b/completions/perltidy index ce93b2a5..91bd5094 100644 --- a/completions/perltidy +++ b/completions/perltidy @@ -47,7 +47,7 @@ _perltidy() COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else - _filedir 'p[lm]' + _filedir 'p[lm]|t' fi } && complete -F _perltidy perltidy diff --git a/completions/pgrep b/completions/pgrep index e45d7d7f..1c507a42 100644 --- a/completions/pgrep +++ b/completions/pgrep @@ -36,7 +36,7 @@ _pgrep() esac if [[ $cur == -* ]]; then - local help='$(_parse_help "$1")' + local help=$(_parse_help "$1") [[ $help ]] || help='$("$1" --usage 2>&1 | command sed -e "s/\[-signal\]//" -e "s/\[-SIGNAL\]//" | _parse_usage -)' diff --git a/completions/pkg-get b/completions/pkg-get index ea300b8b..2f251338 100644 --- a/completions/pkg-get +++ b/completions/pkg-get @@ -36,7 +36,7 @@ _pkg_get() return 1 fi - i=${#COMP_WORDS[*]} + local i=${#COMP_WORDS[*]} while [[ $i -gt 0 ]]; do if [[ "${COMP_WORDS[--i]}" == -s ]]; then url="${COMP_WORDS[$((i+1))]}" diff --git a/completions/pkg_delete b/completions/pkg_delete index b1a93c20..942647d0 100644 --- a/completions/pkg_delete +++ b/completions/pkg_delete @@ -1,6 +1,4 @@ -# bash completion for FreeBSD package management tools -*- shell-script -*- - -[[ $OSTYPE == *freebsd* ]] || return 1 +# bash completion for *BSD package management tools -*- shell-script -*- _pkg_delete() { diff --git a/completions/pkgutil b/completions/pkgutil index bafb9aab..febc2135 100644 --- a/completions/pkgutil +++ b/completions/pkgutil @@ -21,7 +21,7 @@ _pkgutil() declare -a configuration_files=("/opt/csw/etc/pkgutil.conf" "/etc/opt/csw/pkgutil.conf") declare -a catalog_files=() - i=$cword + local i=$cword while [[ $((i--)) -gt 1 ]]; do if [[ "${words[$i]}" == -@(t|-temp) ]]; then local url="${words[$((i+1))]}" diff --git a/completions/postfix b/completions/postfix index 89ff4dd4..eda9ad46 100644 --- a/completions/postfix +++ b/completions/postfix @@ -17,6 +17,8 @@ _postfix() esac if [[ $cur == -* ]]; then + # TODO: doesn't seem to work; the usage message doesn't get output + # if we try to grep it, it's only output on the console? COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) return fi diff --git a/completions/pwck b/completions/pwck index 7723f66d..cc5f2e42 100644 --- a/completions/pwck +++ b/completions/pwck @@ -6,7 +6,8 @@ _pwck() _init_completion || return if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '$(_parse_usage "$1")' -- "$cur") ) + local opts=$(_parse_help "$1") + COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") ) return fi diff --git a/completions/ri b/completions/ri index 8f331419..7d1e7cf9 100644 --- a/completions/ri +++ b/completions/ri @@ -23,7 +23,7 @@ _ri_get_methods() # older versions of ri didn't distinguish between class/module and # instance methods COMPREPLY+=( \ - "$(ruby -W0 $ri_path "${classes[@]}" | ruby -ane \ + "$(ruby -W0 $ri_path "${classes[@]}" 2>/dev/null | ruby -ane \ 'if /^-/.../^-/ and ! /^-/ and ! /^ +(class|module): / then \ print $_.split(/, |,$| +/).grep(/^[^\[]*$/).join("\n"); \ end' | sort -u)" ) diff --git a/completions/screen b/completions/screen index 3b9fb272..17642863 100644 --- a/completions/screen +++ b/completions/screen @@ -25,6 +25,34 @@ _screen() local cur prev words cword _init_completion || return + if ((cword == 1)); then + if [[ $cur == /dev* ]]; then + COMPREPLY=( $(compgen -W "$(shopt -s nullglob; printf '%s\n' \ + /dev/serial/by-id/* /dev/ttyUSB* /dev/ttyACM* 2>/dev/null)" \ + -- "$cur") ) + return + fi + if [[ $cur == //* ]]; then + COMPREPLY=( $(compgen -W '//telnet' -- "$cur") ) + return + fi + fi + + case ${words[1]} in + /dev*) + if ((cword == 2)); then + COMPREPLY=( $(compgen -W '110 300 600 1200 2400 4800 9600 \ + 14400 19200 38400 57600 115200 128000 256000' -- "$cur") ) + # TODO more, comma separated options + fi + return + ;; + //telnet) + ((cword == 2)) && _known_hosts_real -- "$cur" + return + ;; + esac + if ((cword > 2)); then case ${words[cword-2]} in -*[dD]) @@ -84,9 +112,7 @@ _screen() esac if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '-a -A -c -d -D -e -f -fn -fa -h -i -ln -list - -L -m -O -p -q -r -R -s -S -t -T -U -v -wipe -x -X --help - --version' -- "$cur") ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) fi } && complete -F _screen screen diff --git a/completions/shellcheck b/completions/shellcheck index 197c1811..4a40c8f9 100644 --- a/completions/shellcheck +++ b/completions/shellcheck @@ -16,7 +16,7 @@ _shellcheck() --version|-!(-*)V*) return ;; - --exclude|-!(-*)e) + --exclude|--include|-!(-*)[ei]) return ;; --format|-!(-*)f) @@ -34,6 +34,18 @@ _shellcheck() _shellcheck_optarg "$1" --shell return ;; + --enable|-!(-*)o) + COMPREPLY=( $(compgen -W 'all' -- "$cur") ) # TODO others? + return + ;; + --source-path|-!(-*)P) + _filedir -d + COMPREPLY+=( $(compgen -W 'SCRIPTDIR' -- "$cur") ) + return + ;; + --wiki-link-count|-!(-*)W) + return + ;; esac $split && return diff --git a/completions/smartctl b/completions/smartctl index c34ca598..ecef0b99 100644 --- a/completions/smartctl +++ b/completions/smartctl @@ -151,12 +151,7 @@ _smartctl() $split && return if [[ "$cur" == -* ]]; then - COMPREPLY=( $(compgen -W '--help --version --info --all --xall - --scan --scan-open --quietmode= --device= --tolerance= --badsum= - --report= --nocheck= --smart= --offlineauto= --saveauto= --health - --capabilities --attributes --log= --vendorattribute= - --firmwarebug= --presets= --drivedb= --test= --captive --abort' \ - -- "$cur") ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace else cur=${cur:=/dev/} diff --git a/completions/ssh b/completions/ssh index aaa10346..ecbd5896 100644 --- a/completions/ssh +++ b/completions/ssh @@ -3,7 +3,7 @@ _ssh_queries() { COMPREPLY+=( $(compgen -W \ - "cipher cipher-auth mac kex key key-cert key-plain protocol-version" \ + "cipher cipher-auth mac kex key key-cert key-plain protocol-version sig" \ -- "$cur") ) } @@ -34,7 +34,7 @@ _ssh_options() local opts=( AddKeysToAgent AddressFamily BatchMode BindAddress CanonicalDomains CanonicalizeFallbackLocal CanonicalizeHostname CanonicalizeMaxDots - CanonicalizePermittedCNAMEs CertificateFile + CanonicalizePermittedCNAMEs CASignatureAlgorithms CertificateFile ChallengeResponseAuthentication CheckHostIP Ciphers ClearAllForwardings Compression ConnectionAttempts ConnectTimeout ControlMaster ControlPath ControlPersist DynamicForward EnableSSHKeysign EscapeChar @@ -90,10 +90,10 @@ _ssh_suboption() gssapidelegatecredentials|gssapirenewalforcesrekey|gssapitrustdns|\ hashknownhosts|hostbasedauthentication|identitiesonly|\ kbdinteractiveauthentication|kbdinteractivedevices|\ - nohostauthenticationforlocalhost|passwordauthentication|\ + nohostauthenticationforlocalhost|passwordauthentication|permitlocalcommand|\ proxyusefdpass|pubkeyauthentication|rhostsrsaauthentication|\ - rsaauthentication|stricthostkeychecking|streamlocalbindunlink|\ - tcpkeepalive|useprivilegedport|verifyhostkeydns|visualhostkey) + rsaauthentication|streamlocalbindunlink|\ + tcpkeepalive|useprivilegedport|visualhostkey) COMPREPLY=( $(compgen -W 'yes no' -- "$cur") ) ;; addkeystoagent) @@ -108,15 +108,24 @@ _ssh_suboption() canonicalizehostname) COMPREPLY=( $(compgen -W 'yes no always' -- "$cur") ) ;; - *file|identityagent|include) + identityfile) + _ssh_identityfile + ;; + *file|identityagent|include|controlpath|revokedhostkeys|xauthlocation) _filedir ;; + casignaturealgorithms) + COMPREPLY=( $(compgen -W '$(_ssh_query "$2" sig)' -- "$cur") ) + ;; cipher) COMPREPLY=( $(compgen -W 'blowfish des 3des' -- "$cur") ) ;; ciphers) _ssh_ciphers "$2" ;; + controlmaster) + COMPREPLY=( $(compgen -W 'yes ask auto autoask no' -- "$cur") ) + ;; compressionlevel) COMPREPLY=( $(compgen -W '{1..9}' -- "$cur") ) ;; @@ -133,9 +142,15 @@ _ssh_suboption() kexalgorithms) COMPREPLY=( $(compgen -W '$(_ssh_query "$2" kex)' -- "$cur") ) ;; + loglevel) + COMPREPLY=( $(compgen -W 'QUIET FATAL ERROR INFO VERBOSE DEBUG{,1,2,3}' -- "$cur") ) + ;; macs) _ssh_macs "$2" ;; + pkcs11provider) + _filedir so + ;; preferredauthentications) COMPREPLY=( $(compgen -W 'gssapi-with-mic host-based publickey keyboard-interactive password' -- "$cur") ) @@ -150,12 +165,18 @@ _ssh_suboption() proxyjump) _known_hosts_real -a -F "$configfile" -- "$cur" ;; + proxycommand|remotecommand|localcommand) + COMPREPLY=( $(compgen -c -- "$cur") ) + ;; pubkeyacceptedkeytypes) COMPREPLY=( $(compgen -W '$(_ssh_query "$2" key)' -- "$cur") ) ;; requesttty) COMPREPLY=( $(compgen -W 'no yes force auto' -- "$cur") ) ;; + stricthostkeychecking) + COMPREPLY=( $(compgen -W 'accept-new ask no off' -- "$cur") ) + ;; syslogfacility) COMPREPLY=( $(compgen -W 'DAEMON USER AUTH LOCAL{0..7}' -- "$cur") ) ;; @@ -163,7 +184,7 @@ _ssh_suboption() COMPREPLY=( $(compgen -W 'yes no point-to-point ethernet' \ -- "$cur") ) ;; - updatehostkeys) + updatehostkeys|verifyhostkeydns) COMPREPLY=( $(compgen -W 'yes no ask' -- "$cur") ) ;; esac @@ -202,6 +223,17 @@ _ssh_configfile() done } +# With $1 set, look for public key files, else private +_ssh_identityfile() +{ + [[ -z $cur && -d ~/.ssh ]] && cur=~/.ssh/id + _filedir + if (( ${#COMPREPLY[@]} > 0 )); then + COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' \ + -X "${1:+!}*.pub" -- "$cur") ) + fi +} + _ssh() { local cur prev words cword @@ -234,10 +266,14 @@ _ssh() -*[DeLpRW]) return ;; - -*[EFiS]) + -*[EFS]) _filedir return ;; + -*i) + _ssh_identityfile + return + ;; -*I) _filedir so return @@ -255,7 +291,7 @@ _ssh() return ;; -*O) - COMPREPLY=( $(compgen -W 'check forward exit stop' -- "$cur") ) + COMPREPLY=( $(compgen -W 'check forward cancel exit stop' -- "$cur") ) return ;; -*o) @@ -317,14 +353,22 @@ _sftp() -*[BDlPRs]) return ;; - -*[bFi]) + -*[bF]) _filedir return ;; + -*i) + _ssh_identityfile + return + ;; -*c) _ssh_ciphers return ;; + -*J) + _known_hosts_real -a -F "$configfile" -- "$cur" + return + ;; -*o) _ssh_options return @@ -442,11 +486,20 @@ _scp() COMPREPLY=( "${COMPREPLY[@]/%/ }" ) return ;; - -*[Fi]) + -*F) _filedir compopt +o nospace return ;; + -*i) + _ssh_identityfile + compopt +o nospace + return + ;; + -*J) + _known_hosts_real -a -F "$configfile" -- "$cur" + return + ;; -*[lP]) return ;; diff --git a/completions/ssh-add b/completions/ssh-add index d9157893..f35c7d00 100644 --- a/completions/ssh-add +++ b/completions/ssh-add @@ -6,7 +6,15 @@ _ssh_add() _init_completion || return case $prev in - -*[tE]) + -*E) + COMPREPLY=( $(compgen -W 'md5 sha256' -- "$cur") ) + return + ;; + -*t) + return + ;; + -*T) + _filedir return ;; -*[se]) diff --git a/completions/ssh-copy-id b/completions/ssh-copy-id index cb4cf920..ebfc46e6 100644 --- a/completions/ssh-copy-id +++ b/completions/ssh-copy-id @@ -9,7 +9,7 @@ _ssh_copy_id() case $prev in -i) - _filedir pub + _xfunc ssh _ssh_identityfile pub return ;; -p) diff --git a/completions/ssh-keygen b/completions/ssh-keygen index 5c449fc0..36fa2cad 100644 --- a/completions/ssh-keygen +++ b/completions/ssh-keygen @@ -42,7 +42,12 @@ _ssh_keygen() return ;; -*t) - COMPREPLY=( $(compgen -W 'dsa ecdsa ed25519 rsa rsa1' -- "$cur") ) + local protocols=$(_xfunc ssh _ssh_query "$1" protocol-version) + local types='dsa ecdsa ed25519 rsa' + if [[ $protocols == *1* ]]; then + types+=' rsa1' + fi + COMPREPLY=( $(compgen -W "$types" -- "$cur") ) return ;; esac diff --git a/completions/sysctl b/completions/sysctl index e683977b..6eb3f391 100644 --- a/completions/sysctl +++ b/completions/sysctl @@ -22,7 +22,7 @@ _sysctl() local suffix= [[ $prev == -w ]] && suffix="=" COMPREPLY=( $(compgen -S "$suffix" -W \ - "$(PATH="$PATH:/sbin" sysctl -N -a 2>/dev/null)" -- "$cur") ) + "$(PATH="$PATH:/sbin" $1 -N -a 2>/dev/null)" -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && diff --git a/completions/tar b/completions/tar index 2ed98e78..fda739c4 100644 --- a/completions/tar +++ b/completions/tar @@ -398,7 +398,7 @@ __tar_extract_like_mode() __tar_try_list_archive() { - local tarball tarbin untar + local tarball tarbin untar i __tar_extract_like_mode || return 1 @@ -410,14 +410,19 @@ __tar_try_list_archive() untar="tf" shift - read tarball <<<"$(printf -- '%s\n' "$@" \ - | command sed -n "/^.\{1,\}$regex\$/p")" + for i in "$@"; do + if [[ $i == *.$ext ]]; then + tarball=$i + break + fi + done if [[ -n "$tarball" ]]; then local IFS=$'\n' COMPREPLY=($(compgen -o filenames -W "$( + $tarbin $untar "$tarball" 2>/dev/null | while read line; do printf "%q\n" "$(printf %q"\n" "$line")" - done <<<"$($tarbin $untar "$tarball" 2>/dev/null)" + done )" -- "$(printf "%q\n" "$cur")")) return 0 fi @@ -435,7 +440,6 @@ __tar_detect_ext() { local tars='@(@(tar|gem|spkg)?(.@(Z|[bgx]z|bz2|lz?(ma|o)|zst))|t@([abglx]z|b?(z)2|zst))' ext="$tars" - regex='\(\(tar\|gem\|spkg\)\(\.\(Z\|[bgx]z\|bz2\|lz\(ma\|o\)\?\|zst\)\)\?\|t\([abglx]z\|bz\?2\|zst\)\)' case "$tar_mode_arg" in --*) @@ -456,15 +460,12 @@ __tar_detect_ext() ;; *[Zz]*f) ext='@(@(t?(ar.)|gem.|spkg.)@(gz|Z)|taz)' - regex='\(\(t\(ar\.\)\?\|gem\.\|spkg\.\)\(gz\|Z\)\|taz\)' ;; *[jy]*f) ext='@(@(t?(ar.)|gem.)bz?(2)|spkg|tb2)' - regex='\(\(t\(ar\.\)\?\|gem\.\)bz2\?\|spkg\|tb2\)' ;; *[J]*f) ext='@(@(tar|gem|spkg).@(lzma|xz)|t[lx]z)' - regex='\(\(tar\|gem\|spkg\)\.\(lzma\|xz\)\|t[lx]z\)' ;; esac } @@ -499,7 +500,7 @@ _gtar() __tar_preparse_cmdline "${words[@]}" - local ext regex tar untar + local ext tar untar __tar_detect_ext @@ -674,7 +675,7 @@ _posix_tar() __tar_preparse_cmdline "${words[@]}" - local ext regex tar untar + local ext tar untar __tar_detect_ext diff --git a/completions/timeout b/completions/timeout index b5851baa..bcc9a865 100644 --- a/completions/timeout +++ b/completions/timeout @@ -29,7 +29,8 @@ _timeout() $split && return if [[ $cur == -* ]]; then - COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) + local opts=$(_parse_help "$1") + COMPREPLY=( $(compgen -W '${opts:-$(_parse_usage "$1")}' -- "$cur") ) [[ $COMPREPLY == *= ]] && compopt -o nospace fi } && diff --git a/completions/tipc b/completions/tipc index d85f5e9c..830040d9 100644 --- a/completions/tipc +++ b/completions/tipc @@ -65,10 +65,9 @@ _tipc_link() { # awk drops link state and last trailing : local links=$(tipc link list 2>/dev/null | \ awk '{print substr($1, 0, length($1))}') - if [[ $filter == "peers" ]]; then - links=$(command sed '/broadcast-link/d' <<<"$links") - fi - COMPREPLY=( $(compgen -W '$links' -- $cur) ) + local -a exclude + [[ $filter == peers ]] && exclude=( -X broadcast-link ) + COMPREPLY=( $(compgen "${exclude[@]}" -W '$links' -- $cur) ) fi } diff --git a/completions/tox b/completions/tox index a6418aca..7dcddc54 100644 --- a/completions/tox +++ b/completions/tox @@ -5,6 +5,12 @@ _tox() local cur prev words cword _init_completion || return + # Complete defaults following a "--" + if [[ "${words[*]:0:cword} " == *\ --\ * && $cur != -- ]]; then + compopt -o bashdefault -o default + return + fi + case $prev in --help|--version|--num|--index-url|--hashseed|--force-dep|-!(-*)[hni]) return @@ -20,15 +26,18 @@ _tox() -!(-*)e) local envs=$( { "$1" --listenvs-all || "$1" --listenvs; } 2>/dev/null ) + [[ $envs ]] || envs=$( + command sed -e 's/,/ /g' -ne 's/^envlist[[:space:]]*=//p' \ + tox.ini 2>/dev/null) local prefix=""; [[ $cur == *,* ]] && prefix="${cur%,*}," - COMPREPLY=( $(compgen -W "$envs ALL" -- "${cur##*,}") ) + COMPREPLY=( $(compgen -X '*[{}]*' -W "$envs ALL" -- "${cur##*,}") ) [[ ${#COMPREPLY[@]} -eq 1 ]] && COMPREPLY=( ${COMPREPLY/#/$prefix} ) return ;; esac if [[ $cur == -* ]]; then - COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1") --' -- "$cur") ) return fi } && diff --git a/completions/unrar b/completions/unrar index 5381876f..959a5c9c 100644 --- a/completions/unrar +++ b/completions/unrar @@ -13,7 +13,7 @@ _unrar() if [[ $cword -eq 1 ]]; then COMPREPLY=( $(compgen -W 'e l lb lt p t v vb vt x' -- "$cur") ) else - _filedir rar + _filedir '@(rar|exe)' fi fi diff --git a/completions/update-alternatives b/completions/update-alternatives index e9ba476b..17b687a7 100644 --- a/completions/update-alternatives +++ b/completions/update-alternatives @@ -82,9 +82,7 @@ _update_alternatives() _installed_alternatives ;; *) - COMPREPLY=( $(compgen -W '--verbose --quiet --help --version - --altdir --admindir --install --remove --auto --display - --config --set' -- "$cur") ) + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) esac } && complete -F _update_alternatives update-alternatives alternatives diff --git a/completions/update-rc.d b/completions/update-rc.d index 384b8dd4..31cd820b 100644 --- a/completions/update-rc.d +++ b/completions/update-rc.d @@ -7,7 +7,7 @@ _update_rc_d() local cur prev words cword _init_completion || return - local sysvdir services options valid_options + local sysvdir services options [[ -d /etc/rc.d/init.d ]] && sysvdir=/etc/rc.d/init.d \ || sysvdir=/etc/init.d @@ -17,13 +17,8 @@ _update_rc_d() options=( -f -n ) if [[ $cword -eq 1 || "$prev" == -* ]]; then - valid_options=( $(\ - tr " " "\n" <<<"${words[*]} ${options[*]}" \ - | command sed -ne "/$(command sed "s/ /\\|/g" <<<"${options[*]}")/p" \ - | sort | uniq -u \ - ) ) - COMPREPLY=( $(compgen -W '${options[@]} ${services[@]}' \ - -X '$(tr " " "|" <<<${words[@]})' -- "$cur") ) + COMPREPLY=( $(compgen -W '${options[@]} ${services[@]}' \ + -X '$(tr " " "|" <<<${words[@]})' -- "$cur") ) elif [[ "$prev" == ?($(tr " " "|" <<<"${services[*]}")) ]]; then COMPREPLY=( $(compgen -W 'remove defaults start stop' -- "$cur") ) elif [[ "$prev" == defaults && "$cur" == [0-9] ]]; then diff --git a/completions/valgrind b/completions/valgrind index 2df09707..01ca62c5 100644 --- a/completions/valgrind +++ b/completions/valgrind @@ -32,7 +32,8 @@ _valgrind() # Tools seem to be named e.g. like memcheck-amd64-linux from which # we want to grab memcheck. COMPREPLY=( $(compgen -W '$( - for f in /usr{,/local}/lib{,64,exec}/valgrind/*; do + for f in /usr{,/local}/lib{,64,exec}{/*-linux-gnu,}/valgrind/* + do [[ $f != *.so && -x $f && $f =~ ^.*/(.*)-[^-]+-[^-]+ ]] && printf "%s\n" "${BASH_REMATCH[1]}" done)' -- "$cur") ) diff --git a/completions/wine b/completions/wine index f871e744..dab45ae4 100644 --- a/completions/wine +++ b/completions/wine @@ -15,6 +15,6 @@ _wine() _filedir fi } && -complete -F _wine wine +complete -F _wine wine wine-development wine-stable # ex: filetype=sh diff --git a/completions/xsltproc b/completions/xsltproc index 241de67b..dbe68c45 100644 --- a/completions/xsltproc +++ b/completions/xsltproc @@ -16,8 +16,8 @@ _xsltproc() ;; --encoding) # some aliases removed - COMPREPLY=( $(compgen -W "$(iconv -l | command sed -e '/^UTF[1378]/d' \ - -e '/^ISO[0-9_]/d' -e '/^8859/d' -e 's/\/.*//')" -- "$cur") ) + COMPREPLY=( $(compgen -X '@(UTF[1378]|8859|ISO[0-9_])*' \ + -W "$(iconv -l | command sed -e 's/\/.*//')" -- "$cur") ) return ;; --param|--stringparam) diff --git a/completions/xvfb-run b/completions/xvfb-run new file mode 100644 index 00000000..162c66ed --- /dev/null +++ b/completions/xvfb-run @@ -0,0 +1,36 @@ +# bash completion for xvfb-run -*- shell-script -*- + +_xvfb_run() +{ + local cur prev words cword split + _init_completion -s || return + + local i + for (( i=1; i <= COMP_CWORD; i++ )); do + if [[ ${COMP_WORDS[i]} != -* ]]; then + _command_offset $i + return + fi + [[ ${COMP_WORDS[i]} == -!(-*)[npsef] ]] && ((i++)) + done + + case $prev in + --help|--server-num|--xauth-protocol|--server-args|-!(-*)[hnps]) + return + ;; + --error-file|--auth-file|-!(-*)[ef]) + _filedir + return + ;; + esac + + $split && return + + if [[ "$cur" == -* ]]; then + COMPREPLY=( $(compgen -W '$(_parse_help "$1")' -- "$cur") ) + [[ $COMPREPLY == *= ]] && compopt -o nospace + fi +} && +complete -F _xvfb_run xvfb-run + +# ex: filetype=sh -- cgit v1.2.1