summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2011-10-12 23:01:10 +0300
committerVille Skyttä <ville.skytta@iki.fi>2011-10-12 23:01:10 +0300
commit156656c16d4302d059221a06eb7c1bd460e41fe9 (patch)
tree87b9edeaab27b4d7a5ae70644a5b7803c3cc7c25
parentd3d6476f6c24cebb89e4712477e568dd5f5fbca8 (diff)
downloadbash-completion-156656c16d4302d059221a06eb7c1bd460e41fe9.tar.gz
Split/rename many completions into per-command files.
-rw-r--r--completions/Makefile.am149
-rw-r--r--completions/aclocal41
-rw-r--r--completions/alias26
-rw-r--r--completions/apt-cache80
-rw-r--r--completions/apt-get (renamed from completions/apt)73
-rw-r--r--completions/arping37
-rw-r--r--completions/arpspoof34
-rw-r--r--completions/autoconf71
-rw-r--r--completions/automake34
-rw-r--r--completions/autoreconf47
-rw-r--r--completions/autoscan40
-rw-r--r--completions/avctrl26
-rw-r--r--completions/badblocks38
-rw-r--r--completions/bash-builtins120
-rw-r--r--completions/bk (renamed from completions/bitkeeper)0
-rw-r--r--completions/bluez29
-rw-r--r--completions/btdownloadheadless.py (renamed from completions/bittorrent)0
-rw-r--r--completions/cancel18
-rw-r--r--completions/cfagent27
-rw-r--r--completions/cfrun (renamed from completions/cfengine)20
-rw-r--r--completions/chage32
-rw-r--r--completions/check_perms21
-rw-r--r--completions/chgrp46
-rw-r--r--completions/chown52
-rw-r--r--completions/chpasswd35
-rw-r--r--completions/cleanarch22
-rw-r--r--completions/complete56
-rw-r--r--completions/coreutils139
-rw-r--r--completions/dmesg33
-rw-r--r--completions/dnsspoof32
-rw-r--r--completions/dpkg106
-rw-r--r--completions/dpkg-source113
-rw-r--r--completions/dsniff193
-rw-r--r--completions/dumpdb24
-rw-r--r--completions/dumpe2fs34
-rw-r--r--completions/e2freefrag30
-rw-r--r--completions/e2fsprogs170
-rw-r--r--completions/e2label21
-rw-r--r--completions/ether-wake33
-rw-r--r--completions/export31
-rw-r--r--completions/faillog34
-rw-r--r--completions/fbgs45
-rw-r--r--completions/fbi38
-rw-r--r--completions/filefrag23
-rw-r--r--completions/filesnarf28
-rw-r--r--completions/find (renamed from completions/findutils)0
-rw-r--r--completions/freeciv-gtk2 (renamed from completions/freeciv)21
-rw-r--r--completions/freeciv-server28
-rw-r--r--completions/function28
-rw-r--r--completions/fusermount (renamed from completions/fuse)2
-rw-r--r--completions/genaliases21
-rw-r--r--completions/gendiff18
-rw-r--r--completions/gpasswd31
-rw-r--r--completions/groupadd33
-rw-r--r--completions/groupdel11
-rw-r--r--completions/groupmems32
-rw-r--r--completions/groupmod35
-rw-r--r--completions/growisofs (renamed from completions/dvd+rw-tools)2
-rw-r--r--completions/grpck23
-rw-r--r--completions/hid2hci21
-rw-r--r--completions/id24
-rw-r--r--completions/ifup (renamed from completions/ifupdown)0
-rw-r--r--completions/insmod (renamed from completions/module-init-tools)15
-rw-r--r--completions/invoke-rc.d45
-rw-r--r--completions/ionice63
-rw-r--r--completions/ip (renamed from completions/iproute2)2
-rw-r--r--completions/iscsiadm (renamed from completions/open-iscsi)0
-rw-r--r--completions/jarsigner62
-rw-r--r--completions/java223
-rw-r--r--completions/javaws40
-rw-r--r--completions/jps31
-rw-r--r--completions/kill24
-rw-r--r--completions/killall25
-rw-r--r--completions/kldload12
-rw-r--r--completions/kldunload21
-rw-r--r--completions/ktutil (renamed from completions/heimdal)2
-rw-r--r--completions/lastlog34
-rw-r--r--completions/lftp13
-rw-r--r--completions/lftpget20
-rw-r--r--completions/list_lists22
-rw-r--r--completions/look20
-rw-r--r--completions/lpq34
-rw-r--r--completions/lpr (renamed from completions/cups)36
-rw-r--r--completions/macof29
-rw-r--r--completions/mailman121
-rw-r--r--completions/mailmanctl24
-rw-r--r--completions/mdtool68
-rw-r--r--completions/mii-diag33
-rw-r--r--completions/mii-tool38
-rw-r--r--completions/mktemp35
-rw-r--r--completions/mmsitepass21
-rw-r--r--completions/monodevelop61
-rw-r--r--completions/munin-node98
-rw-r--r--completions/munin-node-configure39
-rw-r--r--completions/munin-run34
-rw-r--r--completions/munin-update33
-rw-r--r--completions/munindoc19
-rw-r--r--completions/net-tools114
-rw-r--r--completions/newgrp22
-rw-r--r--completions/newusers37
-rw-r--r--completions/pack20081
-rw-r--r--completions/passwd29
-rw-r--r--completions/pgrep44
-rw-r--r--completions/ping (renamed from completions/iputils)52
-rw-r--r--completions/pkg_delete (renamed from completions/pkg_install)0
-rw-r--r--completions/pm-hibernate18
-rw-r--r--completions/pm-is-supported19
-rw-r--r--completions/pm-powersave18
-rw-r--r--completions/pm-utils37
-rw-r--r--completions/portinstall37
-rw-r--r--completions/portupgrade30
-rw-r--r--completions/postcat48
-rw-r--r--completions/postconf47
-rw-r--r--completions/postfix188
-rw-r--r--completions/postmap49
-rw-r--r--completions/postsuper68
-rw-r--r--completions/procps129
-rw-r--r--completions/pwck23
-rw-r--r--completions/pwdx24
-rw-r--r--completions/qrunner24
-rw-r--r--completions/querybts41
-rw-r--r--completions/renice35
-rw-r--r--completions/reportbug34
-rw-r--r--completions/rmmod20
-rw-r--r--completions/route35
-rw-r--r--completions/rpm9
-rw-r--r--completions/shadow409
-rw-r--r--completions/slapt-get (renamed from completions/slapt)59
-rw-r--r--completions/slapt-src66
-rw-r--r--completions/ssh24
-rw-r--r--completions/ssh-copy-id31
-rw-r--r--completions/sshmitm23
-rw-r--r--completions/sshow28
-rw-r--r--completions/tcpkill28
-rw-r--r--completions/tcpnice28
-rw-r--r--completions/tracepath29
-rw-r--r--completions/tune2fs64
-rw-r--r--completions/unpack20054
-rw-r--r--completions/unshunt23
-rw-r--r--completions/update-rc.d (renamed from completions/sysv-rc)38
-rw-r--r--completions/urlsnarf28
-rw-r--r--completions/useradd51
-rw-r--r--completions/userdel23
-rw-r--r--completions/usermod50
-rw-r--r--completions/util-linux145
-rw-r--r--completions/vipw27
-rw-r--r--completions/watch59
-rw-r--r--completions/webmitm23
-rw-r--r--completions/xfreerdp (renamed from completions/freerdp)2
-rw-r--r--completions/xz30
-rw-r--r--completions/xzdec37
151 files changed, 3811 insertions, 2908 deletions
diff --git a/completions/Makefile.am b/completions/Makefile.am
index 4e2547f2..2a8f3e1f 100644
--- a/completions/Makefile.am
+++ b/completions/Makefile.am
@@ -1,38 +1,52 @@
bashcompdir = $(pkgdatadir)/completions
bashcomp_DATA = abook \
+ aclocal \
+ alias \
ant \
apache2ctl \
- apt \
apt-build \
+ apt-cache \
+ apt-get \
aptitude \
+ arping \
+ arpspoof \
asciidoc \
aspell \
autoconf \
automake \
+ autoreconf \
autorpm \
- bash-builtins \
+ autoscan \
+ badblocks \
bind-utils \
- bitkeeper \
- bittorrent \
+ bk \
bluez \
brctl \
+ btdownloadheadless.py \
bzip2 \
cal \
+ cancel \
cardctl \
- cfengine \
+ cfagent \
+ cfrun \
+ chage \
+ check_perms \
+ chgrp \
chkconfig \
+ chown \
+ chpasswd \
chrpath \
chsh \
cksfv \
+ cleanarch \
clisp \
+ complete \
configure \
- coreutils \
cowsay \
cpan2dist \
cpio \
cppcheck \
crontab \
- cups \
curl \
cryptsetup \
cvs \
@@ -40,119 +54,181 @@ bashcomp_DATA = abook \
dd \
dhclient \
dict \
+ dmesg \
dot \
dpkg \
+ dpkg-source \
dselect \
dsniff \
- dvd+rw-tools \
- e2fsprogs \
+ dumpdb \
+ dumpe2fs \
+ e2freefrag \
+ e2label \
+ ether-wake \
evince \
+ export \
+ faillog \
+ fbgs \
fbi \
feh \
file \
- findutils \
- freeciv \
- freerdp \
- fuse \
+ filefrag \
+ filesnarf \
+ find \
+ freeciv-gtk2 \
+ freeciv-server \
+ function \
+ fusermount \
gcc \
gcl \
gdb \
+ genaliases \
+ gendiff \
genisoimage \
getent \
gkrellm \
gnatmake \
gnome-mplayer \
+ gpasswd \
gpg \
gpg2 \
gprof \
+ groupadd \
+ groupdel \
+ groupmems \
+ groupmod \
+ growisofs \
+ grpck \
gzip \
hddtemp \
- heimdal \
+ hid2hci \
hping2 \
htpasswd \
iconv \
idn \
iftop \
- ifupdown \
+ ifup \
imagemagick \
info \
+ insmod \
+ invoke-rc.d \
+ ionice \
+ ip \
iptables \
ipmitool \
- iproute2 \
ipsec \
- iputils \
ipv6calc \
+ iscsiadm \
isql \
jar \
+ jarsigner \
java \
+ javaws \
+ jps \
k3b \
kcov \
+ kill \
+ killall \
kldload \
+ kldunload \
+ ktutil \
larch \
+ lastlog \
ldapvi \
lftp \
+ lftpget \
lilo \
links \
lintian \
lisp \
+ list_lists \
+ look \
+ lpq \
+ lpr \
lrzip \
lsof \
lvm \
lzma \
lzop \
+ macof \
mailman \
+ mailmanctl \
make \
man \
mc \
mcrypt \
mdadm \
+ mdtool \
medusa \
+ mii-diag \
+ mii-tool \
minicom \
mkinitrd \
- module-init-tools \
+ mktemp \
+ mmsitepass \
monodevelop \
mount \
mplayer \
msynctool \
mtx \
- munin-node \
+ munindoc \
+ munin-node-configure \
+ munin-run \
+ munin-update \
mutt \
mysql \
mysqladmin \
ncftp \
- net-tools \
+ newgrp \
+ newusers \
nmap \
ntpdate \
openldap \
openssl \
- open-iscsi \
p4 \
+ pack200 \
+ passwd \
perl \
+ pgrep \
pine \
+ ping \
pkg-config \
- pkg_install \
+ pkg_delete \
pkgtools \
- pm-utils \
+ pm-hibernate \
+ pm-is-supported \
+ pm-powersave \
+ portinstall \
portupgrade \
+ postcat \
+ postconf \
postfix \
postgresql \
+ postmap \
+ postsuper \
povray \
prelink \
- procps \
protoc \
puppet \
+ pwck \
+ pwdx \
pwgen \
python \
qdbus \
qemu \
+ qrunner \
+ querybts \
quota-tools \
rcs \
rdesktop \
+ renice \
reptyr \
reportbug \
resolvconf \
rfkill \
ri \
+ rmmod \
+ route \
rpcdebug \
rpm \
rpm2tgz \
@@ -166,33 +242,49 @@ bashcomp_DATA = abook \
screen \
service \
sh \
- shadow \
sitecopy \
slackpkg \
- slapt \
+ slapt-get \
+ slapt-src \
smartctl \
snownews \
sqlite3 \
ssh \
+ ssh-copy-id \
sshfs \
+ sshmitm \
+ sshow \
strace \
svk \
sysbench \
sysctl \
- sysv-rc \
tar \
tcpdump \
+ tcpkill \
+ tcpnice \
+ tracepath \
+ tune2fs \
unace \
+ unpack200 \
unrar \
+ unshunt \
update-alternatives \
- util-linux \
+ update-rc.d \
+ urlsnarf \
+ useradd \
+ userdel \
+ usermod \
+ vipw \
vncviewer \
vpnc \
+ watch \
+ webmitm \
wireless-tools \
wodim \
wol \
wtf \
wvdial \
+ xfreerdp \
xgamma \
xhost \
xm \
@@ -204,6 +296,7 @@ bashcomp_DATA = abook \
xrdb \
xsltproc \
xz \
+ xzdec \
yp-tools \
yum-arch
diff --git a/completions/aclocal b/completions/aclocal
new file mode 100644
index 00000000..6c61870b
--- /dev/null
+++ b/completions/aclocal
@@ -0,0 +1,41 @@
+# aclocal(1) completion
+
+_aclocal()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ case "$prev" in
+ --help|--print-ac-dir|--version)
+ return 0
+ ;;
+ --acdir|-I)
+ _filedir -d
+ return 0
+ ;;
+ --output)
+ _filedir
+ return 0
+ ;;
+ --warnings|-W)
+ local cats=( syntax unsupported )
+ COMPREPLY=( $( compgen -W \
+ '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) )
+ return 0
+ ;;
+ esac
+
+ $split && return 0
+
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+} &&
+complete -F _aclocal aclocal aclocal-1.11
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/alias b/completions/alias
new file mode 100644
index 00000000..65b37251
--- /dev/null
+++ b/completions/alias
@@ -0,0 +1,26 @@
+# bash alias completion
+
+_alias()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case ${words[@]} in
+ *[^=])
+ COMPREPLY=( $( compgen -A alias -- "$cur" ) )
+ ;;
+ *=)
+ COMPREPLY=( "$( alias ${cur%=} 2>/dev/null | sed \
+ -e 's|^alias '"$cur"'\(.*\)$|\1|' )" )
+ ;;
+ esac
+} &&
+complete -F _alias -o nospace alias
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/apt-cache b/completions/apt-cache
new file mode 100644
index 00000000..a50f89c0
--- /dev/null
+++ b/completions/apt-cache
@@ -0,0 +1,80 @@
+# Debian apt-cache(8) completion.
+
+_apt_cache()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ local special i
+ if [ "$cur" != show ]; then
+ for (( i=0; i < ${#words[@]}-1; i++ )); do
+ if [[ ${words[i]} == @(add|depends|dotty|madison|policy|rdepends|show?(pkg|src|)) ]]; then
+ special=${words[i]}
+ fi
+ done
+ fi
+
+
+ if [ -n "$special" ]; then
+ 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 --no-generate pkgnames "$cur" 2> /dev/null ) )
+ return 0
+ ;;
+
+ esac
+ fi
+
+
+ case $prev in
+ -c|-p|-s|--config-file|--pkg-cache|--src-cache)
+ _filedir
+ return 0
+ ;;
+ search)
+ if [[ "$cur" != -* ]]; then
+ return 0
+ fi
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+
+ COMPREPLY=( $( compgen -W '-h -v -p -s -q -i -f -a -g -c \
+ -o --help --version --pkg-cache --src-cache \
+ --quiet --important --full --all-versions \
+ --no-all-versions --generate --no-generate \
+ --names-only --all-names --recurse \
+ --config-file --option --installed' -- "$cur" ) )
+ else
+
+ COMPREPLY=( $( compgen -W 'add gencaches show showpkg showsrc \
+ stats dump dumpavail unmet search search \
+ depends rdepends pkgnames dotty xvcg \
+ policy madison' -- "$cur" ) )
+
+ fi
+
+
+ return 0
+} &&
+complete -F _apt_cache apt-cache
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/apt b/completions/apt-get
index 8bddf6ad..1f6b726c 100644
--- a/completions/apt
+++ b/completions/apt-get
@@ -72,79 +72,6 @@ _apt_get()
} &&
complete -F _apt_get apt-get
-# Debian apt-cache(8) completion.
-#
-_apt_cache()
-{
- local cur prev words cword
- _init_completion || return
-
- local special i
- if [ "$cur" != show ]; then
- for (( i=0; i < ${#words[@]}-1; i++ )); do
- if [[ ${words[i]} == @(add|depends|dotty|madison|policy|rdepends|show?(pkg|src|)) ]]; then
- special=${words[i]}
- fi
- done
- fi
-
-
- if [ -n "$special" ]; then
- 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 --no-generate pkgnames "$cur" 2> /dev/null ) )
- return 0
- ;;
-
- esac
- fi
-
-
- case $prev in
- -c|-p|-s|--config-file|--pkg-cache|--src-cache)
- _filedir
- return 0
- ;;
- search)
- if [[ "$cur" != -* ]]; then
- return 0
- fi
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
-
- COMPREPLY=( $( compgen -W '-h -v -p -s -q -i -f -a -g -c \
- -o --help --version --pkg-cache --src-cache \
- --quiet --important --full --all-versions \
- --no-all-versions --generate --no-generate \
- --names-only --all-names --recurse \
- --config-file --option --installed' -- "$cur" ) )
- else
-
- COMPREPLY=( $( compgen -W 'add gencaches show showpkg showsrc \
- stats dump dumpavail unmet search search \
- depends rdepends pkgnames dotty xvcg \
- policy madison' -- "$cur" ) )
-
- fi
-
-
- return 0
-} &&
-complete -F _apt_cache apt-cache
-
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
diff --git a/completions/arping b/completions/arping
new file mode 100644
index 00000000..ea35bbde
--- /dev/null
+++ b/completions/arping
@@ -0,0 +1,37 @@
+# arping(8) completion
+
+_arping()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -c|-w)
+ return
+ ;;
+ -I)
+ _available_interfaces -a
+ return
+ ;;
+ -s)
+ _ip_addresses
+ return
+ ;;
+ esac
+
+ if [[ $cur == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) )
+ return
+ fi
+
+ _known_hosts_real "$cur"
+} &&
+complete -F _arping arping
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/arpspoof b/completions/arpspoof
new file mode 100644
index 00000000..91bafe58
--- /dev/null
+++ b/completions/arpspoof
@@ -0,0 +1,34 @@
+# arpspoof completion
+
+_arpspoof()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -i)
+ _available_interfaces
+ return 0
+ ;;
+ -t)
+ _known_hosts_real "$cur"
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+ else
+ _known_hosts_real "$cur"
+ fi
+
+} &&
+complete -F _arpspoof arpspoof
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/autoconf b/completions/autoconf
index c3f6a3dc..0484860e 100644
--- a/completions/autoconf
+++ b/completions/autoconf
@@ -1,4 +1,4 @@
-# Completions for autoconf tools
+# autoconf(1) completion
_autoconf()
{
@@ -37,75 +37,6 @@ _autoconf()
} &&
complete -F _autoconf autoconf
-_autoreconf()
-{
- local cur prev words cword split
- _init_completion -s || return
-
- case "$prev" in
- --help|-h|--version|-V)
- return 0
- ;;
- --warnings|-W)
- local cats=( cross gnu obsolete override portability syntax \
- unsupported )
- COMPREPLY=( $( compgen -W \
- '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) )
- return 0
- ;;
- --prepend-include|-B|--include|-I)
- _filedir -d
- return 0
- ;;
- esac
-
- $split && return 0
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- [[ $COMPREPLY == *= ]] && compopt -o nospace
- return 0
- fi
-
- if [[ $1 == autoheader ]] ; then
- _filedir '@(ac|in)'
- else
- _filedir -d
- fi
-} &&
-complete -F _autoreconf autoreconf autoheader
-
-_autoscan()
-{
- local cur prev words cword split
- _init_completion -s || return
-
- case "$prev" in
- --help|-h|--version|-V)
- return 0
- ;;
- --prepend-include|-B|--include|-I)
- _filedir -d
- return 0
- ;;
- esac
-
- $split && return 0
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- [[ $COMPREPLY == *= ]] && compopt -o nospace
- return 0
- fi
-
- if [[ $1 == autoupdate ]] ; then
- _filedir '@(ac|in)'
- else
- _filedir -d
- fi
-} &&
-complete -F _autoscan autoscan autoupdate
-
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
diff --git a/completions/automake b/completions/automake
index f914b0ae..64057bc6 100644
--- a/completions/automake
+++ b/completions/automake
@@ -1,4 +1,4 @@
-# Completions for automake tools
+# automake(1) completion
_automake()
{
@@ -33,38 +33,6 @@ _automake()
} &&
complete -F _automake automake automake-1.11
-_aclocal()
-{
- local cur prev words cword split
- _init_completion -s || return
-
- case "$prev" in
- --help|--print-ac-dir|--version)
- return 0
- ;;
- --acdir|-I)
- _filedir -d
- return 0
- ;;
- --output)
- _filedir
- return 0
- ;;
- --warnings|-W)
- local cats=( syntax unsupported )
- COMPREPLY=( $( compgen -W \
- '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) )
- return 0
- ;;
- esac
-
- $split && return 0
-
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- [[ $COMPREPLY == *= ]] && compopt -o nospace
-} &&
-complete -F _aclocal aclocal aclocal-1.11
-
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
diff --git a/completions/autoreconf b/completions/autoreconf
new file mode 100644
index 00000000..b661f985
--- /dev/null
+++ b/completions/autoreconf
@@ -0,0 +1,47 @@
+# autoreconf(1) completion
+
+_autoreconf()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ case "$prev" in
+ --help|-h|--version|-V)
+ return 0
+ ;;
+ --warnings|-W)
+ local cats=( cross gnu obsolete override portability syntax \
+ unsupported )
+ COMPREPLY=( $( compgen -W \
+ '${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) )
+ return 0
+ ;;
+ --prepend-include|-B|--include|-I)
+ _filedir -d
+ return 0
+ ;;
+ esac
+
+ $split && return 0
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ return 0
+ fi
+
+ if [[ $1 == autoheader ]] ; then
+ _filedir '@(ac|in)'
+ else
+ _filedir -d
+ fi
+} &&
+complete -F _autoreconf autoreconf autoheader
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/autoscan b/completions/autoscan
new file mode 100644
index 00000000..e5040abd
--- /dev/null
+++ b/completions/autoscan
@@ -0,0 +1,40 @@
+# autoscan(1) completion
+
+_autoscan()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ case "$prev" in
+ --help|-h|--version|-V)
+ return 0
+ ;;
+ --prepend-include|-B|--include|-I)
+ _filedir -d
+ return 0
+ ;;
+ esac
+
+ $split && return 0
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ return 0
+ fi
+
+ if [[ $1 == autoupdate ]] ; then
+ _filedir '@(ac|in)'
+ else
+ _filedir -d
+ fi
+} &&
+complete -F _autoscan autoscan autoupdate
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/avctrl b/completions/avctrl
new file mode 100644
index 00000000..57f5d57b
--- /dev/null
+++ b/completions/avctrl
@@ -0,0 +1,26 @@
+# avctrl completion
+
+_avctrl()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '--help --quiet' -- "$cur" ) )
+ else
+ local args
+ _count_args
+ if [ $args -eq 1 ]; then
+ COMPREPLY=( $( compgen -W 'discover switch' -- "$cur" ) )
+ fi
+ fi
+} &&
+complete -F _avctrl avctrl
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/badblocks b/completions/badblocks
new file mode 100644
index 00000000..4953a182
--- /dev/null
+++ b/completions/badblocks
@@ -0,0 +1,38 @@
+# badblocks(8) completion
+
+_badblocks()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -b|-c|-e|-d|-p|-t)
+ return 0
+ ;;
+ -i|-o)
+ _filedir
+ return 0
+ ;;
+ 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
+ return 0
+ fi
+
+ cur=${cur:=/dev/}
+ _filedir
+} &&
+complete -F _badblocks badblocks
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/bash-builtins b/completions/bash-builtins
deleted file mode 100644
index 3df3ddb3..00000000
--- a/completions/bash-builtins
+++ /dev/null
@@ -1,120 +0,0 @@
-# bash alias completion
-#
-_alias()
-{
- local cur prev words cword
- _init_completion || return
-
- case ${words[@]} in
- *[^=])
- COMPREPLY=( $( compgen -A alias -- "$cur" ) )
- ;;
- *=)
- COMPREPLY=( "$( alias ${cur%=} 2>/dev/null | sed \
- -e 's|^alias '"$cur"'\(.*\)$|\1|' )" )
- ;;
- esac
-} &&
-complete -F _alias -o nospace alias
-
-# bash export completion
-#
-_export()
-{
- local cur prev words cword
- _init_completion || return
-
- case ${words[@]} in
- *=\$*)
- COMPREPLY=( $( compgen -v -P '$' -- "${cur#*=\$}" ) )
- ;;
- *[^=])
- COMPREPLY=( $( compgen -v -S '=' -- "$cur" ) )
- ;;
- *=)
- COMPREPLY=( "$( eval echo -n \"$`echo ${cur%=}`\" |
- ( echo -n \'
- sed -e 's/'\''/'\''\\\'\'''\''/g'
- echo -n \' ) )" )
- ;;
- esac
-} &&
-complete -F _export -o default -o nospace export
-
-# bash shell function completion
-#
-_function()
-{
- local cur prev words cword
- _init_completion || return
-
- if [[ $1 == @(declare|typeset) ]]; then
- if [ "$prev" = -f ]; then
- COMPREPLY=( $( compgen -A function -- "$cur" ) )
- elif [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '-a -f -F -i -r -x -p' -- "$cur" ) )
- fi
- elif [ $cword -eq 1 ]; then
- COMPREPLY=( $( compgen -A function -- "$cur" ) )
- else
- COMPREPLY=( "() $( type -- ${words[1]} | sed -e 1,2d )" )
- fi
-} &&
-complete -F _function function declare typeset
-
-# bash complete completion
-#
-_complete()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -o)
- COMPREPLY=( $( compgen -W 'bashdefault default dirnames filenames \
- nospace plusdirs' -- "$cur" ) )
- return 0
- ;;
-
- -A)
- COMPREPLY=( $( compgen -W 'alias arrayvar binding builtin command \
- directory disabled enabled export file function group \
- helptopic hostname job keyword running service setopt shopt \
- signal stopped user variable' -- "$cur" ) )
- return 0
- ;;
-
- -C)
- COMPREPLY=( $( compgen -A command -- "$cur" ) )
- return 0
- ;;
- -F)
- COMPREPLY=( $( compgen -A function -- "$cur" ) )
- return 0
- ;;
- -p|-r)
- COMPREPLY=( $( complete -p | sed -e 's|.* ||' ) )
- COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) )
- return 0
- ;;
-
- esac
-
- if [[ "$cur" == -* ]]; then
- # relevant options completion
- local opts="-a -b -c -d -e -f -g -j -k -o -s -u -v -A -G -W -P -S -X"
- [[ $1 != compgen ]] && opts+=" -F -C"
- COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) )
- else
- COMPREPLY=( $( compgen -A command -- "$cur" ) )
- fi
-} &&
-complete -F _complete compgen complete
-
-# Local variables:
-# mode: shell-script
-# sh-basic-offset: 4
-# sh-indent-comment: t
-# indent-tabs-mode: nil
-# End:
-# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/bitkeeper b/completions/bk
index abb3dbca..abb3dbca 100644
--- a/completions/bitkeeper
+++ b/completions/bk
diff --git a/completions/bluez b/completions/bluez
index b130b9d3..b763867b 100644
--- a/completions/bluez
+++ b/completions/bluez
@@ -376,35 +376,6 @@ _hciattach()
} &&
complete -F _hciattach hciattach
-_hid2hci()
-{
- local cur prev words cword
- _init_completion || return
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '--help --quiet -0 --tohci -1 \
- --tohid' -- "$cur" ) )
- fi
-} &&
-complete -F _hid2hci hid2hci
-
-_avctrl()
-{
- local cur prev words cword
- _init_completion || return
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '--help --quiet' -- "$cur" ) )
- else
- local args
- _count_args
- if [ $args -eq 1 ]; then
- COMPREPLY=( $( compgen -W 'discover switch' -- "$cur" ) )
- fi
- fi
-} &&
-complete -F _avctrl avctrl
-
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
diff --git a/completions/bittorrent b/completions/btdownloadheadless.py
index ea0f781a..ea0f781a 100644
--- a/completions/bittorrent
+++ b/completions/btdownloadheadless.py
diff --git a/completions/cancel b/completions/cancel
new file mode 100644
index 00000000..5268e08f
--- /dev/null
+++ b/completions/cancel
@@ -0,0 +1,18 @@
+# cancel(1) completion
+
+_cancel()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ COMPREPLY=( $( compgen -W "$( lpstat 2>/dev/null | cut -d' ' -f1 )" -- "$cur" ) )
+} &&
+complete -F _cancel cancel
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/cfagent b/completions/cfagent
new file mode 100644
index 00000000..01ca7ad5
--- /dev/null
+++ b/completions/cfagent
@@ -0,0 +1,27 @@
+# cfagent completion
+
+_cfagent()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -f|--file)
+ _filedir
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ fi
+} &&
+complete -F _cfagent cfagent
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/cfengine b/completions/cfrun
index 34f4dcf2..810f03dc 100644
--- a/completions/cfengine
+++ b/completions/cfrun
@@ -1,22 +1,4 @@
-# bash completion for cfengine
-
-_cfagent()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -f|--file)
- _filedir
- return 0
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- fi
-} &&
-complete -F _cfagent cfagent
+# cfrun completion
_cfrun()
{
diff --git a/completions/chage b/completions/chage
new file mode 100644
index 00000000..3bd1816e
--- /dev/null
+++ b/completions/chage
@@ -0,0 +1,32 @@
+# chage(1) completion
+
+_chage()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ case $prev in
+ -d|--lastday|-E|--expiredate|-h|--help|-I|--inactive|-m|--mindays|\
+ -M|--maxdays|-W|--warndays)
+ return 0
+ ;;
+ esac
+
+ $split && return 0
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ return 0
+ fi
+
+ COMPREPLY=( $( compgen -u -- "$cur" ) )
+} &&
+complete -F _chage chage
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/check_perms b/completions/check_perms
new file mode 100644
index 00000000..695aad5c
--- /dev/null
+++ b/completions/check_perms
@@ -0,0 +1,21 @@
+# mailman check_perms completion
+
+_check_perms()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '-f -v -h' -- "$cur" ) )
+ fi
+
+} &&
+complete -F _check_perms check_perms
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/chgrp b/completions/chgrp
new file mode 100644
index 00000000..cdd6c2ce
--- /dev/null
+++ b/completions/chgrp
@@ -0,0 +1,46 @@
+# chgrp(1) completion
+
+_chgrp()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ cur=${cur//\\\\/}
+
+ if [[ "$prev" == --reference ]]; then
+ _filedir
+ return 0
+ fi
+
+ $split && return 0
+
+ # options completion
+ if [[ "$cur" == -* ]]; then
+ local w opts
+ for w in "${words[@]}" ; do
+ [[ "$w" == -@(R|-recursive) ]] && opts="-H -L -P" && break
+ done
+ COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes --dereference \
+ --no-dereference --silent --quiet --reference --recursive \
+ --verbose --help --version $opts' -- "$cur" ) )
+ return 0
+ fi
+
+ # first parameter on line or first since an option?
+ if [[ $cword -eq 1 && "$cur" != -* || "$prev" == -* ]]; then
+ _allowed_groups "$cur"
+ else
+ _filedir || return 0
+ fi
+
+ return 0
+} &&
+complete -F _chgrp chgrp
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/chown b/completions/chown
new file mode 100644
index 00000000..1ce0edc0
--- /dev/null
+++ b/completions/chown
@@ -0,0 +1,52 @@
+# chown(1) completion
+
+_chown()
+{
+ local cur prev words cword split
+ # Don't treat user:group as separate words.
+ _init_completion -s -n : || return
+
+ case "$prev" in
+ --from)
+ _usergroup
+ return 0
+ ;;
+ --reference)
+ _filedir
+ return 0
+ ;;
+ esac
+
+ $split && return 0
+
+ if [[ "$cur" == -* ]]; then
+ # Complete -options
+ local w opts
+ for w in "${words[@]}" ; do
+ [[ "$w" == -@(R|-recursive) ]] && opts="-H -L -P" && break
+ done
+ COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes --dereference \
+ --no-dereference --from --silent --quiet --reference --recursive \
+ --verbose --help --version $opts' -- "$cur" ) )
+ else
+ local args
+
+ # The first argument is an usergroup; the rest are filedir.
+ _count_args :
+
+ if [[ $args -eq 1 ]]; then
+ _usergroup -u
+ else
+ _filedir
+ fi
+ fi
+} &&
+complete -F _chown chown
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/chpasswd b/completions/chpasswd
new file mode 100644
index 00000000..ed77069b
--- /dev/null
+++ b/completions/chpasswd
@@ -0,0 +1,35 @@
+# chpasswd(8) completion
+
+_chpasswd()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ case $prev in
+ -c|--crypt)
+ COMPREPLY=( $( compgen -W 'DES MD5 NONE SHA256 SHA512' \
+ -- "$cur" ) )
+ return 0
+ ;;
+ -s|--sha-rounds)
+ return 0
+ ;;
+ esac
+
+ $split && return 0
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ return 0
+ fi
+} &&
+complete -F _chpasswd chpasswd
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/cleanarch b/completions/cleanarch
new file mode 100644
index 00000000..24d405d7
--- /dev/null
+++ b/completions/cleanarch
@@ -0,0 +1,22 @@
+# mailman cleanarch completion
+
+_cleanarch()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '--status --dry-run --quiet \
+ --help' -- "$cur" ) )
+ fi
+
+} &&
+complete -F _cleanarch cleanarch
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/complete b/completions/complete
new file mode 100644
index 00000000..e5b69a05
--- /dev/null
+++ b/completions/complete
@@ -0,0 +1,56 @@
+# bash complete completion
+
+_complete()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -o)
+ COMPREPLY=( $( compgen -W 'bashdefault default dirnames filenames \
+ nospace plusdirs' -- "$cur" ) )
+ return 0
+ ;;
+
+ -A)
+ COMPREPLY=( $( compgen -W 'alias arrayvar binding builtin command \
+ directory disabled enabled export file function group \
+ helptopic hostname job keyword running service setopt shopt \
+ signal stopped user variable' -- "$cur" ) )
+ return 0
+ ;;
+
+ -C)
+ COMPREPLY=( $( compgen -A command -- "$cur" ) )
+ return 0
+ ;;
+ -F)
+ COMPREPLY=( $( compgen -A function -- "$cur" ) )
+ return 0
+ ;;
+ -p|-r)
+ COMPREPLY=( $( complete -p | sed -e 's|.* ||' ) )
+ COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) )
+ return 0
+ ;;
+
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ # relevant options completion
+ local opts="-a -b -c -d -e -f -g -j -k -o -s -u -v -A -G -W -P -S -X"
+ [[ $1 != compgen ]] && opts+=" -F -C"
+ COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) )
+ else
+ COMPREPLY=( $( compgen -A command -- "$cur" ) )
+ fi
+} &&
+complete -F _complete compgen complete
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/coreutils b/completions/coreutils
deleted file mode 100644
index 4b40b15f..00000000
--- a/completions/coreutils
+++ /dev/null
@@ -1,139 +0,0 @@
-# Completions for various core utilities
-
-# chown(1) completion
-#
-_chown()
-{
- local cur prev words cword split
- # Don't treat user:group as separate words.
- _init_completion -s -n : || return
-
- case "$prev" in
- --from)
- _usergroup
- return 0
- ;;
- --reference)
- _filedir
- return 0
- ;;
- esac
-
- $split && return 0
-
- if [[ "$cur" == -* ]]; then
- # Complete -options
- local w opts
- for w in "${words[@]}" ; do
- [[ "$w" == -@(R|-recursive) ]] && opts="-H -L -P" && break
- done
- COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes --dereference \
- --no-dereference --from --silent --quiet --reference --recursive \
- --verbose --help --version $opts' -- "$cur" ) )
- else
- local args
-
- # The first argument is an usergroup; the rest are filedir.
- _count_args :
-
- if [[ $args -eq 1 ]]; then
- _usergroup -u
- else
- _filedir
- fi
- fi
-} &&
-complete -F _chown chown
-
-
-# chgrp(1) completion
-#
-_chgrp()
-{
- local cur prev words cword split
- _init_completion -s || return
-
- cur=${cur//\\\\/}
-
- if [[ "$prev" == --reference ]]; then
- _filedir
- return 0
- fi
-
- $split && return 0
-
- # options completion
- if [[ "$cur" == -* ]]; then
- local w opts
- for w in "${words[@]}" ; do
- [[ "$w" == -@(R|-recursive) ]] && opts="-H -L -P" && break
- done
- COMPREPLY=( $( compgen -W '-c -h -f -R -v --changes --dereference \
- --no-dereference --silent --quiet --reference --recursive \
- --verbose --help --version $opts' -- "$cur" ) )
- return 0
- fi
-
- # first parameter on line or first since an option?
- if [[ $cword -eq 1 && "$cur" != -* || "$prev" == -* ]]; then
- _allowed_groups "$cur"
- else
- _filedir || return 0
- fi
-
- return 0
-} &&
-complete -F _chgrp chgrp
-
-# id(1) completion
-#
-_id()
-{
- local cur prev words cword
- _init_completion || return
-
- if [[ "$cur" == -* ]]; then
- local opts=$( _parse_help "$1" )
- [[ $opts ]] || opts="-G -g -u" # POSIX fallback
- COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) )
- else
- COMPREPLY=( $( compgen -u "$cur" ) )
- fi
-} &&
-complete -F _id id
-
-# mktemp(1) completion
-#
-_mktemp()
-{
- local cur prev words cword split
- _init_completion -s || return
-
- case "$prev" in
- --help|--version|--suffix)
- return 0
- ;;
- --tmpdir|-p)
- _filedir -d
- return 0
- ;;
- esac
-
- $split && return 0
-
- if [[ "$cur" == -* ]]; then
- local opts=$( _parse_help "$1" )
- [[ $opts ]] || opts="-d -u -q -p -t" # non-GNU fallback
- COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) )
- [[ $COMPREPLY == *= ]] && compopt -o nospace
- fi
-} &&
-complete -F _mktemp mktemp
-
-# Local variables:
-# mode: shell-script
-# sh-basic-offset: 4
-# sh-indent-comment: t
-# indent-tabs-mode: nil
-# End:
-# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/dmesg b/completions/dmesg
new file mode 100644
index 00000000..7aad7be5
--- /dev/null
+++ b/completions/dmesg
@@ -0,0 +1,33 @@
+# dmesg(1) completion
+
+_dmesg()
+{
+ [[ $OSTYPE == *solaris* ]] && return # no args there
+
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -s|-M|-N)
+ return
+ ;;
+ -n)
+ COMPREPLY=( $( compgen -W '{1..8}' -- "$cur" ) )
+ return
+ ;;
+ esac
+
+ if [[ $cur == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+ return
+ fi
+} &&
+complete -F _dmesg dmesg
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/dnsspoof b/completions/dnsspoof
new file mode 100644
index 00000000..63229704
--- /dev/null
+++ b/completions/dnsspoof
@@ -0,0 +1,32 @@
+# dnsspoof completion
+
+_dnsspoof()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -i)
+ _interfaces
+ return 0
+ ;;
+ -f)
+ _filedir
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+ fi
+
+} &&
+complete -F _dnsspoof dnsspoof
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/dpkg b/completions/dpkg
index 068e809b..3c368920 100644
--- a/completions/dpkg
+++ b/completions/dpkg
@@ -99,112 +99,6 @@ _dpkg_reconfigure()
} &&
complete -F _dpkg_reconfigure -o default dpkg-reconfigure
-# Debian dpkg-source completion
-#
-_dpkg_source()
-{
- local cur prev words cword
- _init_completion || return
-
- 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"
- unpackopts="-sp -sn -su"
- options="-x -b $packopts $unpackopts"
- fields="Format Source Version Binary Maintainer Uploader Architecture \
- Standards-Version Build-Depends Files"
-
- action="options"
- for (( i=0; i < ${#words[@]}-1; i++ )); do
- if [[ ${words[$i]} == "-x" ]]; then
- action=unpack
- elif [[ ${words[$i]} == "-b" ]]; then
- action=pack
- elif [[ ${words[$i]} == "-h" ]]; then
- action=help
- fi
- done
-
- case $action in
- unpack)
- case $prev in
- -x)
- _filedir -d
- _filedir 'dsc'
- return 0
- ;;
- *)
- COMPREPLY=( $( compgen -W "$unpackopts" -- "$cur" ) )
- _filedir -d
- _filedir
- return 0
- ;;
- esac
- return 0
- ;;
- pack)
- case $prev in
- -b)
- _filedir -d
- return 0
- ;;
- -c|-l|-T|-i|-I)
- # -c: get controlfile
- # -l: get per-version info from this file
- # -T: read variables here, not debian/substvars
- # -i: <regexp> filter out files to ignore diffs of.
- # -I: filter out files when building tarballs.
- # 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
- # if $cur doesn't contain a = yet, suggest variable names
- 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
- ;;
- esac
- return 0
- ;;
- *)
- COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
- return 0
- ;;
- esac
-} &&
-complete -F _dpkg_source dpkg-source
-
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
diff --git a/completions/dpkg-source b/completions/dpkg-source
new file mode 100644
index 00000000..66ac6d58
--- /dev/null
+++ b/completions/dpkg-source
@@ -0,0 +1,113 @@
+# Debian dpkg-source completion
+
+_dpkg_source()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ 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"
+ unpackopts="-sp -sn -su"
+ options="-x -b $packopts $unpackopts"
+ fields="Format Source Version Binary Maintainer Uploader Architecture \
+ Standards-Version Build-Depends Files"
+
+ action="options"
+ for (( i=0; i < ${#words[@]}-1; i++ )); do
+ if [[ ${words[$i]} == "-x" ]]; then
+ action=unpack
+ elif [[ ${words[$i]} == "-b" ]]; then
+ action=pack
+ elif [[ ${words[$i]} == "-h" ]]; then
+ action=help
+ fi
+ done
+
+ case $action in
+ unpack)
+ case $prev in
+ -x)
+ _filedir -d
+ _filedir 'dsc'
+ return 0
+ ;;
+ *)
+ COMPREPLY=( $( compgen -W "$unpackopts" -- "$cur" ) )
+ _filedir -d
+ _filedir
+ return 0
+ ;;
+ esac
+ return 0
+ ;;
+ pack)
+ case $prev in
+ -b)
+ _filedir -d
+ return 0
+ ;;
+ -c|-l|-T|-i|-I)
+ # -c: get controlfile
+ # -l: get per-version info from this file
+ # -T: read variables here, not debian/substvars
+ # -i: <regexp> filter out files to ignore diffs of.
+ # -I: filter out files when building tarballs.
+ # 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
+ # if $cur doesn't contain a = yet, suggest variable names
+ 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
+ ;;
+ esac
+ return 0
+ ;;
+ *)
+ COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
+ return 0
+ ;;
+ esac
+} &&
+complete -F _dpkg_source dpkg-source
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/dsniff b/completions/dsniff
index 1265e6bb..b0eeedf0 100644
--- a/completions/dsniff
+++ b/completions/dsniff
@@ -1,52 +1,4 @@
-# dsniff util completion
-
-_arpspoof()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -i)
- _available_interfaces
- return 0
- ;;
- -t)
- _known_hosts_real "$cur"
- return 0
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
- else
- _known_hosts_real "$cur"
- fi
-
-} &&
-complete -F _arpspoof arpspoof
-
-_dnsspoof()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -i)
- _interfaces
- return 0
- ;;
- -f)
- _filedir
- return 0
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
- fi
-
-} &&
-complete -F _dnsspoof dnsspoof
+# dsniff completion
_dsniff()
{
@@ -71,149 +23,6 @@ _dsniff()
} &&
complete -F _dsniff dsniff
-_snarf()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -i)
- _interfaces
- return 0
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
- fi
-
-} &&
-complete -F _snarf filesnarf mailsnarf msgsnarf
-
-_macof()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -i)
- _interfaces
- return 0
- ;;
- esac
-
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
- fi
-
-} &&
-complete -F _macof macof
-
-_sshmitm()
-{
- local cur prev words cword
- _init_completion || return
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
- else
- _known_hosts_real "$cur"
- fi
-
-} &&
-complete -F _sshmitm sshmitm
-
-_sshow()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -i)
- _interfaces
- return 0
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
- fi
-
-} &&
-complete -F _sshow sshow
-
-_tcpkill()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -i)
- _interfaces
- return 0
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '-i -1 -2 -3 -4 -5 -6 -7 -8 -9' -- "$cur" ) )
- fi
-
-} &&
-complete -F _tcpkill tcpkill
-
-_tcpnice()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -i)
- _interfaces
- return 0
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
- fi
-
-} &&
-complete -F _tcpnice tcpnice
-
-_urlsnarf()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -i)
- _interfaces
- return 0
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
- fi
-
-} &&
-complete -F _urlsnarf urlsnarf
-
-_webmitm()
-{
- local cur prev words cword
- _init_completion || return
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
- else
- _known_hosts_real "$cur"
- fi
-
-} &&
-complete -F _webmitm webmitm
-
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
diff --git a/completions/dumpdb b/completions/dumpdb
new file mode 100644
index 00000000..4f093c6c
--- /dev/null
+++ b/completions/dumpdb
@@ -0,0 +1,24 @@
+# mailman dumpdb completion
+
+_dumpdb()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '--marshal --pickle --noprint \
+ --help' -- "$cur" ) )
+ else
+ _filedir
+ fi
+
+} &&
+complete -F _dumpdb dumpdb
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/dumpe2fs b/completions/dumpe2fs
new file mode 100644
index 00000000..7597a298
--- /dev/null
+++ b/completions/dumpe2fs
@@ -0,0 +1,34 @@
+# dumpe2fs(8) completion
+
+_dumpe2fs()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -o|-V)
+ return 0
+ ;;
+ -i)
+ _filedir
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+ return 0
+ fi
+
+ cur=${cur:=/dev/}
+ _filedir
+} &&
+complete -F _dumpe2fs dumpe2fs
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/e2freefrag b/completions/e2freefrag
new file mode 100644
index 00000000..519a6275
--- /dev/null
+++ b/completions/e2freefrag
@@ -0,0 +1,30 @@
+# e2freefrag(8) completion
+
+_e2freefrag()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -c|-h)
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" -h )' -- "$cur" ) )
+ return 0
+ fi
+
+ cur=${cur:=/dev/}
+ _filedir
+} &&
+complete -F _e2freefrag e2freefrag
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/e2fsprogs b/completions/e2fsprogs
deleted file mode 100644
index 1f5753be..00000000
--- a/completions/e2fsprogs
+++ /dev/null
@@ -1,170 +0,0 @@
-# bash completion for e2fsprogs
-
-_badblocks()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -b|-c|-e|-d|-p|-t)
- return 0
- ;;
- -i|-o)
- _filedir
- return 0
- ;;
- 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
- return 0
- fi
-
- cur=${cur:=/dev/}
- _filedir
-} &&
-complete -F _badblocks badblocks
-
-
-_dumpe2fs()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -o|-V)
- return 0
- ;;
- -i)
- _filedir
- return 0
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
- return 0
- fi
-
- cur=${cur:=/dev/}
- _filedir
-} &&
-complete -F _dumpe2fs dumpe2fs
-
-
-_e2freefrag()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -c|-h)
- return 0
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_usage "$1" -h )' -- "$cur" ) )
- return 0
- fi
-
- cur=${cur:=/dev/}
- _filedir
-} &&
-complete -F _e2freefrag e2freefrag
-
-
-_e2label()
-{
- local cur prev words cword
- _init_completion || return
-
- if [ $cword -eq 1 ]; then
- cur=${cur:=/dev/}
- _filedir
- fi
-} &&
-complete -F _e2label e2label
-
-
-_filefrag()
-{
- local cur prev words cword
- _init_completion || return
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
- return 0
- fi
-
- _filedir
-} &&
-complete -F _filefrag filefrag
-
-
-_tune2fs()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -c|-C|-E|-i|-J|-L|-m|-r|-T)
- return 0
- ;;
- -e)
- COMPREPLY=( $( compgen -W 'continue remount-ro panic' -- "$cur" ) )
- return 0
- ;;
- -g)
- _gids
- COMPREPLY=( $( compgen -g -W '${COMPREPLY[@]}' -- "$cur" ) )
- return 0
- ;;
- -M)
- _filedir -d
- ;;
- -o)
- local -a opts=(^debug ^bsdgroups ^user_xattr ^acl ^uid16
- ^journal_data ^journal_data_ordered ^journal_data_writeback)
- COMPREPLY=( $( compgen -W '${opts[@]} ${opts[@]#^}' -- "$cur" ) )
- return 0
- ;;
- -O)
- local -a opts=(^dir_index ^dir_nlink ^extent ^extra_isize ^filetype
- ^flex_bg ^has_journal ^huge_file ^large_file ^resize_inode
- ^sparse_super ^uninit_bg)
- COMPREPLY=( $( compgen -W '${opts[@]} ${opts[@]#^}' -- "$cur" ) )
- return 0
- ;;
- -u)
- _uids
- COMPREPLY=( $( compgen -u -W '${COMPREPLY[@]}' -- "$cur" ) )
- return 0
- ;;
- -U)
- COMPREPLY=( $( compgen -W 'clear random time' -- "$cur" ) )
- return 0
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
- return
- fi
-
- cur=${cur:=/dev/}
- _filedir
-} &&
-complete -F _tune2fs tune2fs
-
-# Local variables:
-# mode: shell-script
-# sh-basic-offset: 4
-# sh-indent-comment: t
-# indent-tabs-mode: nil
-# End:
-# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/e2label b/completions/e2label
new file mode 100644
index 00000000..e6601163
--- /dev/null
+++ b/completions/e2label
@@ -0,0 +1,21 @@
+# e2label(8) completion
+
+_e2label()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [ $cword -eq 1 ]; then
+ cur=${cur:=/dev/}
+ _filedir
+ fi
+} &&
+complete -F _e2label e2label
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/ether-wake b/completions/ether-wake
new file mode 100644
index 00000000..96ac75af
--- /dev/null
+++ b/completions/ether-wake
@@ -0,0 +1,33 @@
+# ether-wake(8) completion
+
+_ether_wake()
+{
+ local cur prev words cword
+ _init_completion -n : || return
+
+ case $prev in
+ -i)
+ _available_interfaces
+ return 0
+ ;;
+ -p)
+ return 0
+ ;;
+ esac
+
+ if [[ $cur == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" -u ) -V' -- "$cur" ) )
+ return 0
+ fi
+
+ _mac_addresses
+} &&
+complete -F _ether_wake ether-wake
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/export b/completions/export
new file mode 100644
index 00000000..a27dc016
--- /dev/null
+++ b/completions/export
@@ -0,0 +1,31 @@
+# bash export completion
+
+_export()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case ${words[@]} in
+ *=\$*)
+ COMPREPLY=( $( compgen -v -P '$' -- "${cur#*=\$}" ) )
+ ;;
+ *[^=])
+ COMPREPLY=( $( compgen -v -S '=' -- "$cur" ) )
+ ;;
+ *=)
+ COMPREPLY=( "$( eval echo -n \"$`echo ${cur%=}`\" |
+ ( echo -n \'
+ sed -e 's/'\''/'\''\\\'\'''\''/g'
+ echo -n \' ) )" )
+ ;;
+ esac
+} &&
+complete -F _export -o default -o nospace export
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/faillog b/completions/faillog
new file mode 100644
index 00000000..b7a91d1b
--- /dev/null
+++ b/completions/faillog
@@ -0,0 +1,34 @@
+# faillog(8) completion
+
+_faillog()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ case $prev in
+ -h|--help|-l|--lock-time|-m|--maximum|-t|--time)
+ return 0
+ ;;
+ -u|--user)
+ COMPREPLY=( $( compgen -u -- "$cur" ) )
+ return 0
+ ;;
+ esac
+
+ $split && return 0
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ return 0
+ fi
+} &&
+complete -F _faillog faillog
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/fbgs b/completions/fbgs
new file mode 100644
index 00000000..e3687621
--- /dev/null
+++ b/completions/fbgs
@@ -0,0 +1,45 @@
+# bash completion for fbgs(1)
+
+_fbgs()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case "$prev" in
+ -f)
+ local IFS=$'\n'
+ COMPREPLY=( $( compgen -W '$( fc-list 2>/dev/null )' -- "$cur" ) )
+ return
+ ;;
+ -m)
+ COMPREPLY=( $( compgen -W '$( sed \
+ -n "/^mode/{s/^mode \{1,\}\"\([^\"]\{1,\}\)\"/\1/g;p}" \
+ /etc/fb.modes 2> /dev/null )' -- "$cur" ) )
+ return
+ ;;
+ -d)
+ COMPREPLY=( $( compgen -f -d -- "${cur:-/dev/}" ) )
+ return
+ ;;
+ -t|-g|-p)
+ # argument required but no completions available
+ return
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $(compgen -W '-l -xl -xxl -a --fitwidth -d -m -t -g -f -p \
+ -h -c' -- "$cur") )
+ [[ $COMPREPLY ]] && return
+ fi
+
+ _filedir '?(e)ps|pdf'
+} && complete -F _fbgs fbgs
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/fbi b/completions/fbi
index 5020ecd3..61540af3 100644
--- a/completions/fbi
+++ b/completions/fbi
@@ -1,4 +1,4 @@
-# bash completion for fbi(1) and fbgs(1)
+# bash completion for fbi(1)
_fbi()
{
@@ -51,42 +51,6 @@ _fbi()
_filedir 'bmp|gif|jp?(e)g|pcd|png|p[pgb]m|tif?(f)|webp|xpm|xwd|?(e)ps|pdf|dvi|txt|svg?(z)'
} && complete -F _fbi fbi
-_fbgs()
-{
- local cur prev words cword
- _init_completion || return
-
- case "$prev" in
- -f)
- local IFS=$'\n'
- COMPREPLY=( $( compgen -W '$( fc-list 2>/dev/null )' -- "$cur" ) )
- return
- ;;
- -m)
- COMPREPLY=( $( compgen -W '$( sed \
- -n "/^mode/{s/^mode \{1,\}\"\([^\"]\{1,\}\)\"/\1/g;p}" \
- /etc/fb.modes 2> /dev/null )' -- "$cur" ) )
- return
- ;;
- -d)
- COMPREPLY=( $( compgen -f -d -- "${cur:-/dev/}" ) )
- return
- ;;
- -t|-g|-p)
- # argument required but no completions available
- return
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $(compgen -W '-l -xl -xxl -a --fitwidth -d -m -t -g -f -p \
- -h -c' -- "$cur") )
- [[ $COMPREPLY ]] && return
- fi
-
- _filedir '?(e)ps|pdf'
-} && complete -F _fbgs fbgs
-
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
diff --git a/completions/filefrag b/completions/filefrag
new file mode 100644
index 00000000..56696671
--- /dev/null
+++ b/completions/filefrag
@@ -0,0 +1,23 @@
+# filefrag(8) completion
+
+_filefrag()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+ return 0
+ fi
+
+ _filedir
+} &&
+complete -F _filefrag filefrag
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/filesnarf b/completions/filesnarf
new file mode 100644
index 00000000..321b29cb
--- /dev/null
+++ b/completions/filesnarf
@@ -0,0 +1,28 @@
+# filesnarf etc completion
+
+_snarf()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -i)
+ _interfaces
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+ fi
+
+} &&
+complete -F _snarf filesnarf mailsnarf msgsnarf
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/findutils b/completions/find
index 1d3a2822..1d3a2822 100644
--- a/completions/findutils
+++ b/completions/find
diff --git a/completions/freeciv b/completions/freeciv-gtk2
index 6f1d346b..1c129979 100644
--- a/completions/freeciv
+++ b/completions/freeciv-gtk2
@@ -1,23 +1,4 @@
-# freeciv completions
-
-_civserver()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -f|-g|-l|-r|--file|--log|--gamelog|--read)
- _filedir
- return 0
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- fi
-
-} &&
-complete -F _civserver civserver freeciv-server
+# freeciv client completions
_civclient()
{
diff --git a/completions/freeciv-server b/completions/freeciv-server
new file mode 100644
index 00000000..3def8bf1
--- /dev/null
+++ b/completions/freeciv-server
@@ -0,0 +1,28 @@
+# freeciv-server completion
+
+_civserver()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -f|-g|-l|-r|--file|--log|--gamelog|--read)
+ _filedir
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ fi
+
+} &&
+complete -F _civserver civserver freeciv-server
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/function b/completions/function
new file mode 100644
index 00000000..4916b2ac
--- /dev/null
+++ b/completions/function
@@ -0,0 +1,28 @@
+# bash shell function completion
+
+_function()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [[ $1 == @(declare|typeset) ]]; then
+ if [ "$prev" = -f ]; then
+ COMPREPLY=( $( compgen -A function -- "$cur" ) )
+ elif [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '-a -f -F -i -r -x -p' -- "$cur" ) )
+ fi
+ elif [ $cword -eq 1 ]; then
+ COMPREPLY=( $( compgen -A function -- "$cur" ) )
+ else
+ COMPREPLY=( "() $( type -- ${words[1]} | sed -e 1,2d )" )
+ fi
+} &&
+complete -F _function function declare typeset
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/fuse b/completions/fusermount
index 5c05e093..d00cc2a8 100644
--- a/completions/fuse
+++ b/completions/fusermount
@@ -1,4 +1,4 @@
-# bash completion for fuse
+# fusermount completion
_fusermount()
{
diff --git a/completions/genaliases b/completions/genaliases
new file mode 100644
index 00000000..d0099146
--- /dev/null
+++ b/completions/genaliases
@@ -0,0 +1,21 @@
+# mailman genaliases completion
+
+_genaliases()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '--quiet --help' -- "$cur" ) )
+ fi
+
+} &&
+complete -F _genaliases genaliases
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/gendiff b/completions/gendiff
new file mode 100644
index 00000000..51ef8a09
--- /dev/null
+++ b/completions/gendiff
@@ -0,0 +1,18 @@
+# gendiff(1) completion
+
+_gendiff()
+{
+ local cur prev words cword
+ _init_completion -o @(diff|patch) || return
+
+ [[ $cword -eq 1 ]] && _filedir -d
+} &&
+complete -F _gendiff gendiff
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/gpasswd b/completions/gpasswd
new file mode 100644
index 00000000..6ac932e3
--- /dev/null
+++ b/completions/gpasswd
@@ -0,0 +1,31 @@
+# gpasswd(1) completion
+
+_gpasswd()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -a|--add|-d|--delete|-A|--administrators|-M|--members)
+ COMPREPLY=( $( compgen -u -- "$cur" ) )
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ # TODO: only -A and -M can be combined
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ return 0
+ fi
+
+ COMPREPLY=( $( compgen -g -- "$cur" ) )
+} &&
+complete -F _gpasswd gpasswd
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/groupadd b/completions/groupadd
new file mode 100644
index 00000000..f074c20c
--- /dev/null
+++ b/completions/groupadd
@@ -0,0 +1,33 @@
+# groupadd(8) completion
+
+_groupadd()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ # TODO: if -o/--non-unique is given, could complete on existing gids
+ # with -g/--gid
+
+ case $prev in
+ -g|--gid|-K|--key|-p|--password)
+ return 0
+ ;;
+ esac
+
+ $split && return 0
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ return 0
+ fi
+} &&
+complete -F _groupadd groupadd
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/groupdel b/completions/groupdel
new file mode 100644
index 00000000..2e7af611
--- /dev/null
+++ b/completions/groupdel
@@ -0,0 +1,11 @@
+# groupdel(8) completion
+
+complete -g groupdel
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/groupmems b/completions/groupmems
new file mode 100644
index 00000000..0176cd0e
--- /dev/null
+++ b/completions/groupmems
@@ -0,0 +1,32 @@
+# groupmems(8) completion
+
+_groupmems()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -a|--add|-d|--delete)
+ COMPREPLY=( $( compgen -u -- "$cur" ) )
+ return 0
+ ;;
+ -g|--group)
+ COMPREPLY=( $( compgen -g -- "$cur" ) )
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ return 0
+ fi
+} &&
+complete -F _groupmems groupmems
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/groupmod b/completions/groupmod
new file mode 100644
index 00000000..73a4a791
--- /dev/null
+++ b/completions/groupmod
@@ -0,0 +1,35 @@
+# groupmod(8) completion
+
+_groupmod()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ # TODO: if -o/--non-unique is given, could complete on existing gids
+ # with -g/--gid
+
+ case $prev in
+ -g|--gid|-h|--help|-n|--new-name|-p|--password)
+ return 0
+ ;;
+ esac
+
+ $split && return 0
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ return 0
+ fi
+
+ COMPREPLY=( $( compgen -g -- "$cur" ) )
+} &&
+complete -F _groupmod groupmod
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/dvd+rw-tools b/completions/growisofs
index c2d61a76..583c5499 100644
--- a/completions/dvd+rw-tools
+++ b/completions/growisofs
@@ -1,4 +1,4 @@
-# dvd+rw-tools completions
+# growisofs(1) completion
_growisofs()
{
diff --git a/completions/grpck b/completions/grpck
new file mode 100644
index 00000000..6a1c093b
--- /dev/null
+++ b/completions/grpck
@@ -0,0 +1,23 @@
+# grpck(8) completion
+
+_grpck()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+ return 0
+ fi
+
+ _filedir
+} &&
+complete -F _grpck grpck
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/hid2hci b/completions/hid2hci
new file mode 100644
index 00000000..2c49cf7f
--- /dev/null
+++ b/completions/hid2hci
@@ -0,0 +1,21 @@
+# hid2hci completion
+
+_hid2hci()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '--help --quiet -0 --tohci -1 \
+ --tohid' -- "$cur" ) )
+ fi
+} &&
+complete -F _hid2hci hid2hci
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/id b/completions/id
new file mode 100644
index 00000000..6c15c829
--- /dev/null
+++ b/completions/id
@@ -0,0 +1,24 @@
+# id(1) completion
+
+_id()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [[ "$cur" == -* ]]; then
+ local opts=$( _parse_help "$1" )
+ [[ $opts ]] || opts="-G -g -u" # POSIX fallback
+ COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) )
+ else
+ COMPREPLY=( $( compgen -u "$cur" ) )
+ fi
+} &&
+complete -F _id id
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/ifupdown b/completions/ifup
index aab9bbca..aab9bbca 100644
--- a/completions/ifupdown
+++ b/completions/ifup
diff --git a/completions/module-init-tools b/completions/insmod
index 44dee0a9..fa84d76e 100644
--- a/completions/module-init-tools
+++ b/completions/insmod
@@ -1,18 +1,3 @@
-# bash completion for Linux module-init-tools
-
-# Linux rmmod(8) completion. This completes on a list of all currently
-# installed kernel modules.
-#
-_rmmod()
-{
- local cur prev words cword
- _init_completion || return
-
- _installed_modules "$cur"
- return 0
-} &&
-complete -F _rmmod rmmod
-
# Linux insmod(8), modprobe(8) and modinfo(8) completion. This completes on a
# list of all available modules for the version of the kernel currently
# running.
diff --git a/completions/invoke-rc.d b/completions/invoke-rc.d
new file mode 100644
index 00000000..670e9968
--- /dev/null
+++ b/completions/invoke-rc.d
@@ -0,0 +1,45 @@
+# invoke-rc.d(8) completion
+#
+# Copyright (C) 2004 Servilio Afre Puentes <servilio@gmail.com>
+
+_invoke_rc_d()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ local sysvdir services options valid_options
+
+ [ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d \
+ || sysvdir=/etc/init.d
+
+ services=( $( printf '%s ' $sysvdir/!(README*|*.sh|$_backup_glob) ) )
+ services=( ${services[@]#$sysvdir/} )
+ options=( --help --quiet --force --try-anyway --disclose-deny --query \
+ --no-fallback )
+
+ if [[ ($cword -eq 1) || ("$prev" == --* ) ]]; then
+ valid_options=( $( \
+ tr " " "\n" <<<"${words[@]} ${options[@]}" \
+ | sed -ne "/$( sed "s/ /\\\\|/g" <<<"${options[@]}" )/p" \
+ | sort | uniq -u \
+ ) )
+ COMPREPLY=( $( compgen -W '${valid_options[@]} ${services[@]}' -- "$cur" ) )
+ elif [ -x $sysvdir/$prev ]; then
+ COMPREPLY=( $( compgen -W '`sed -e "y/|/ /" \
+ -ne "s/^.*Usage:[ ]*[^ ]*[ ]*{*\([^}\"]*\).*$/\1/p" \
+ $sysvdir/$prev`' -- "$cur" ) )
+ else
+ COMPREPLY=()
+ fi
+
+ return 0
+} &&
+complete -F _invoke_rc_d invoke-rc.d
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/ionice b/completions/ionice
new file mode 100644
index 00000000..0af68a7a
--- /dev/null
+++ b/completions/ionice
@@ -0,0 +1,63 @@
+# ionice(1) completion
+
+_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
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/iproute2 b/completions/ip
index 7ef48325..0d431e4f 100644
--- a/completions/iproute2
+++ b/completions/ip
@@ -1,4 +1,4 @@
-# iproute2 tools completion
+# ip(8) completion
_ip()
{
diff --git a/completions/open-iscsi b/completions/iscsiadm
index 46170635..46170635 100644
--- a/completions/open-iscsi
+++ b/completions/iscsiadm
diff --git a/completions/jarsigner b/completions/jarsigner
new file mode 100644
index 00000000..982f7a4b
--- /dev/null
+++ b/completions/jarsigner
@@ -0,0 +1,62 @@
+# jarsigner(1) completion
+
+_jarsigner()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -keystore)
+ COMPREPLY=( $( compgen -W 'NONE' -- "$cur" ) )
+ _filedir '@(jks|ks|p12|pfx)'
+ return 0
+ ;;
+ -storepass|-keypass|-sigfile|-digestalg|-sigalg|-tsacert|-altsigner|\
+ -altsignerpath|-providerName|-providerClass|-providerArg)
+ return 0
+ ;;
+ -storetype)
+ COMPREPLY=( $( compgen -W 'JKS PKCS11 PKCS12' -- "$cur" ) )
+ return 0
+ ;;
+ -signedjar)
+ _filedir jar
+ return 0
+ ;;
+ -tsa)
+ _filedir
+ return 0
+ ;;
+ esac
+
+ # Check if a jar was already given.
+ local i jar=false
+ for (( i=0; i < ${#words[@]}-1; i++ )) ; do
+ if [[ "${words[i]}" == *.jar && \
+ "${words[i-1]}" != -signedjar ]] ; then
+ jar=true
+ break
+ fi
+ done
+
+ if ! $jar ; then
+ if [[ "$cur" == -* ]] ; then
+ # Documented as "should not be used": -internalsf, -sectionsonly
+ COMPREPLY=( $( compgen -W '-keystore -storepass -storetype \
+ -keypass -sigfile -signedjar -digestalg -sigalg -verify \
+ -verbose -certs -tsa -tsacert -altsigner -altsignerpath \
+ -protected -providerName -providerClass -providerArg' \
+ -- "$cur" ) )
+ fi
+ _filedir jar
+ fi
+} &&
+complete -F _jarsigner jarsigner
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/java b/completions/java
index 55ea57a4..bd8b6471 100644
--- a/completions/java
+++ b/completions/java
@@ -315,229 +315,6 @@ _javac()
} &&
complete -F _javac javac
-_pack200()
-{
- local cur prev words cword split
- _init_completion -s || return
-
- case $prev in
- -S|--segment-limit|-P|--pass-file|-C|--class-attribute|\
- -F|--field-attribute|-M|--method-attribute|-D|--code-attribute|\
- '-?'|-h|--help|-V|--version|-J)
- return 0
- ;;
- -E|--effort)
- COMPREPLY=( $( compgen -W '{0..9}' -- "$cur" ) )
- return 0
- ;;
- -H|--deflate-hint)
- COMPREPLY=( $( compgen -W 'true false keep' -- "$cur" ) )
- return 0
- ;;
- -m|--modification-time)
- COMPREPLY=( $( compgen -W 'latest keep' -- "$cur" ) )
- return 0
- ;;
- -U|--unknown-attribute)
- COMPREPLY=( $( compgen -W 'error strip pass' -- "$cur" ) )
- return 0
- ;;
- -f|--config-file)
- _filedir properties
- return 0
- ;;
- -l|--log-file)
- COMPREPLY=( $( compgen -W '-' -- "$cur" ) )
- _filedir log
- return 0
- ;;
- -r|--repack)
- _filedir jar
- return 0
- ;;
- esac
-
- $split && return
-
- # Check if a pack or a jar was already given.
- local i pack=false jar=false
- for (( i=0; i < ${#words[@]}-1; i++ )) ; do
- case ${words[i]} in
- *.pack|*.pack.gz) pack=true ;;
- *.jar) jar=true ;;
- esac
- done
-
- if ! $pack ; then
- if [[ "$cur" == -* ]] ; then
- COMPREPLY=( $( compgen -W '--no-gzip --gzip --strip-debug \
- --no-keep-file-order --segment-limit= --effort= \
- --deflate-hint= --modification-time= --pass-file= \
- --unknown-attribute= --class-attribute= --field-attribute= \
- --method-attribute= --code-attribute= --config-file= \
- --verbose --quiet --log-file= --help --version -J \
- --repack' -- "$cur" ) )
- [[ $COMPREPLY == *= ]] && compopt -o nospace
- else
- _filedir 'pack?(.gz)'
- fi
- elif ! $jar ; then
- _filedir jar
- fi
-} &&
-complete -F _pack200 pack200
-
-_unpack200()
-{
- local cur prev words cword split
- _init_completion -s || return
-
- case $prev in
- '-?'|-h|--help|-V|--version|-J)
- return 0
- ;;
- -H|--deflate-hint)
- COMPREPLY=( $( compgen -W 'true false keep' -- "$cur" ) )
- return 0
- ;;
- -l|--log-file)
- COMPREPLY=( $( compgen -W '-' -- "$cur" ) )
- _filedir log
- return 0
- ;;
- esac
-
- $split && return
-
- # Check if a pack or a jar was already given.
- local i pack=false jar=false
- for (( i=0; i < ${#words[@]}-1; i++ )) ; do
- case ${words[i]} in
- *.pack|*.pack.gz) pack=true ;;
- *.jar) jar=true ;;
- esac
- done
-
- if ! $pack ; then
- if [[ "$cur" == -* ]] ; then
- COMPREPLY=( $( compgen -W '--deflate-hint= --remove-pack-file \
- --verbose --quiet --log-file= --help --version' -- "$cur" ) )
- [[ $COMPREPLY == *= ]] && compopt -o nospace
- else
- _filedir 'pack?(.gz)'
- fi
- elif ! $jar ; then
- _filedir jar
- fi
-} &&
-complete -F _unpack200 unpack200
-
-_jarsigner()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -keystore)
- COMPREPLY=( $( compgen -W 'NONE' -- "$cur" ) )
- _filedir '@(jks|ks|p12|pfx)'
- return 0
- ;;
- -storepass|-keypass|-sigfile|-digestalg|-sigalg|-tsacert|-altsigner|\
- -altsignerpath|-providerName|-providerClass|-providerArg)
- return 0
- ;;
- -storetype)
- COMPREPLY=( $( compgen -W 'JKS PKCS11 PKCS12' -- "$cur" ) )
- return 0
- ;;
- -signedjar)
- _filedir jar
- return 0
- ;;
- -tsa)
- _filedir
- return 0
- ;;
- esac
-
- # Check if a jar was already given.
- local i jar=false
- for (( i=0; i < ${#words[@]}-1; i++ )) ; do
- if [[ "${words[i]}" == *.jar && \
- "${words[i-1]}" != -signedjar ]] ; then
- jar=true
- break
- fi
- done
-
- if ! $jar ; then
- if [[ "$cur" == -* ]] ; then
- # Documented as "should not be used": -internalsf, -sectionsonly
- COMPREPLY=( $( compgen -W '-keystore -storepass -storetype \
- -keypass -sigfile -signedjar -digestalg -sigalg -verify \
- -verbose -certs -tsa -tsacert -altsigner -altsignerpath \
- -protected -providerName -providerClass -providerArg' \
- -- "$cur" ) )
- fi
- _filedir jar
- fi
-} &&
-complete -F _jarsigner jarsigner
-
-_javaws()
-{
- local cur prev words cword
- _init_completion -n = || return
-
- case $prev in
- -help|-license|-about|-viewer|-arg|-param|-property|-update|-umask)
- return 0
- ;;
- -basedir|-codebase)
- _filedir -d
- return 0
- ;;
- -uninstall|-import)
- _filedir jnlp
- return 0
- ;;
- esac
-
- if [[ $cur == *= ]]; then
- return 0
- elif [[ $cur == -* ]]; then
- COMPREPLY=( $( compgen -W "$( _parse_help "$1" -help ) " -- "$cur" ) )
- [[ $COMPREPLY == *= ]] && compopt -o nospace
- return 0
- fi
-
- _filedir jnlp
-} &&
-complete -F _javaws javaws
-
-_jps()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -J*|-help)
- return
- ;;
- esac
-
- if [[ $cur == -* ]]; then
- # Not using _parse_usage because output has [-help] which does not
- # mean -h, -e, -l, -p...
- COMPREPLY=( $( compgen -W "-q -m -l -v -V -J -help" -- "$cur" ) )
- [[ $COMPREPLY == -J* ]] && compopt -o nospace
- else
- _known_hosts_real "$cur"
- fi
-} &&
-complete -F _jps jps
-
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
diff --git a/completions/javaws b/completions/javaws
new file mode 100644
index 00000000..03f6c883
--- /dev/null
+++ b/completions/javaws
@@ -0,0 +1,40 @@
+# javaws(1) completion
+
+_javaws()
+{
+ local cur prev words cword
+ _init_completion -n = || return
+
+ case $prev in
+ -help|-license|-about|-viewer|-arg|-param|-property|-update|-umask)
+ return 0
+ ;;
+ -basedir|-codebase)
+ _filedir -d
+ return 0
+ ;;
+ -uninstall|-import)
+ _filedir jnlp
+ return 0
+ ;;
+ esac
+
+ if [[ $cur == *= ]]; then
+ return 0
+ elif [[ $cur == -* ]]; then
+ COMPREPLY=( $( compgen -W "$( _parse_help "$1" -help ) " -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ return 0
+ fi
+
+ _filedir jnlp
+} &&
+complete -F _javaws javaws
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/jps b/completions/jps
new file mode 100644
index 00000000..bf62d573
--- /dev/null
+++ b/completions/jps
@@ -0,0 +1,31 @@
+# jps(1) completion
+
+_jps()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -J*|-help)
+ return
+ ;;
+ esac
+
+ if [[ $cur == -* ]]; then
+ # Not using _parse_usage because output has [-help] which does not
+ # mean -h, -e, -l, -p...
+ COMPREPLY=( $( compgen -W "-q -m -l -v -V -J -help" -- "$cur" ) )
+ [[ $COMPREPLY == -J* ]] && compopt -o nospace
+ else
+ _known_hosts_real "$cur"
+ fi
+} &&
+complete -F _jps jps
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/kill b/completions/kill
new file mode 100644
index 00000000..d3c5fbe7
--- /dev/null
+++ b/completions/kill
@@ -0,0 +1,24 @@
+# kill(1) completion
+
+_kill()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [[ $cword -eq 1 && "$cur" == -* ]]; then
+ # return list of available signals
+ _signals
+ else
+ # return list of available PIDs
+ _pids
+ fi
+} &&
+complete -F _kill kill
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/killall b/completions/killall
new file mode 100644
index 00000000..162e2382
--- /dev/null
+++ b/completions/killall
@@ -0,0 +1,25 @@
+# killall(1) (Linux, FreeBSD and Darwin) and pkill(1) completion.
+
+_killall()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [[ $cword -eq 1 && "$cur" == -* ]]; then
+ _signals
+ else
+ _pnames
+ fi
+
+ return 0
+} &&
+complete -F _killall pkill
+[[ $UNAME == @(Linux|FreeBSD|Darwin) ]] && complete -F _killall killall
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/kldload b/completions/kldload
index d8249539..b4deff90 100644
--- a/completions/kldload
+++ b/completions/kldload
@@ -1,4 +1,4 @@
-# bash completion for FreeBSD kernel module commands
+# FreeBSD kldload completion
[ $UNAME = FreeBSD ] || return 1
@@ -19,16 +19,6 @@ _kldload()
} &&
complete -F _kldload kldload
-_kldunload()
-{
- local cur prev words cword
- _init_completion || return
-
- COMPREPLY=( $( kldstat | \
- sed -ne "s/^.*[ \t]\{1,\}\($cur[a-z_]\{1,\}\).ko$/\1/p" ) )
-} &&
-complete -F _kldunload kldunload
-
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
diff --git a/completions/kldunload b/completions/kldunload
new file mode 100644
index 00000000..fa455414
--- /dev/null
+++ b/completions/kldunload
@@ -0,0 +1,21 @@
+# FreeBSD kldunload completion
+
+[ $UNAME = FreeBSD ] || return 1
+
+_kldunload()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ COMPREPLY=( $( kldstat | \
+ sed -ne "s/^.*[ \t]\{1,\}\($cur[a-z_]\{1,\}\).ko$/\1/p" ) )
+} &&
+complete -F _kldunload kldunload
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/heimdal b/completions/ktutil
index 01744fad..bda4ae14 100644
--- a/completions/heimdal
+++ b/completions/ktutil
@@ -1,4 +1,4 @@
-# bash completion for heimdal
+# ktutil completion
_heimdal_principals()
{
diff --git a/completions/lastlog b/completions/lastlog
new file mode 100644
index 00000000..cadc518b
--- /dev/null
+++ b/completions/lastlog
@@ -0,0 +1,34 @@
+# lastlog(8) completion
+
+_lastlog()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ case $prev in
+ -b|--before|-h|--help|-t|--time)
+ return 0
+ ;;
+ -u|--user)
+ COMPREPLY=( $( compgen -u -- "$cur" ) )
+ return 0
+ ;;
+ esac
+
+ $split && return 0
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ return 0
+ fi
+} &&
+complete -F _lastlog lastlog
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/lftp b/completions/lftp
index 984a67e8..9e47ae16 100644
--- a/completions/lftp
+++ b/completions/lftp
@@ -1,4 +1,4 @@
-# bash completion for lftp
+# lftp(1) completion
_lftp()
{
@@ -26,17 +26,6 @@ _lftp()
} &&
complete -F _lftp lftp
-_lftpget()
-{
- local cur prev words cword
- _init_completion || return
-
- if [[ "$cur" == -* ]] ; then
- COMPREPLY=( $( compgen -W '-c -d -v' -- "$cur" ) )
- fi
-} &&
-complete -F _lftpget lftpget
-
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
diff --git a/completions/lftpget b/completions/lftpget
new file mode 100644
index 00000000..9ed6a5c7
--- /dev/null
+++ b/completions/lftpget
@@ -0,0 +1,20 @@
+# lftpget(1) completion
+
+_lftpget()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [[ "$cur" == -* ]] ; then
+ COMPREPLY=( $( compgen -W '-c -d -v' -- "$cur" ) )
+ fi
+} &&
+complete -F _lftpget lftpget
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/list_lists b/completions/list_lists
new file mode 100644
index 00000000..4ffbdb98
--- /dev/null
+++ b/completions/list_lists
@@ -0,0 +1,22 @@
+# mailman list_lists completion
+
+_list_lists()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '--advertised --virtual-host-overview \
+ --bare --help' -- "$cur" ) )
+ fi
+
+} &&
+complete -F _list_lists list_lists
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/look b/completions/look
new file mode 100644
index 00000000..e339958e
--- /dev/null
+++ b/completions/look
@@ -0,0 +1,20 @@
+# look(1) completion
+
+_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
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/lpq b/completions/lpq
new file mode 100644
index 00000000..13bfc426
--- /dev/null
+++ b/completions/lpq
@@ -0,0 +1,34 @@
+# lpq(1) completion
+
+_lpq()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -P)
+ COMPREPLY=( $( compgen -W "$( lpstat -a 2>/dev/null | cut -d' ' -f1 )" -- "$cur" ) )
+ return 0
+ ;;
+ -U)
+ COMPREPLY=( $( compgen -u -- "$cur" ) )
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == - ]]; then
+ COMPREPLY=( $( compgen -W '-E -P -U -a -h -l' -- "$cur" ) )
+ return 0
+ fi
+
+ _filedir
+} &&
+complete -F _lpq lpq
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/cups b/completions/lpr
index 2a2ab4db..6c121df6 100644
--- a/completions/cups
+++ b/completions/lpr
@@ -1,13 +1,4 @@
-# bash completion for cups
-
-_cancel()
-{
- local cur prev words cword
- _init_completion || return
-
- COMPREPLY=( $( compgen -W "$( lpstat 2>/dev/null | cut -d' ' -f1 )" -- "$cur" ) )
-} &&
-complete -F _cancel cancel
+# lpr(1) completion
_lpr()
{
@@ -39,31 +30,6 @@ _lpr()
} &&
complete -F _lpr lpr
-_lpq()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -P)
- COMPREPLY=( $( compgen -W "$( lpstat -a 2>/dev/null | cut -d' ' -f1 )" -- "$cur" ) )
- return 0
- ;;
- -U)
- COMPREPLY=( $( compgen -u -- "$cur" ) )
- return 0
- ;;
- esac
-
- if [[ "$cur" == - ]]; then
- COMPREPLY=( $( compgen -W '-E -P -U -a -h -l' -- "$cur" ) )
- return 0
- fi
-
- _filedir
-} &&
-complete -F _lpq lpq
-
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
diff --git a/completions/macof b/completions/macof
new file mode 100644
index 00000000..6819674e
--- /dev/null
+++ b/completions/macof
@@ -0,0 +1,29 @@
+# macof completion
+
+_macof()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -i)
+ _interfaces
+ return 0
+ ;;
+ esac
+
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+ fi
+
+} &&
+complete -F _macof macof
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/mailman b/completions/mailman
index ba1d08c7..1f8aa951 100644
--- a/completions/mailman
+++ b/completions/mailman
@@ -5,19 +5,6 @@ _mailman_lists()
COMPREPLY=( $( compgen -W '$( list_lists -b )' -- "$cur" ) )
}
-_list_lists()
-{
- local cur prev words cword
- _init_completion || return
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '--advertised --virtual-host-overview \
- --bare --help' -- "$cur" ) )
- fi
-
-} &&
-complete -F _list_lists list_lists
-
_add_members()
{
local cur prev words cword split
@@ -143,20 +130,6 @@ _sync_members()
} &&
complete -F _sync_members sync_members
-_unshunt()
-{
- local cur prev words cword
- _init_completion || return
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '--help' -- "$cur" ) )
- else
- _filedir -d
- fi
-
-} &&
-complete -F _unshunt unshunt
-
_list_admins()
{
local cur prev words cword
@@ -352,19 +325,6 @@ _arch()
} &&
complete -F _arch arch
-_cleanarch()
-{
- local cur prev words cword
- _init_completion || return
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '--status --dry-run --quiet \
- --help' -- "$cur" ) )
- fi
-
-} &&
-complete -F _cleanarch cleanarch
-
_inject()
{
local cur prev words cword split
@@ -388,21 +348,6 @@ _inject()
} &&
complete -F _inject inject
-_dumpdb()
-{
- local cur prev words cword
- _init_completion || return
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '--marshal --pickle --noprint \
- --help' -- "$cur" ) )
- else
- _filedir
- fi
-
-} &&
-complete -F _dumpdb dumpdb
-
_check_db()
{
local cur prev words cword
@@ -417,72 +362,6 @@ _check_db()
} &&
complete -F _check_db check_db
-_check_perms()
-{
- local cur prev words cword
- _init_completion || return
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '-f -v -h' -- "$cur" ) )
- fi
-
-} &&
-complete -F _check_perms check_perms
-
-_genaliases()
-{
- local cur prev words cword
- _init_completion || return
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '--quiet --help' -- "$cur" ) )
- fi
-
-} &&
-complete -F _genaliases genaliases
-
-_mmsitepass()
-{
- local cur prev words cword
- _init_completion || return
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '--listcreator --help' -- "$cur" ) )
- fi
-
-} &&
-complete -F _mmsitepass mmsitepass
-
-_qrunner()
-{
- local cur prev words cword split
- _init_completion -s || return
-
- $split && return 0
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '--runner --once \
- --list --verbose --subproc --help' -- "$cur" ) )
- fi
-
-} &&
-complete -F _qrunner qrunner
-
-_mailmanctl()
-{
- local cur prev words cword
- _init_completion || return
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '--no-restart --run-as-user \
- --stale-lock-cleanup --quiet --help' -- "$cur" ) )
- else
- COMPREPLY=( $( compgen -W 'start stop restart reopen' -- "$cur" ) )
- fi
-
-} &&
-complete -F _mailmanctl mailmanctl
-
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
diff --git a/completions/mailmanctl b/completions/mailmanctl
new file mode 100644
index 00000000..4ff61691
--- /dev/null
+++ b/completions/mailmanctl
@@ -0,0 +1,24 @@
+# mailmanctl completion
+
+_mailmanctl()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '--no-restart --run-as-user \
+ --stale-lock-cleanup --quiet --help' -- "$cur" ) )
+ else
+ COMPREPLY=( $( compgen -W 'start stop restart reopen' -- "$cur" ) )
+ fi
+
+} &&
+complete -F _mailmanctl mailmanctl
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/mdtool b/completions/mdtool
new file mode 100644
index 00000000..5b052b93
--- /dev/null
+++ b/completions/mdtool
@@ -0,0 +1,68 @@
+# mdtool completion
+
+_mdtool()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ local command i
+
+ for (( i=0; i < ${#words[@]}-1; i++ )); do
+ if [[ ${words[i]} == @(build|generate-makefiles|setup) ]]; then
+ command=${words[i]}
+ fi
+ done
+
+ if [[ -n "$command" ]]; then
+ case $command in
+ "build")
+ COMPREPLY=( $( compgen -W '--f --buildfile --p --project' \
+ -S":" -- "$cur" ) )
+ # TODO: This does not work :(
+ #if [[ "$prev" == *: ]]; then
+ # case $prev in
+ # @(--p:|--project:))
+ # COMPREPLY=( $( compgen -f -G "*.mdp" -- "$cur" ) )
+ # ;;
+ # @(--f:|--buildfile:))
+ # COMPREPLY=( $( compgen -f -G "*.mdp" -G "*.mds" -- "$cur" ) )
+ # ;;
+ # esac
+ #fi
+ return 0
+ ;;
+ "generate-makefiles")
+ compopt -o filenames
+ COMPREPLY=( $( compgen -o filenames -G"*.mds" -- "$cur" ) )
+ if [[ "$prev" == *mds ]]; then
+ COMPREPLY=( $( compgen -W '--simple-makefiles --s --d:' \
+ -- "$cur" ) )
+ fi
+ return 0
+ ;;
+ "setup")
+ # TODO: at least return filenames after these options.
+ COMPREPLY=( $( compgen -W 'install i uninstall u check-install \
+ ci update up list l list-av la list-update lu rep-add ra \
+ rep-remove rr rep-update ru rep-list rl reg-update \
+ reg-build rgu info rep-build rb pack p help h dump-file' \
+ -- "$cur" ) )
+ return 0
+ ;;
+ esac
+ fi
+
+ COMPREPLY=( $( compgen -W 'gsetup build dbgen project-export \
+ generate-makefiles gettext-update setup -q' -- "$cur" ) )
+
+ return 0
+} &&
+complete -F _mdtool mdtool
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/mii-diag b/completions/mii-diag
new file mode 100644
index 00000000..1b19e0c6
--- /dev/null
+++ b/completions/mii-diag
@@ -0,0 +1,33 @@
+# mii-diag(8) completion
+
+_mii_diag()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ case $prev in
+ -F|-A|--advertise|--fixed-speed)
+ COMPREPLY=( $( compgen -W '100baseT4 100baseTx \
+ 100baseTx-FD 100baseTx-HD 10baseT 10baseT-FD \
+ 10baseT-HD' -- "$cur" ) )
+ return 0
+ ;;
+ esac
+
+ $split && return 0
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ else
+ _available_interfaces -a
+ fi
+} &&
+complete -F _mii_diag -o default mii-diag
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/mii-tool b/completions/mii-tool
new file mode 100644
index 00000000..9cb4d70b
--- /dev/null
+++ b/completions/mii-tool
@@ -0,0 +1,38 @@
+# mii-tool(8) completion
+
+_mii_tool()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ case $prev in
+ -F|--force)
+ COMPREPLY=( $( compgen -W '100baseTx-FD 100baseTx-HD \
+ 10baseT-FD 10baseT-HD' -- "$cur" ) )
+ return 0
+ ;;
+ -A|--advertise)
+ COMPREPLY=( $( compgen -W '100baseT4 100baseTx-FD 100baseTx-HD \
+ 10baseT-FD 10baseT-HD' -- "$cur" ) )
+ return 0
+ ;;
+ esac
+
+ $split && return 0
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ else
+ _available_interfaces -a
+ fi
+} &&
+complete -F _mii_tool -o default mii-tool
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/mktemp b/completions/mktemp
new file mode 100644
index 00000000..cdb0e822
--- /dev/null
+++ b/completions/mktemp
@@ -0,0 +1,35 @@
+# mktemp(1) completion
+
+_mktemp()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ case "$prev" in
+ --help|--version|--suffix)
+ return 0
+ ;;
+ --tmpdir|-p)
+ _filedir -d
+ return 0
+ ;;
+ esac
+
+ $split && return 0
+
+ if [[ "$cur" == -* ]]; then
+ local opts=$( _parse_help "$1" )
+ [[ $opts ]] || opts="-d -u -q -p -t" # non-GNU fallback
+ COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ fi
+} &&
+complete -F _mktemp mktemp
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/mmsitepass b/completions/mmsitepass
new file mode 100644
index 00000000..a07c272a
--- /dev/null
+++ b/completions/mmsitepass
@@ -0,0 +1,21 @@
+# mailman mmsitepass completion
+
+_mmsitepass()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '--listcreator --help' -- "$cur" ) )
+ fi
+
+} &&
+complete -F _mmsitepass mmsitepass
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/monodevelop b/completions/monodevelop
index ca035699..50cf5784 100644
--- a/completions/monodevelop
+++ b/completions/monodevelop
@@ -1,4 +1,4 @@
-# Monodevelop completion
+# monodevelop completion
_monodevelop()
{
@@ -17,65 +17,6 @@ _monodevelop()
} &&
complete -F _monodevelop monodevelop
-_mdtool()
-{
- local cur prev words cword
- _init_completion || return
-
- local command i
-
- for (( i=0; i < ${#words[@]}-1; i++ )); do
- if [[ ${words[i]} == @(build|generate-makefiles|setup) ]]; then
- command=${words[i]}
- fi
- done
-
- if [[ -n "$command" ]]; then
- case $command in
- "build")
- COMPREPLY=( $( compgen -W '--f --buildfile --p --project' \
- -S":" -- "$cur" ) )
- # TODO: This does not work :(
- #if [[ "$prev" == *: ]]; then
- # case $prev in
- # @(--p:|--project:))
- # COMPREPLY=( $( compgen -f -G "*.mdp" -- "$cur" ) )
- # ;;
- # @(--f:|--buildfile:))
- # COMPREPLY=( $( compgen -f -G "*.mdp" -G "*.mds" -- "$cur" ) )
- # ;;
- # esac
- #fi
- return 0
- ;;
- "generate-makefiles")
- compopt -o filenames
- COMPREPLY=( $( compgen -o filenames -G"*.mds" -- "$cur" ) )
- if [[ "$prev" == *mds ]]; then
- COMPREPLY=( $( compgen -W '--simple-makefiles --s --d:' \
- -- "$cur" ) )
- fi
- return 0
- ;;
- "setup")
- # TODO: at least return filenames after these options.
- COMPREPLY=( $( compgen -W 'install i uninstall u check-install \
- ci update up list l list-av la list-update lu rep-add ra \
- rep-remove rr rep-update ru rep-list rl reg-update \
- reg-build rgu info rep-build rb pack p help h dump-file' \
- -- "$cur" ) )
- return 0
- ;;
- esac
- fi
-
- COMPREPLY=( $( compgen -W 'gsetup build dbgen project-export \
- generate-makefiles gettext-update setup -q' -- "$cur" ) )
-
- return 0
-} &&
-complete -F _mdtool mdtool
-
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
diff --git a/completions/munin-node b/completions/munin-node
deleted file mode 100644
index 5d69dd71..00000000
--- a/completions/munin-node
+++ /dev/null
@@ -1,98 +0,0 @@
-# bash completion for munin node
-
-_munin_run()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- --config|--sconffile)
- _filedir
- return 0
- ;;
- --servicedir|--sconfdir)
- _filedir -d
- return 0
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- else
- COMPREPLY=( $( compgen -W '$( command ls /etc/munin/plugins )' \
- -- "$cur" ) )
- fi
-} &&
-complete -F _munin_run munin-run
-
-_munindoc()
-{
- local cur prev words cword
- _init_completion || return
-
- COMPREPLY=( $( compgen -W '$( command ls /usr/share/munin/plugins )' \
- -- "$cur" ) )
-} &&
-complete -F _munindoc munindoc
-
-_munin_update()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- --config)
- _filedir
- return 0
- ;;
- --host)
- _known_hosts_real "$cur"
- return 0
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '--force-root --[no]force-root \
- --service --host --config --help --debug --nodebug \
- --fork --nofork --stdout --nostdout --timeout' -- "$cur" ) )
- fi
-} &&
-complete -F _munin_update munin-update
-
-_munin_node_configure()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- --config)
- _filedir
- return 0
- ;;
- --servicedir|--libdir)
- _filedir -d
- return 0
- ;;
- --snmp)
- _known_hosts_real "$cur"
- return 0
- ;;
- --snmpversion)
- COMPREPLY=( $( compgen -W '1 2c 3' -- "$cur" ) )
- return 0
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- fi
-} &&
-complete -F _munin_node_configure munin-node-configure
-
-# Local variables:
-# mode: shell-script
-# sh-basic-offset: 4
-# sh-indent-comment: t
-# indent-tabs-mode: nil
-# End:
-# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/munin-node-configure b/completions/munin-node-configure
new file mode 100644
index 00000000..2e4e4b16
--- /dev/null
+++ b/completions/munin-node-configure
@@ -0,0 +1,39 @@
+# munin-node-configure completion
+
+_munin_node_configure()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ --config)
+ _filedir
+ return 0
+ ;;
+ --servicedir|--libdir)
+ _filedir -d
+ return 0
+ ;;
+ --snmp)
+ _known_hosts_real "$cur"
+ return 0
+ ;;
+ --snmpversion)
+ COMPREPLY=( $( compgen -W '1 2c 3' -- "$cur" ) )
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ fi
+} &&
+complete -F _munin_node_configure munin-node-configure
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/munin-run b/completions/munin-run
new file mode 100644
index 00000000..cf8ad9c1
--- /dev/null
+++ b/completions/munin-run
@@ -0,0 +1,34 @@
+# munin-run completion
+
+_munin_run()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ --config|--sconffile)
+ _filedir
+ return 0
+ ;;
+ --servicedir|--sconfdir)
+ _filedir -d
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ else
+ COMPREPLY=( $( compgen -W '$( command ls /etc/munin/plugins )' \
+ -- "$cur" ) )
+ fi
+} &&
+complete -F _munin_run munin-run
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/munin-update b/completions/munin-update
new file mode 100644
index 00000000..d7799fbf
--- /dev/null
+++ b/completions/munin-update
@@ -0,0 +1,33 @@
+# munin-update completion
+
+_munin_update()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ --config)
+ _filedir
+ return 0
+ ;;
+ --host)
+ _known_hosts_real "$cur"
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '--force-root --[no]force-root \
+ --service --host --config --help --debug --nodebug \
+ --fork --nofork --stdout --nostdout --timeout' -- "$cur" ) )
+ fi
+} &&
+complete -F _munin_update munin-update
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/munindoc b/completions/munindoc
new file mode 100644
index 00000000..1c8bb482
--- /dev/null
+++ b/completions/munindoc
@@ -0,0 +1,19 @@
+# munindoc completion
+
+_munindoc()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ COMPREPLY=( $( compgen -W '$( command ls /usr/share/munin/plugins )' \
+ -- "$cur" ) )
+} &&
+complete -F _munindoc munindoc
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/net-tools b/completions/net-tools
deleted file mode 100644
index 0019ce77..00000000
--- a/completions/net-tools
+++ /dev/null
@@ -1,114 +0,0 @@
-# bash completion for net tools
-
-_mii_tool()
-{
- local cur prev words cword split
- _init_completion -s || return
-
- case $prev in
- -F|--force)
- COMPREPLY=( $( compgen -W '100baseTx-FD 100baseTx-HD \
- 10baseT-FD 10baseT-HD' -- "$cur" ) )
- return 0
- ;;
- -A|--advertise)
- COMPREPLY=( $( compgen -W '100baseT4 100baseTx-FD 100baseTx-HD \
- 10baseT-FD 10baseT-HD' -- "$cur" ) )
- return 0
- ;;
- esac
-
- $split && return 0
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- [[ $COMPREPLY == *= ]] && compopt -o nospace
- else
- _available_interfaces -a
- fi
-} &&
-complete -F _mii_tool -o default mii-tool
-
-_mii_diag()
-{
- local cur prev words cword split
- _init_completion -s || return
-
- case $prev in
- -F|-A|--advertise|--fixed-speed)
- COMPREPLY=( $( compgen -W '100baseT4 100baseTx \
- 100baseTx-FD 100baseTx-HD 10baseT 10baseT-FD \
- 10baseT-HD' -- "$cur" ) )
- return 0
- ;;
- esac
-
- $split && return 0
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- else
- _available_interfaces -a
- fi
-} &&
-complete -F _mii_diag -o default mii-diag
-
-# Linux route(8) completion
-#
-[ $UNAME = Linux ] &&
-_route()
-{
- local cur prev words cword
- _init_completion || return
-
- if [ "$prev" = dev ]; then
- _available_interfaces
- return 0
- fi
-
- # Remove already given options from completions
- local opt found i
- for opt in add del -host -net netmask metric mss window irtt reject mod \
- dyn reinstate dev default gw; do
- found=false
- for (( i=1; i < ${#words[@]}-1; i++ )); do
- [ "${words[i]}" = "$opt" ] && found=true && break
- done
- $found || COMPREPLY[${#COMPREPLY[@]}]="$opt"
- done
-
- COMPREPLY=( $( compgen -W '"${COMPREPLY[@]}"' -- "$cur" ) )
-} &&
-complete -F _route route
-
-_ether_wake()
-{
- local cur prev words cword
- _init_completion -n : || return
-
- case $prev in
- -i)
- _available_interfaces
- return 0
- ;;
- -p)
- return 0
- ;;
- esac
-
- if [[ $cur == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" -u ) -V' -- "$cur" ) )
- return 0
- fi
-
- _mac_addresses
-} &&
-complete -F _ether_wake ether-wake
-
-# Local variables:
-# mode: shell-script
-# sh-basic-offset: 4
-# sh-indent-comment: t
-# indent-tabs-mode: nil
-# End:
-# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/newgrp b/completions/newgrp
new file mode 100644
index 00000000..c3979546
--- /dev/null
+++ b/completions/newgrp
@@ -0,0 +1,22 @@
+# newgrp(1) completion
+
+_newgrp()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [[ "$cur" == "-" ]]; then
+ COMPREPLY=( - )
+ else
+ _allowed_groups "$cur"
+ fi
+} &&
+complete -F _newgrp newgrp
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/newusers b/completions/newusers
new file mode 100644
index 00000000..1a102aac
--- /dev/null
+++ b/completions/newusers
@@ -0,0 +1,37 @@
+# newusers(8) completion
+
+_newusers()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ case $prev in
+ -c|--crypt)
+ COMPREPLY=( $( compgen -W 'DES MD5 NONE SHA256 SHA512' \
+ -- "$cur" ) )
+ return 0
+ ;;
+ -s|--sha-rounds)
+ return 0
+ ;;
+ esac
+
+ $split && return 0
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ return 0
+ fi
+
+ _filedir
+} &&
+complete -F _newusers newusers
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/pack200 b/completions/pack200
new file mode 100644
index 00000000..49829ebb
--- /dev/null
+++ b/completions/pack200
@@ -0,0 +1,81 @@
+# pack200(1) completion
+
+_pack200()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ case $prev in
+ -S|--segment-limit|-P|--pass-file|-C|--class-attribute|\
+ -F|--field-attribute|-M|--method-attribute|-D|--code-attribute|\
+ '-?'|-h|--help|-V|--version|-J)
+ return 0
+ ;;
+ -E|--effort)
+ COMPREPLY=( $( compgen -W '{0..9}' -- "$cur" ) )
+ return 0
+ ;;
+ -H|--deflate-hint)
+ COMPREPLY=( $( compgen -W 'true false keep' -- "$cur" ) )
+ return 0
+ ;;
+ -m|--modification-time)
+ COMPREPLY=( $( compgen -W 'latest keep' -- "$cur" ) )
+ return 0
+ ;;
+ -U|--unknown-attribute)
+ COMPREPLY=( $( compgen -W 'error strip pass' -- "$cur" ) )
+ return 0
+ ;;
+ -f|--config-file)
+ _filedir properties
+ return 0
+ ;;
+ -l|--log-file)
+ COMPREPLY=( $( compgen -W '-' -- "$cur" ) )
+ _filedir log
+ return 0
+ ;;
+ -r|--repack)
+ _filedir jar
+ return 0
+ ;;
+ esac
+
+ $split && return
+
+ # Check if a pack or a jar was already given.
+ local i pack=false jar=false
+ for (( i=0; i < ${#words[@]}-1; i++ )) ; do
+ case ${words[i]} in
+ *.pack|*.pack.gz) pack=true ;;
+ *.jar) jar=true ;;
+ esac
+ done
+
+ if ! $pack ; then
+ if [[ "$cur" == -* ]] ; then
+ COMPREPLY=( $( compgen -W '--no-gzip --gzip --strip-debug \
+ --no-keep-file-order --segment-limit= --effort= \
+ --deflate-hint= --modification-time= --pass-file= \
+ --unknown-attribute= --class-attribute= --field-attribute= \
+ --method-attribute= --code-attribute= --config-file= \
+ --verbose --quiet --log-file= --help --version -J \
+ --repack' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ else
+ _filedir 'pack?(.gz)'
+ fi
+ elif ! $jar ; then
+ _filedir jar
+ fi
+} &&
+complete -F _pack200 pack200
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/passwd b/completions/passwd
new file mode 100644
index 00000000..66f7773e
--- /dev/null
+++ b/completions/passwd
@@ -0,0 +1,29 @@
+# passwd(1) completion
+
+_passwd()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -n|--minimum|-x|--maximum|-w|--warning|-i|--inactive|-\?|--help|--usage)
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+ return 0
+ fi
+
+ _allowed_users
+} &&
+complete -F _passwd passwd
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/pgrep b/completions/pgrep
new file mode 100644
index 00000000..616dc4ed
--- /dev/null
+++ b/completions/pgrep
@@ -0,0 +1,44 @@
+# pgrep(1) completion.
+
+_pgrep()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -d|-g|-s|-t)
+ return
+ ;;
+ -G)
+ _gids
+ return
+ ;;
+ -P)
+ _pids
+ return
+ ;;
+ -u|-U)
+ _uids
+ return
+ ;;
+ esac
+
+ if [[ $cur == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+ return
+ fi
+
+ _pnames
+} &&
+complete -F _pgrep pgrep
+
+# Linux pidof(8) completion.
+[ $UNAME = Linux ] && complete -F _pgrep pidof
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/iputils b/completions/ping
index 04d6b605..01cb581a 100644
--- a/completions/iputils
+++ b/completions/ping
@@ -1,3 +1,5 @@
+# ping(8) completion
+
_ping()
{
local cur prev words cword
@@ -56,56 +58,6 @@ _ping()
} &&
complete -F _ping ping ping6
-
-_tracepath()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -l)
- return
- ;;
- esac
-
- if [[ $cur == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
- return
- fi
-
- _known_hosts_real "$cur"
-} &&
-complete -F _tracepath tracepath tracepath6
-
-
-_arping()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -c|-w)
- return
- ;;
- -I)
- _available_interfaces -a
- return
- ;;
- -s)
- _ip_addresses
- return
- ;;
- esac
-
- if [[ $cur == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) )
- return
- fi
-
- _known_hosts_real "$cur"
-} &&
-complete -F _arping arping
-
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
diff --git a/completions/pkg_install b/completions/pkg_delete
index 522d3f42..522d3f42 100644
--- a/completions/pkg_install
+++ b/completions/pkg_delete
diff --git a/completions/pm-hibernate b/completions/pm-hibernate
new file mode 100644
index 00000000..da22ba8b
--- /dev/null
+++ b/completions/pm-hibernate
@@ -0,0 +1,18 @@
+# bash completion for pm-utils
+
+_pm_action()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ COMPREPLY=( $( compgen -W "--help $( _parse_help "$1" )" -- "$cur" ) )
+} &&
+complete -F _pm_action pm-hibernate pm-suspend pm-suspend-hybrid
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/pm-is-supported b/completions/pm-is-supported
new file mode 100644
index 00000000..c883c74b
--- /dev/null
+++ b/completions/pm-is-supported
@@ -0,0 +1,19 @@
+# pm-is-supported(1) completion
+
+_pm_is_supported()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ COMPREPLY=( $( compgen -W '--help --suspend --hibernate --suspend-hybrid' \
+ -- "$cur" ) )
+} &&
+complete -F _pm_is_supported pm-is-supported
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/pm-powersave b/completions/pm-powersave
new file mode 100644
index 00000000..afa1c85b
--- /dev/null
+++ b/completions/pm-powersave
@@ -0,0 +1,18 @@
+# pm-powersave(8) completion
+
+_pm_powersave()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ COMPREPLY=( $( compgen -W "true false" -- "$cur" ) )
+} &&
+complete -F _pm_powersave pm-powersave
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/pm-utils b/completions/pm-utils
deleted file mode 100644
index 1396025e..00000000
--- a/completions/pm-utils
+++ /dev/null
@@ -1,37 +0,0 @@
-# bash completion for pm-utils
-
-_pm_is_supported()
-{
- local cur prev words cword
- _init_completion || return
-
- COMPREPLY=( $( compgen -W '--help --suspend --hibernate --suspend-hybrid' \
- -- "$cur" ) )
-} &&
-complete -F _pm_is_supported pm-is-supported
-
-_pm_action()
-{
- local cur prev words cword
- _init_completion || return
-
- COMPREPLY=( $( compgen -W "--help $( _parse_help "$1" )" -- "$cur" ) )
-} &&
-complete -F _pm_action pm-hibernate pm-suspend pm-suspend-hybrid
-
-_pm_powersave()
-{
- local cur prev words cword
- _init_completion || return
-
- COMPREPLY=( $( compgen -W "true false" -- "$cur" ) )
-} &&
-complete -F _pm_powersave pm-powersave
-
-# Local variables:
-# mode: shell-script
-# sh-basic-offset: 4
-# sh-indent-comment: t
-# indent-tabs-mode: nil
-# End:
-# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/portinstall b/completions/portinstall
new file mode 100644
index 00000000..24051417
--- /dev/null
+++ b/completions/portinstall
@@ -0,0 +1,37 @@
+# bash completion for FreeBSD portinstall
+
+_portinstall()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ local portsdir indexfile
+ local -a COMPREPLY2
+
+ portsdir=${PORTSDIR:-/usr/ports}/
+
+ # First try INDEX-5
+ indexfile=$portsdir/INDEX-5
+ # Then INDEX if INDEX-5 does not exist or system is not FreeBSD 5.x
+ [[ "${OSTYPE%.*}" == freebsd5 && -f $indexfile ]] ||
+ indexfile=$portsdir/INDEX
+
+ [[ "$prev" == -l || "$prev" == -L || "$prev" == -o ]] && return 0
+
+ COMPREPLY=( $( command grep -E "^$cur" < $indexfile | cut -d'|' -f1 ) )
+ COMPREPLY2=( $( command grep -E "^[^\|]+\|$portsdir$cur" < $indexfile | \
+ cut -d'|' -f2 ) )
+ COMPREPLY2=( ${COMPREPLY2[@]#$portsdir} )
+ COMPREPLY+=( "${COMPREPLY2[@]}" )
+
+ return 0
+} &&
+complete -F _portinstall -o dirnames portinstall
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/portupgrade b/completions/portupgrade
index 230d6364..9999b265 100644
--- a/completions/portupgrade
+++ b/completions/portupgrade
@@ -1,4 +1,4 @@
-# bash completion for FreeBSD portupgrade package
+# bash completion for FreeBSD portupgrade
_portupgrade()
{
@@ -17,34 +17,6 @@ _portupgrade()
} &&
complete -F _portupgrade -o dirnames portupgrade
-_portinstall()
-{
- local cur prev words cword
- _init_completion || return
-
- local portsdir indexfile
- local -a COMPREPLY2
-
- portsdir=${PORTSDIR:-/usr/ports}/
-
- # First try INDEX-5
- indexfile=$portsdir/INDEX-5
- # Then INDEX if INDEX-5 does not exist or system is not FreeBSD 5.x
- [[ "${OSTYPE%.*}" == freebsd5 && -f $indexfile ]] ||
- indexfile=$portsdir/INDEX
-
- [[ "$prev" == -l || "$prev" == -L || "$prev" == -o ]] && return 0
-
- COMPREPLY=( $( command grep -E "^$cur" < $indexfile | cut -d'|' -f1 ) )
- COMPREPLY2=( $( command grep -E "^[^\|]+\|$portsdir$cur" < $indexfile | \
- cut -d'|' -f2 ) )
- COMPREPLY2=( ${COMPREPLY2[@]#$portsdir} )
- COMPREPLY+=( "${COMPREPLY2[@]}" )
-
- return 0
-} &&
-complete -F _portinstall -o dirnames portinstall
-
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
diff --git a/completions/postcat b/completions/postcat
new file mode 100644
index 00000000..75033e78
--- /dev/null
+++ b/completions/postcat
@@ -0,0 +1,48 @@
+# postcat(1) completion
+
+_postcat()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -c)
+ _filedir -d
+ return 0
+ ;;
+ esac
+
+ if [[ $cur == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+ return 0
+ fi
+
+ local idx qfile=0
+ for idx in "${words[@]}"; do
+ [[ "$idx" = -q ]] && qfile=1 && break
+ done
+ if [[ $qfile -eq 1 ]]; then
+ local len=${#cur} pval
+ idx=0
+ for pval in $( mailq 2>/dev/null | \
+ sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* !].*$//' ); do
+ if [[ "$cur" == "${pval:0:$len}" ]]; then
+ COMPREPLY[$idx]=$pval
+ idx=$(($idx+1))
+ fi
+ done
+ return 0
+ else
+ _filedir
+ return 0
+ fi
+} &&
+complete -F _postcat postcat
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/postconf b/completions/postconf
new file mode 100644
index 00000000..4de95e4f
--- /dev/null
+++ b/completions/postconf
@@ -0,0 +1,47 @@
+# postconf(1) completion
+
+_postconf()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ local eqext
+
+ case $prev in
+ -b|-t)
+ _filedir
+ return 0
+ ;;
+ -c)
+ _filedir -d
+ return 0
+ ;;
+ -e)
+ cur=${cur#[\"\']}
+ eqext='='
+ ;;
+ esac
+
+ if [[ $cur == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+ return 0
+ fi
+
+ local len=${#cur} idx=0 pval
+ for pval in $( /usr/sbin/postconf 2>/dev/null | cut -d ' ' -f 1 ); do
+ if [[ "$cur" == "${pval:0:$len}" ]]; then
+ COMPREPLY[$idx]="$pval$eqext"
+ idx=$(($idx+1))
+ fi
+ done
+ return 0
+} &&
+complete -F _postconf postconf
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/postfix b/completions/postfix
index 915ab385..5743b7a2 100644
--- a/completions/postfix
+++ b/completions/postfix
@@ -1,7 +1,5 @@
-# bash completion for postfix
+# postfix(1) completion
-# postfix(1)
-#
_postfix()
{
local cur prev words cword
@@ -28,190 +26,6 @@ _postfix()
} &&
complete -F _postfix postfix
-# postalias(1) and postmap(1)
-#
-_postmap()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -c)
- _filedir -d
- return 0
- ;;
- -[dq])
- return 0
- ;;
- esac
-
- if [[ $cur == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
- return 0
- fi
-
- if [[ "$cur" == *:* ]]; then
- compopt -o filenames
- COMPREPLY=( $( compgen -f -- "${cur#*:}" ) )
- else
- local len=${#cur} idx=0 pval
- for pval in $( /usr/sbin/postconf -m ); do
- if [[ "$cur" == "${pval:0:$len}" ]]; then
- COMPREPLY[$idx]="$pval:"
- idx=$(($idx+1))
- fi
- done
- if [[ $idx -eq 0 ]]; then
- compopt -o filenames
- COMPREPLY=( $( compgen -f -- "$cur" ) )
- fi
- fi
- return 0
-} &&
-complete -F _postmap postmap postalias
-
-# postcat(1)
-#
-_postcat()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -c)
- _filedir -d
- return 0
- ;;
- esac
-
- if [[ $cur == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
- return 0
- fi
-
- local idx qfile=0
- for idx in "${words[@]}"; do
- [[ "$idx" = -q ]] && qfile=1 && break
- done
- if [[ $qfile -eq 1 ]]; then
- local len=${#cur} pval
- idx=0
- for pval in $( mailq 2>/dev/null | \
- sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* !].*$//' ); do
- if [[ "$cur" == "${pval:0:$len}" ]]; then
- COMPREPLY[$idx]=$pval
- idx=$(($idx+1))
- fi
- done
- return 0
- else
- _filedir
- return 0
- fi
-} &&
-complete -F _postcat postcat
-
-# postconf(1)
-#
-_postconf()
-{
- local cur prev words cword
- _init_completion || return
-
- local eqext
-
- case $prev in
- -b|-t)
- _filedir
- return 0
- ;;
- -c)
- _filedir -d
- return 0
- ;;
- -e)
- cur=${cur#[\"\']}
- eqext='='
- ;;
- esac
-
- if [[ $cur == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
- return 0
- fi
-
- local len=${#cur} idx=0 pval
- for pval in $( /usr/sbin/postconf 2>/dev/null | cut -d ' ' -f 1 ); do
- if [[ "$cur" == "${pval:0:$len}" ]]; then
- COMPREPLY[$idx]="$pval$eqext"
- idx=$(($idx+1))
- fi
- done
- return 0
-} &&
-complete -F _postconf postconf
-
-# postsuper(1)
-#
-_postsuper()
-{
- local cur prev words cword
- _init_completion || return
-
- local pval len idx
-
- case $prev in
- -c)
- _filedir -d
- return 0
- ;;
- -[dr])
- len=${#cur}
- idx=0
- for pval in ALL $( mailq 2>/dev/null | \
- sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* !].*$//' ); do
- if [[ "$cur" == "${pval:0:$len}" ]]; then
- COMPREPLY[$idx]=$pval
- idx=$(($idx+1))
- fi
- done
- return 0
- ;;
- -h)
- len=${#cur}
- idx=0
- for pval in ALL $( mailq 2>/dev/null | \
- sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* ].*$//; /!$/d' ); do
- if [[ "$cur" == "${pval:0:$len}" ]]; then
- COMPREPLY[$idx]=$pval
- idx=$(($idx+1))
- fi
- done
- return 0
- ;;
- -H)
- len=${#cur}
- idx=0
- for pval in ALL $( mailq 2>/dev/null | \
- sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; /^[0-9A-Z]*[* ]/d; s/!.*$//' ); do
- if [[ "$cur" == "${pval:0:$len}" ]]; then
- COMPREPLY[$idx]=$pval
- idx=$(($idx+1))
- fi
- done
- return 0
- ;;
- esac
-
- if [[ $cur == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- return 0
- fi
-
- COMPREPLY=( $( compgen -W 'hold incoming active deferred' -- "$cur" ) )
-} &&
-complete -F _postsuper postsuper
-
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
diff --git a/completions/postmap b/completions/postmap
new file mode 100644
index 00000000..21a92fac
--- /dev/null
+++ b/completions/postmap
@@ -0,0 +1,49 @@
+# postalias(1) and postmap(1) completion
+
+_postmap()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -c)
+ _filedir -d
+ return 0
+ ;;
+ -[dq])
+ return 0
+ ;;
+ esac
+
+ if [[ $cur == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+ return 0
+ fi
+
+ if [[ "$cur" == *:* ]]; then
+ compopt -o filenames
+ COMPREPLY=( $( compgen -f -- "${cur#*:}" ) )
+ else
+ local len=${#cur} idx=0 pval
+ for pval in $( /usr/sbin/postconf -m ); do
+ if [[ "$cur" == "${pval:0:$len}" ]]; then
+ COMPREPLY[$idx]="$pval:"
+ idx=$(($idx+1))
+ fi
+ done
+ if [[ $idx -eq 0 ]]; then
+ compopt -o filenames
+ COMPREPLY=( $( compgen -f -- "$cur" ) )
+ fi
+ fi
+ return 0
+} &&
+complete -F _postmap postmap postalias
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/postsuper b/completions/postsuper
new file mode 100644
index 00000000..cfa867c6
--- /dev/null
+++ b/completions/postsuper
@@ -0,0 +1,68 @@
+# postsuper(1) completion
+
+_postsuper()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ local pval len idx
+
+ case $prev in
+ -c)
+ _filedir -d
+ return 0
+ ;;
+ -[dr])
+ len=${#cur}
+ idx=0
+ for pval in ALL $( mailq 2>/dev/null | \
+ sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* !].*$//' ); do
+ if [[ "$cur" == "${pval:0:$len}" ]]; then
+ COMPREPLY[$idx]=$pval
+ idx=$(($idx+1))
+ fi
+ done
+ return 0
+ ;;
+ -h)
+ len=${#cur}
+ idx=0
+ for pval in ALL $( mailq 2>/dev/null | \
+ sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; s/[* ].*$//; /!$/d' ); do
+ if [[ "$cur" == "${pval:0:$len}" ]]; then
+ COMPREPLY[$idx]=$pval
+ idx=$(($idx+1))
+ fi
+ done
+ return 0
+ ;;
+ -H)
+ len=${#cur}
+ idx=0
+ for pval in ALL $( mailq 2>/dev/null | \
+ sed -e '1d; $d; /^[^0-9A-Z]/d; /^$/d; /^[0-9A-Z]*[* ]/d; s/!.*$//' ); do
+ if [[ "$cur" == "${pval:0:$len}" ]]; then
+ COMPREPLY[$idx]=$pval
+ idx=$(($idx+1))
+ fi
+ done
+ return 0
+ ;;
+ esac
+
+ if [[ $cur == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ return 0
+ fi
+
+ COMPREPLY=( $( compgen -W 'hold incoming active deferred' -- "$cur" ) )
+} &&
+complete -F _postsuper postsuper
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/procps b/completions/procps
deleted file mode 100644
index bd02be99..00000000
--- a/completions/procps
+++ /dev/null
@@ -1,129 +0,0 @@
-# Completions for tools included in procps and related
-
-# killall(1) (Linux, FreeBSD and Darwin) and pkill(1) completion.
-#
-_killall()
-{
- local cur prev words cword
- _init_completion || return
-
- if [[ $cword -eq 1 && "$cur" == -* ]]; then
- _signals
- else
- _pnames
- fi
-
- return 0
-} &&
-complete -F _killall pkill
-[[ $UNAME == @(Linux|FreeBSD|Darwin) ]] && complete -F _killall killall
-
-# pgrep(1) completion.
-#
-_pgrep()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -d|-g|-s|-t)
- return
- ;;
- -G)
- _gids
- return
- ;;
- -P)
- _pids
- return
- ;;
- -u|-U)
- _uids
- return
- ;;
- esac
-
- if [[ $cur == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
- return
- fi
-
- _pnames
-} &&
-complete -F _pgrep pgrep
-
-# Linux pidof(8) completion.
-[ $UNAME = Linux ] && complete -F _pgrep pidof
-
-_pwdx()
-{
- local cur prev words cword
- _init_completion || return
-
- [[ $prev == -V ]] && return
-
- if [[ $cur == -* ]]; then
- COMPREPLY=( $( compgen -W '-V' -- "$cur" ) )
- else
- _pids
- fi
-} &&
-complete -F _pwdx pwdx
-
-[[ $UNAME == Linux ]] &&
-_watch()
-{
- local cur prev words cword split
- _init_completion -s || return
-
- local offset=0 i
- for (( i=1; i <= cword; i++ )); do
- case ${words[i]} in
- -h|--help|--version)
- return
- ;;
- -n|--interval)
- (( i++ ))
- continue
- ;;
- -*)
- continue
- ;;
- esac
- offset=$i
- break
- done
-
- if [[ $offset -gt 0 ]]; then
- _command_offset $offset
- return
- fi
-
- case $prev in
- -d|--differences)
- [[ $cur != -* ]] && \
- COMPREPLY=( $( compgen -W 'cumulative' -- "$cur" ) )
- return
- ;;
- -n|--interval)
- return
- ;;
- esac
-
- $split && return
-
- if [[ $cur == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- [[ $COMPREPLY == *= ]] && compopt -o nospace
- return
- fi
-} &&
-complete -F _watch watch
-
-# Local variables:
-# mode: shell-script
-# sh-basic-offset: 4
-# sh-indent-comment: t
-# indent-tabs-mode: nil
-# End:
-# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/pwck b/completions/pwck
new file mode 100644
index 00000000..478f5f9b
--- /dev/null
+++ b/completions/pwck
@@ -0,0 +1,23 @@
+# pwck(8) completion
+
+_pwck()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+ return 0
+ fi
+
+ _filedir
+} &&
+complete -F _pwck pwck
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/pwdx b/completions/pwdx
new file mode 100644
index 00000000..d5186711
--- /dev/null
+++ b/completions/pwdx
@@ -0,0 +1,24 @@
+# pwdx(1) completion
+
+_pwdx()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ [[ $prev == -V ]] && return
+
+ if [[ $cur == -* ]]; then
+ COMPREPLY=( $( compgen -W '-V' -- "$cur" ) )
+ else
+ _pids
+ fi
+} &&
+complete -F _pwdx pwdx
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/qrunner b/completions/qrunner
new file mode 100644
index 00000000..1427a826
--- /dev/null
+++ b/completions/qrunner
@@ -0,0 +1,24 @@
+# mailman qrunner completion
+
+_qrunner()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ $split && return 0
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '--runner --once \
+ --list --verbose --subproc --help' -- "$cur" ) )
+ fi
+
+} &&
+complete -F _qrunner qrunner
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/querybts b/completions/querybts
new file mode 100644
index 00000000..1f2c971d
--- /dev/null
+++ b/completions/querybts
@@ -0,0 +1,41 @@
+# querybts completion
+
+_querybts()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ case $prev in
+ -B|--bts)
+ COMPREPLY=( $( compgen -W "debian guug kde mandrake help" \
+ -- "$cur" ))
+ return 0
+ ;;
+ -u|--ui|--interface)
+ COMPREPLY=($( compgen -W "newt text gnome" -- "$cur" ))
+ return 0
+ ;;
+ esac
+
+ $split && return 0
+
+ COMPREPLY=($( compgen -W '-h --help -v --version -A --archive \
+ -B --bts -l --ldap --no-ldap --proxy --http_proxy \
+ -s --source -w --web -u --ui --interface \
+ wnpp boot-floppies kernel bugs.debian.org \
+ cdimage.debian.org general installation-reports \
+ listarchives lists.debian.org mirrors nm.debian.org \
+ press project qa.debian.org release-notes \
+ security.debian.org tech-ctte upgrade-reports \
+ www.debian.org' -- "$cur" ) \
+ $( apt-cache pkgnames -- "$cur" 2> /dev/null) )
+} &&
+complete -F _querybts querybts
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/renice b/completions/renice
new file mode 100644
index 00000000..d335b3f5
--- /dev/null
+++ b/completions/renice
@@ -0,0 +1,35 @@
+# renice(8) completion
+
+_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
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/reportbug b/completions/reportbug
index 6a72d366..f2bfece7 100644
--- a/completions/reportbug
+++ b/completions/reportbug
@@ -1,4 +1,4 @@
-# bash completion for (Debian) reportbug package
+# bash completion for (Debian) reportbug
_reportbug()
{
@@ -83,38 +83,6 @@ _reportbug()
} &&
complete -F _reportbug reportbug
-_querybts()
-{
- local cur prev words cword split
- _init_completion -s || return
-
- case $prev in
- -B|--bts)
- COMPREPLY=( $( compgen -W "debian guug kde mandrake help" \
- -- "$cur" ))
- return 0
- ;;
- -u|--ui|--interface)
- COMPREPLY=($( compgen -W "newt text gnome" -- "$cur" ))
- return 0
- ;;
- esac
-
- $split && return 0
-
- COMPREPLY=($( compgen -W '-h --help -v --version -A --archive \
- -B --bts -l --ldap --no-ldap --proxy --http_proxy \
- -s --source -w --web -u --ui --interface \
- wnpp boot-floppies kernel bugs.debian.org \
- cdimage.debian.org general installation-reports \
- listarchives lists.debian.org mirrors nm.debian.org \
- press project qa.debian.org release-notes \
- security.debian.org tech-ctte upgrade-reports \
- www.debian.org' -- "$cur" ) \
- $( apt-cache pkgnames -- "$cur" 2> /dev/null) )
-} &&
-complete -F _querybts querybts
-
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
diff --git a/completions/rmmod b/completions/rmmod
new file mode 100644
index 00000000..50dd982c
--- /dev/null
+++ b/completions/rmmod
@@ -0,0 +1,20 @@
+# Linux rmmod(8) completion. This completes on a list of all currently
+# installed kernel modules.
+
+_rmmod()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ _installed_modules "$cur"
+ return 0
+} &&
+complete -F _rmmod rmmod
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/route b/completions/route
new file mode 100644
index 00000000..99526a80
--- /dev/null
+++ b/completions/route
@@ -0,0 +1,35 @@
+# Linux route(8) completion
+
+[ $UNAME = Linux ] &&
+_route()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [ "$prev" = dev ]; then
+ _available_interfaces
+ return 0
+ fi
+
+ # Remove already given options from completions
+ local opt found i
+ for opt in add del -host -net netmask metric mss window irtt reject mod \
+ dyn reinstate dev default gw; do
+ found=false
+ for (( i=1; i < ${#words[@]}-1; i++ )); do
+ [ "${words[i]}" = "$opt" ] && found=true && break
+ done
+ $found || COMPREPLY[${#COMPREPLY[@]}]="$opt"
+ done
+
+ COMPREPLY=( $( compgen -W '"${COMPREPLY[@]}"' -- "$cur" ) )
+} &&
+complete -F _route route
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/rpm b/completions/rpm
index 739d7dbc..f6b65e7c 100644
--- a/completions/rpm
+++ b/completions/rpm
@@ -302,15 +302,6 @@ _rpmbuild()
} &&
complete -F _rpmbuild rpmbuild rpmbuild-md5
-_gendiff()
-{
- local cur prev words cword
- _init_completion -o @(diff|patch) || return
-
- [[ $cword -eq 1 ]] && _filedir -d
-} &&
-complete -F _gendiff gendiff
-
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
diff --git a/completions/shadow b/completions/shadow
deleted file mode 100644
index 4b0f02c7..00000000
--- a/completions/shadow
+++ /dev/null
@@ -1,409 +0,0 @@
-# bash completion for shadow utils
-
-_useradd()
-{
- local cur prev words cword split
- _init_completion -s || return
-
- # TODO: if -o/--non-unique is given, could complete on existing uids
- # with -u/--uid
-
- case $prev in
- -c|--comment|-h|--help|-e|--expiredate|-f|--inactive|-k|--key|\
- -p|--password|-u|--uid|-Z|--selinux-user)
- return 0
- ;;
- -b|--base-dir|-d|--home|-k|--skel)
- _filedir -d
- return 0
- ;;
- -g|--gid)
- _gids
- COMPREPLY=( $( compgen -W '${COMPREPLY[@]} $( compgen -g )' \
- -- "$cur" ) )
- return 0
- ;;
- -G|--groups)
- COMPREPLY=( $( compgen -g -- "$cur" ) )
- return 0
- ;;
- -s|--shell)
- _shells
- return 0
- ;;
- esac
-
- $split && return 0
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- return 0
- fi
-} &&
-complete -F _useradd useradd
-
-_usermod()
-{
- local cur prev words cword split
- _init_completion -s || return
-
- # TODO: if -o/--non-unique is given, could complete on existing uids
- # with -u/--uid
-
- case $prev in
- -c|--comment|-d|--home|-e|--expiredate|-f|--inactive|-h|--help|\
- -l|--login|-p|--password|-u|--uid|-Z|--selinux-user)
- return 0
- ;;
- -g|--gid)
- _gids
- COMPREPLY=( $( compgen -W '${COMPREPLY[@]} $( compgen -g )' \
- -- "$cur" ) )
- return 0
- ;;
- -G|--groups)
- COMPREPLY=( $( compgen -g -- "$cur" ) )
- return 0
- ;;
- -s|--shell)
- _shells
- return 0
- ;;
- esac
-
- $split && return 0
-
- if [[ "$cur" == -* ]]; then
- # TODO: -U/--unlock, -p/--password, -L/--lock mutually exclusive
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- return 0
- fi
-
- COMPREPLY=( $( compgen -u -- "$cur" ) )
-} &&
-complete -F _usermod usermod
-
-_userdel()
-{
- local cur prev words cword
- _init_completion || return
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- return 0
- fi
-
- COMPREPLY=( $( compgen -u -- "$cur" ) )
-} &&
-complete -F _userdel userdel
-
-_chage()
-{
- local cur prev words cword split
- _init_completion -s || return
-
- case $prev in
- -d|--lastday|-E|--expiredate|-h|--help|-I|--inactive|-m|--mindays|\
- -M|--maxdays|-W|--warndays)
- return 0
- ;;
- esac
-
- $split && return 0
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- return 0
- fi
-
- COMPREPLY=( $( compgen -u -- "$cur" ) )
-} &&
-complete -F _chage chage
-
-_passwd()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -n|--minimum|-x|--maximum|-w|--warning|-i|--inactive|-\?|--help|--usage)
- return 0
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
- return 0
- fi
-
- _allowed_users
-} &&
-complete -F _passwd passwd
-
-_chpasswd()
-{
- local cur prev words cword split
- _init_completion -s || return
-
- case $prev in
- -c|--crypt)
- COMPREPLY=( $( compgen -W 'DES MD5 NONE SHA256 SHA512' \
- -- "$cur" ) )
- return 0
- ;;
- -s|--sha-rounds)
- return 0
- ;;
- esac
-
- $split && return 0
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- [[ $COMPREPLY == *= ]] && compopt -o nospace
- return 0
- fi
-} &&
-complete -F _chpasswd chpasswd
-
-_newusers()
-{
- local cur prev words cword split
- _init_completion -s || return
-
- case $prev in
- -c|--crypt)
- COMPREPLY=( $( compgen -W 'DES MD5 NONE SHA256 SHA512' \
- -- "$cur" ) )
- return 0
- ;;
- -s|--sha-rounds)
- return 0
- ;;
- esac
-
- $split && return 0
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- [[ $COMPREPLY == *= ]] && compopt -o nospace
- return 0
- fi
-
- _filedir
-} &&
-complete -F _newusers newusers
-
-_pwck()
-{
- local cur prev words cword
- _init_completion || return
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
- return 0
- fi
-
- _filedir
-} &&
-complete -F _pwck pwck
-
-_groupadd()
-{
- local cur prev words cword split
- _init_completion -s || return
-
- # TODO: if -o/--non-unique is given, could complete on existing gids
- # with -g/--gid
-
- case $prev in
- -g|--gid|-K|--key|-p|--password)
- return 0
- ;;
- esac
-
- $split && return 0
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- [[ $COMPREPLY == *= ]] && compopt -o nospace
- return 0
- fi
-} &&
-complete -F _groupadd groupadd
-
-_groupmod()
-{
- local cur prev words cword split
- _init_completion -s || return
-
- # TODO: if -o/--non-unique is given, could complete on existing gids
- # with -g/--gid
-
- case $prev in
- -g|--gid|-h|--help|-n|--new-name|-p|--password)
- return 0
- ;;
- esac
-
- $split && return 0
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- [[ $COMPREPLY == *= ]] && compopt -o nospace
- return 0
- fi
-
- COMPREPLY=( $( compgen -g -- "$cur" ) )
-} &&
-complete -F _groupmod groupmod
-
-complete -g groupdel
-
-_newgrp()
-{
- local cur prev words cword
- _init_completion || return
-
- if [[ "$cur" == "-" ]]; then
- COMPREPLY=( - )
- else
- _allowed_groups "$cur"
- fi
-} &&
-complete -F _newgrp newgrp
-
-_gpasswd()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -a|--add|-d|--delete|-A|--administrators|-M|--members)
- COMPREPLY=( $( compgen -u -- "$cur" ) )
- return 0
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
- # TODO: only -A and -M can be combined
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- return 0
- fi
-
- COMPREPLY=( $( compgen -g -- "$cur" ) )
-} &&
-complete -F _gpasswd gpasswd
-
-_groupmems()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -a|--add|-d|--delete)
- COMPREPLY=( $( compgen -u -- "$cur" ) )
- return 0
- ;;
- -g|--group)
- COMPREPLY=( $( compgen -g -- "$cur" ) )
- return 0
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- return 0
- fi
-} &&
-complete -F _groupmems groupmems
-
-_grpck()
-{
- local cur prev words cword
- _init_completion || return
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
- return 0
- fi
-
- _filedir
-} &&
-complete -F _grpck grpck
-
-_vipw()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -h|--help)
- return 0
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- return 0
- fi
-} &&
-complete -F _vipw vipw vigr
-
-_faillog()
-{
- local cur prev words cword split
- _init_completion -s || return
-
- case $prev in
- -h|--help|-l|--lock-time|-m|--maximum|-t|--time)
- return 0
- ;;
- -u|--user)
- COMPREPLY=( $( compgen -u -- "$cur" ) )
- return 0
- ;;
- esac
-
- $split && return 0
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- [[ $COMPREPLY == *= ]] && compopt -o nospace
- return 0
- fi
-} &&
-complete -F _faillog faillog
-
-_lastlog()
-{
- local cur prev words cword split
- _init_completion -s || return
-
- case $prev in
- -b|--before|-h|--help|-t|--time)
- return 0
- ;;
- -u|--user)
- COMPREPLY=( $( compgen -u -- "$cur" ) )
- return 0
- ;;
- esac
-
- $split && return 0
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- [[ $COMPREPLY == *= ]] && compopt -o nospace
- return 0
- fi
-} &&
-complete -F _lastlog lastlog
-
-# Local variables:
-# mode: shell-script
-# sh-basic-offset: 4
-# sh-indent-comment: t
-# indent-tabs-mode: nil
-# End:
-# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/slapt b/completions/slapt-get
index 785e2c80..f6d9f35a 100644
--- a/completions/slapt
+++ b/completions/slapt-get
@@ -1,4 +1,4 @@
-# slapt-get and slapt-src completion
+# slapt-get completion
_slapt_get()
{
@@ -78,63 +78,6 @@ _slapt_get()
esac
} && complete -F _slapt_get slapt-get
-_slapt_src()
-{
- local cur prev words cword
- _init_completion -n : || return
-
- case "$prev" in
- --config|-c)
- _filedir
- return 0
- ;;
- --search|-s|--postprocess|-p)
- # argument required but no completions available
- return 0
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' -- "$cur" ) )
- [[ $COMPREPLY == *= ]] && compopt -o nospace
- [[ $COMPREPLY ]] && return 0
- fi
-
- local i t
- # search for last action (-i|-w|-b|-f)
- for (( i=${#words[@]}-1; i>0; i-- )); do
- if [[ ${words[i]} == -@(i|w|f|b|-install|-show|-build|-fetch) ]]; then
- t="all"
- break
- fi
- done
- if [ "$t" != "all" ]; then
- return 0
- fi
-
- local config="/etc/slapt-get/slapt-srcrc" # default config location
- # search for config
- for (( i=${#words[@]}-1; i>0; i-- )); do
- if [[ ${words[i]} == -@(c|-config) ]]; then
- config="${words[i+1]}"
- break
- fi
- done
- if [ ! -r "$config" ]; then
- return 0
- fi
-
- if [[ "$cur" == *:* ]]; then
- local name=${cur%:*}
- local version=${cur##*:}
- COMPREPLY=( $( slapt-src --config $config --search "^$name" 2> \
- /dev/null | sed -ne "/^$cur/{s/^$name:\([^ ]*\) .*$/\1/;p}" ) )
- else
- COMPREPLY=( $( slapt-src --config $config --search "^$cur" 2>/dev/null \
- | sed -ne "/^$cur/{s/ .*$//;p}" ) )
- fi
-} && complete -F _slapt_src slapt-src
-
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
diff --git a/completions/slapt-src b/completions/slapt-src
new file mode 100644
index 00000000..305879f9
--- /dev/null
+++ b/completions/slapt-src
@@ -0,0 +1,66 @@
+# slapt-src completion
+
+_slapt_src()
+{
+ local cur prev words cword
+ _init_completion -n : || return
+
+ case "$prev" in
+ --config|-c)
+ _filedir
+ return 0
+ ;;
+ --search|-s|--postprocess|-p)
+ # argument required but no completions available
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" --help )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ [[ $COMPREPLY ]] && return 0
+ fi
+
+ local i t
+ # search for last action (-i|-w|-b|-f)
+ for (( i=${#words[@]}-1; i>0; i-- )); do
+ if [[ ${words[i]} == -@(i|w|f|b|-install|-show|-build|-fetch) ]]; then
+ t="all"
+ break
+ fi
+ done
+ if [ "$t" != "all" ]; then
+ return 0
+ fi
+
+ local config="/etc/slapt-get/slapt-srcrc" # default config location
+ # search for config
+ for (( i=${#words[@]}-1; i>0; i-- )); do
+ if [[ ${words[i]} == -@(c|-config) ]]; then
+ config="${words[i+1]}"
+ break
+ fi
+ done
+ if [ ! -r "$config" ]; then
+ return 0
+ fi
+
+ if [[ "$cur" == *:* ]]; then
+ local name=${cur%:*}
+ local version=${cur##*:}
+ COMPREPLY=( $( slapt-src --config $config --search "^$name" 2> \
+ /dev/null | sed -ne "/^$cur/{s/^$name:\([^ ]*\) .*$/\1/;p}" ) )
+ else
+ COMPREPLY=( $( slapt-src --config $config --search "^$cur" 2>/dev/null \
+ | sed -ne "/^$cur/{s/ .*$//;p}" ) )
+ fi
+} && complete -F _slapt_src slapt-src
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/ssh b/completions/ssh
index fbceff65..eae47b26 100644
--- a/completions/ssh
+++ b/completions/ssh
@@ -385,30 +385,6 @@ _scp()
} &&
complete -F _scp -o nospace scp
-# ssh-copy-id(1) completion
-#
-_ssh_copy_id()
-{
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -i)
- _filedir
- return 0
- ;;
- esac
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
- else
- _known_hosts_real -a "$cur"
- fi
-
- return 0
-} &&
-complete -F _ssh_copy_id ssh-copy-id
-
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
diff --git a/completions/ssh-copy-id b/completions/ssh-copy-id
new file mode 100644
index 00000000..46829190
--- /dev/null
+++ b/completions/ssh-copy-id
@@ -0,0 +1,31 @@
+# ssh-copy-id(1) completion
+
+_ssh_copy_id()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -i)
+ _filedir
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" --help )' -- "$cur" ) )
+ else
+ _known_hosts_real -a "$cur"
+ fi
+
+ return 0
+} &&
+complete -F _ssh_copy_id ssh-copy-id
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/sshmitm b/completions/sshmitm
new file mode 100644
index 00000000..22609826
--- /dev/null
+++ b/completions/sshmitm
@@ -0,0 +1,23 @@
+# sshmitm completion
+
+_sshmitm()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+ else
+ _known_hosts_real "$cur"
+ fi
+
+} &&
+complete -F _sshmitm sshmitm
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/sshow b/completions/sshow
new file mode 100644
index 00000000..fad595d7
--- /dev/null
+++ b/completions/sshow
@@ -0,0 +1,28 @@
+# sshow completion
+
+_sshow()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -i)
+ _interfaces
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+ fi
+
+} &&
+complete -F _sshow sshow
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/tcpkill b/completions/tcpkill
new file mode 100644
index 00000000..a9680d29
--- /dev/null
+++ b/completions/tcpkill
@@ -0,0 +1,28 @@
+# tcpkill completion
+
+_tcpkill()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -i)
+ _interfaces
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '-i -1 -2 -3 -4 -5 -6 -7 -8 -9' -- "$cur" ) )
+ fi
+
+} &&
+complete -F _tcpkill tcpkill
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/tcpnice b/completions/tcpnice
new file mode 100644
index 00000000..ea069a6c
--- /dev/null
+++ b/completions/tcpnice
@@ -0,0 +1,28 @@
+# tcpnice completion
+
+_tcpnice()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -i)
+ _interfaces
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+ fi
+
+} &&
+complete -F _tcpnice tcpnice
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/tracepath b/completions/tracepath
new file mode 100644
index 00000000..9b45534a
--- /dev/null
+++ b/completions/tracepath
@@ -0,0 +1,29 @@
+# tracepath(8) completion
+
+_tracepath()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -l)
+ return
+ ;;
+ esac
+
+ if [[ $cur == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+ return
+ fi
+
+ _known_hosts_real "$cur"
+} &&
+complete -F _tracepath tracepath tracepath6
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/tune2fs b/completions/tune2fs
new file mode 100644
index 00000000..c23548f1
--- /dev/null
+++ b/completions/tune2fs
@@ -0,0 +1,64 @@
+# tune2fs(8) completion
+
+_tune2fs()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -c|-C|-E|-i|-J|-L|-m|-r|-T)
+ return 0
+ ;;
+ -e)
+ COMPREPLY=( $( compgen -W 'continue remount-ro panic' -- "$cur" ) )
+ return 0
+ ;;
+ -g)
+ _gids
+ COMPREPLY=( $( compgen -g -W '${COMPREPLY[@]}' -- "$cur" ) )
+ return 0
+ ;;
+ -M)
+ _filedir -d
+ ;;
+ -o)
+ local -a opts=(^debug ^bsdgroups ^user_xattr ^acl ^uid16
+ ^journal_data ^journal_data_ordered ^journal_data_writeback)
+ COMPREPLY=( $( compgen -W '${opts[@]} ${opts[@]#^}' -- "$cur" ) )
+ return 0
+ ;;
+ -O)
+ local -a opts=(^dir_index ^dir_nlink ^extent ^extra_isize ^filetype
+ ^flex_bg ^has_journal ^huge_file ^large_file ^resize_inode
+ ^sparse_super ^uninit_bg)
+ COMPREPLY=( $( compgen -W '${opts[@]} ${opts[@]#^}' -- "$cur" ) )
+ return 0
+ ;;
+ -u)
+ _uids
+ COMPREPLY=( $( compgen -u -W '${COMPREPLY[@]}' -- "$cur" ) )
+ return 0
+ ;;
+ -U)
+ COMPREPLY=( $( compgen -W 'clear random time' -- "$cur" ) )
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+ return
+ fi
+
+ cur=${cur:=/dev/}
+ _filedir
+} &&
+complete -F _tune2fs tune2fs
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/unpack200 b/completions/unpack200
new file mode 100644
index 00000000..208ad471
--- /dev/null
+++ b/completions/unpack200
@@ -0,0 +1,54 @@
+# unpack200(1) completion
+
+_unpack200()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ case $prev in
+ '-?'|-h|--help|-V|--version|-J)
+ return 0
+ ;;
+ -H|--deflate-hint)
+ COMPREPLY=( $( compgen -W 'true false keep' -- "$cur" ) )
+ return 0
+ ;;
+ -l|--log-file)
+ COMPREPLY=( $( compgen -W '-' -- "$cur" ) )
+ _filedir log
+ return 0
+ ;;
+ esac
+
+ $split && return
+
+ # Check if a pack or a jar was already given.
+ local i pack=false jar=false
+ for (( i=0; i < ${#words[@]}-1; i++ )) ; do
+ case ${words[i]} in
+ *.pack|*.pack.gz) pack=true ;;
+ *.jar) jar=true ;;
+ esac
+ done
+
+ if ! $pack ; then
+ if [[ "$cur" == -* ]] ; then
+ COMPREPLY=( $( compgen -W '--deflate-hint= --remove-pack-file \
+ --verbose --quiet --log-file= --help --version' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ else
+ _filedir 'pack?(.gz)'
+ fi
+ elif ! $jar ; then
+ _filedir jar
+ fi
+} &&
+complete -F _unpack200 unpack200
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/unshunt b/completions/unshunt
new file mode 100644
index 00000000..422e5045
--- /dev/null
+++ b/completions/unshunt
@@ -0,0 +1,23 @@
+# mailman unshunt completion
+
+_unshunt()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '--help' -- "$cur" ) )
+ else
+ _filedir -d
+ fi
+
+} &&
+complete -F _unshunt unshunt
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/sysv-rc b/completions/update-rc.d
index b2015c6a..92e29eb2 100644
--- a/completions/sysv-rc
+++ b/completions/update-rc.d
@@ -62,44 +62,6 @@ _update_rc_d()
} &&
complete -F _update_rc_d update-rc.d
-# invoke-rc.d(8) completion
-#
-# Copyright (C) 2004 Servilio Afre Puentes <servilio@gmail.com>
-#
-_invoke_rc_d()
-{
- local cur prev words cword
- _init_completion || return
-
- local sysvdir services options valid_options
-
- [ -d /etc/rc.d/init.d ] && sysvdir=/etc/rc.d/init.d \
- || sysvdir=/etc/init.d
-
- services=( $( printf '%s ' $sysvdir/!(README*|*.sh|$_backup_glob) ) )
- services=( ${services[@]#$sysvdir/} )
- options=( --help --quiet --force --try-anyway --disclose-deny --query \
- --no-fallback )
-
- if [[ ($cword -eq 1) || ("$prev" == --* ) ]]; then
- valid_options=( $( \
- tr " " "\n" <<<"${words[@]} ${options[@]}" \
- | sed -ne "/$( sed "s/ /\\\\|/g" <<<"${options[@]}" )/p" \
- | sort | uniq -u \
- ) )
- COMPREPLY=( $( compgen -W '${valid_options[@]} ${services[@]}' -- "$cur" ) )
- elif [ -x $sysvdir/$prev ]; then
- COMPREPLY=( $( compgen -W '`sed -e "y/|/ /" \
- -ne "s/^.*Usage:[ ]*[^ ]*[ ]*{*\([^}\"]*\).*$/\1/p" \
- $sysvdir/$prev`' -- "$cur" ) )
- else
- COMPREPLY=()
- fi
-
- return 0
-} &&
-complete -F _invoke_rc_d invoke-rc.d
-
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
diff --git a/completions/urlsnarf b/completions/urlsnarf
new file mode 100644
index 00000000..172e789a
--- /dev/null
+++ b/completions/urlsnarf
@@ -0,0 +1,28 @@
+# urlsnarf completion
+
+_urlsnarf()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -i)
+ _interfaces
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+ fi
+
+} &&
+complete -F _urlsnarf urlsnarf
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/useradd b/completions/useradd
new file mode 100644
index 00000000..6b2be57a
--- /dev/null
+++ b/completions/useradd
@@ -0,0 +1,51 @@
+# useradd(8) completion
+
+_useradd()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ # TODO: if -o/--non-unique is given, could complete on existing uids
+ # with -u/--uid
+
+ case $prev in
+ -c|--comment|-h|--help|-e|--expiredate|-f|--inactive|-k|--key|\
+ -p|--password|-u|--uid|-Z|--selinux-user)
+ return 0
+ ;;
+ -b|--base-dir|-d|--home|-k|--skel)
+ _filedir -d
+ return 0
+ ;;
+ -g|--gid)
+ _gids
+ COMPREPLY=( $( compgen -W '${COMPREPLY[@]} $( compgen -g )' \
+ -- "$cur" ) )
+ return 0
+ ;;
+ -G|--groups)
+ COMPREPLY=( $( compgen -g -- "$cur" ) )
+ return 0
+ ;;
+ -s|--shell)
+ _shells
+ return 0
+ ;;
+ esac
+
+ $split && return 0
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ return 0
+ fi
+} &&
+complete -F _useradd useradd
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/userdel b/completions/userdel
new file mode 100644
index 00000000..08939b25
--- /dev/null
+++ b/completions/userdel
@@ -0,0 +1,23 @@
+# userdel(8) completion
+
+_userdel()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ return 0
+ fi
+
+ COMPREPLY=( $( compgen -u -- "$cur" ) )
+} &&
+complete -F _userdel userdel
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/usermod b/completions/usermod
new file mode 100644
index 00000000..18e363a0
--- /dev/null
+++ b/completions/usermod
@@ -0,0 +1,50 @@
+# usermod(8) completion
+
+_usermod()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ # TODO: if -o/--non-unique is given, could complete on existing uids
+ # with -u/--uid
+
+ case $prev in
+ -c|--comment|-d|--home|-e|--expiredate|-f|--inactive|-h|--help|\
+ -l|--login|-p|--password|-u|--uid|-Z|--selinux-user)
+ return 0
+ ;;
+ -g|--gid)
+ _gids
+ COMPREPLY=( $( compgen -W '${COMPREPLY[@]} $( compgen -g )' \
+ -- "$cur" ) )
+ return 0
+ ;;
+ -G|--groups)
+ COMPREPLY=( $( compgen -g -- "$cur" ) )
+ return 0
+ ;;
+ -s|--shell)
+ _shells
+ return 0
+ ;;
+ esac
+
+ $split && return 0
+
+ if [[ "$cur" == -* ]]; then
+ # TODO: -U/--unlock, -p/--password, -L/--lock mutually exclusive
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ return 0
+ fi
+
+ COMPREPLY=( $( compgen -u -- "$cur" ) )
+} &&
+complete -F _usermod usermod
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/util-linux b/completions/util-linux
deleted file mode 100644
index c31acb51..00000000
--- a/completions/util-linux
+++ /dev/null
@@ -1,145 +0,0 @@
-# Completions for tools included in util-linux (not necessarily Linux specific)
-
-# renice(8) completion
-#
-_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
-
-# kill(1) completion
-#
-_kill()
-{
- local cur prev words cword
- _init_completion || return
-
- if [[ $cword -eq 1 && "$cur" == -* ]]; then
- # return list of available signals
- _signals
- else
- # return list of available PIDs
- _pids
- fi
-} &&
-complete -F _kill kill
-
-# look(1) completion
-#
-_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
-
-_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
-
-_dmesg()
-{
- [[ $OSTYPE == *solaris* ]] && return # no args there
-
- local cur prev words cword
- _init_completion || return
-
- case $prev in
- -s|-M|-N)
- return
- ;;
- -n)
- COMPREPLY=( $( compgen -W '{1..8}' -- "$cur" ) )
- return
- ;;
- esac
-
- if [[ $cur == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
- return
- fi
-} &&
-complete -F _dmesg dmesg
-
-# Local variables:
-# mode: shell-script
-# sh-basic-offset: 4
-# sh-indent-comment: t
-# indent-tabs-mode: nil
-# End:
-# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/vipw b/completions/vipw
new file mode 100644
index 00000000..ac885aa7
--- /dev/null
+++ b/completions/vipw
@@ -0,0 +1,27 @@
+# vipw(8) and vigr completion
+
+_vipw()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ case $prev in
+ -h|--help)
+ return 0
+ ;;
+ esac
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ return 0
+ fi
+} &&
+complete -F _vipw vipw vigr
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/watch b/completions/watch
new file mode 100644
index 00000000..d99658b7
--- /dev/null
+++ b/completions/watch
@@ -0,0 +1,59 @@
+# watch(1) completion
+
+[[ $UNAME == Linux ]] &&
+_watch()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ local offset=0 i
+ for (( i=1; i <= cword; i++ )); do
+ case ${words[i]} in
+ -h|--help|--version)
+ return
+ ;;
+ -n|--interval)
+ (( i++ ))
+ continue
+ ;;
+ -*)
+ continue
+ ;;
+ esac
+ offset=$i
+ break
+ done
+
+ if [[ $offset -gt 0 ]]; then
+ _command_offset $offset
+ return
+ fi
+
+ case $prev in
+ -d|--differences)
+ [[ $cur != -* ]] && \
+ COMPREPLY=( $( compgen -W 'cumulative' -- "$cur" ) )
+ return
+ ;;
+ -n|--interval)
+ return
+ ;;
+ esac
+
+ $split && return
+
+ if [[ $cur == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ return
+ fi
+} &&
+complete -F _watch watch
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/webmitm b/completions/webmitm
new file mode 100644
index 00000000..cf181f87
--- /dev/null
+++ b/completions/webmitm
@@ -0,0 +1,23 @@
+# webmitm completion
+
+_webmitm()
+{
+ local cur prev words cword
+ _init_completion || return
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_usage "$1" )' -- "$cur" ) )
+ else
+ _known_hosts_real "$cur"
+ fi
+
+} &&
+complete -F _webmitm webmitm
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh
diff --git a/completions/freerdp b/completions/xfreerdp
index bf4cc609..bb24dbfd 100644
--- a/completions/freerdp
+++ b/completions/xfreerdp
@@ -1,4 +1,4 @@
-# bash completion for xfreerdp
+# xfreerdp completion
_xfreerdp()
{
diff --git a/completions/xz b/completions/xz
index c3c35d82..5acf724a 100644
--- a/completions/xz
+++ b/completions/xz
@@ -52,36 +52,6 @@ _xz()
} &&
complete -F _xz xz pxz
-# xzdec(1) completion
-#
-_xzdec()
-{
- local cur prev words cword split
- _init_completion -s || return
-
- case $prev in
- -M|--memory)
- # argument required but no completions available
- return 0
- ;;
- -h|--help|-V|--version)
- # all other arguments are noop with these
- return 0
- ;;
- esac
-
- $split && return 0
-
- if [[ "$cur" == -* ]]; then
- COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
- [[ $COMPREPLY == *= ]] && compopt -o nospace
- return 0
- fi
-
- _filedir xz # no lzma support here as of xz 4.999.9beta
-} &&
-complete -F _xzdec xzdec
-
# Local variables:
# mode: shell-script
# sh-basic-offset: 4
diff --git a/completions/xzdec b/completions/xzdec
new file mode 100644
index 00000000..dc7a911b
--- /dev/null
+++ b/completions/xzdec
@@ -0,0 +1,37 @@
+# xzdec(1) completion
+
+_xzdec()
+{
+ local cur prev words cword split
+ _init_completion -s || return
+
+ case $prev in
+ -M|--memory)
+ # argument required but no completions available
+ return 0
+ ;;
+ -h|--help|-V|--version)
+ # all other arguments are noop with these
+ return 0
+ ;;
+ esac
+
+ $split && return 0
+
+ if [[ "$cur" == -* ]]; then
+ COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
+ [[ $COMPREPLY == *= ]] && compopt -o nospace
+ return 0
+ fi
+
+ _filedir xz # no lzma support here as of xz 4.999.9beta
+} &&
+complete -F _xzdec xzdec
+
+# Local variables:
+# mode: shell-script
+# sh-basic-offset: 4
+# sh-indent-comment: t
+# indent-tabs-mode: nil
+# End:
+# ex: ts=4 sw=4 et filetype=sh