Split/rename many completions into per-command files.

This commit is contained in:
Ville Skyttä 2011-10-12 23:01:10 +03:00
parent d3d6476f6c
commit 156656c16d
151 changed files with 3811 additions and 2908 deletions

View File

@ -1,38 +1,52 @@
bashcompdir = $(pkgdatadir)/completions bashcompdir = $(pkgdatadir)/completions
bashcomp_DATA = abook \ bashcomp_DATA = abook \
aclocal \
alias \
ant \ ant \
apache2ctl \ apache2ctl \
apt \
apt-build \ apt-build \
apt-cache \
apt-get \
aptitude \ aptitude \
arping \
arpspoof \
asciidoc \ asciidoc \
aspell \ aspell \
autoconf \ autoconf \
automake \ automake \
autoreconf \
autorpm \ autorpm \
bash-builtins \ autoscan \
badblocks \
bind-utils \ bind-utils \
bitkeeper \ bk \
bittorrent \
bluez \ bluez \
brctl \ brctl \
btdownloadheadless.py \
bzip2 \ bzip2 \
cal \ cal \
cancel \
cardctl \ cardctl \
cfengine \ cfagent \
cfrun \
chage \
check_perms \
chgrp \
chkconfig \ chkconfig \
chown \
chpasswd \
chrpath \ chrpath \
chsh \ chsh \
cksfv \ cksfv \
cleanarch \
clisp \ clisp \
complete \
configure \ configure \
coreutils \
cowsay \ cowsay \
cpan2dist \ cpan2dist \
cpio \ cpio \
cppcheck \ cppcheck \
crontab \ crontab \
cups \
curl \ curl \
cryptsetup \ cryptsetup \
cvs \ cvs \
@ -40,119 +54,181 @@ bashcomp_DATA = abook \
dd \ dd \
dhclient \ dhclient \
dict \ dict \
dmesg \
dot \ dot \
dpkg \ dpkg \
dpkg-source \
dselect \ dselect \
dsniff \ dsniff \
dvd+rw-tools \ dumpdb \
e2fsprogs \ dumpe2fs \
e2freefrag \
e2label \
ether-wake \
evince \ evince \
export \
faillog \
fbgs \
fbi \ fbi \
feh \ feh \
file \ file \
findutils \ filefrag \
freeciv \ filesnarf \
freerdp \ find \
fuse \ freeciv-gtk2 \
freeciv-server \
function \
fusermount \
gcc \ gcc \
gcl \ gcl \
gdb \ gdb \
genaliases \
gendiff \
genisoimage \ genisoimage \
getent \ getent \
gkrellm \ gkrellm \
gnatmake \ gnatmake \
gnome-mplayer \ gnome-mplayer \
gpasswd \
gpg \ gpg \
gpg2 \ gpg2 \
gprof \ gprof \
groupadd \
groupdel \
groupmems \
groupmod \
growisofs \
grpck \
gzip \ gzip \
hddtemp \ hddtemp \
heimdal \ hid2hci \
hping2 \ hping2 \
htpasswd \ htpasswd \
iconv \ iconv \
idn \ idn \
iftop \ iftop \
ifupdown \ ifup \
imagemagick \ imagemagick \
info \ info \
insmod \
invoke-rc.d \
ionice \
ip \
iptables \ iptables \
ipmitool \ ipmitool \
iproute2 \
ipsec \ ipsec \
iputils \
ipv6calc \ ipv6calc \
iscsiadm \
isql \ isql \
jar \ jar \
jarsigner \
java \ java \
javaws \
jps \
k3b \ k3b \
kcov \ kcov \
kill \
killall \
kldload \ kldload \
kldunload \
ktutil \
larch \ larch \
lastlog \
ldapvi \ ldapvi \
lftp \ lftp \
lftpget \
lilo \ lilo \
links \ links \
lintian \ lintian \
lisp \ lisp \
list_lists \
look \
lpq \
lpr \
lrzip \ lrzip \
lsof \ lsof \
lvm \ lvm \
lzma \ lzma \
lzop \ lzop \
macof \
mailman \ mailman \
mailmanctl \
make \ make \
man \ man \
mc \ mc \
mcrypt \ mcrypt \
mdadm \ mdadm \
mdtool \
medusa \ medusa \
mii-diag \
mii-tool \
minicom \ minicom \
mkinitrd \ mkinitrd \
module-init-tools \ mktemp \
mmsitepass \
monodevelop \ monodevelop \
mount \ mount \
mplayer \ mplayer \
msynctool \ msynctool \
mtx \ mtx \
munin-node \ munindoc \
munin-node-configure \
munin-run \
munin-update \
mutt \ mutt \
mysql \ mysql \
mysqladmin \ mysqladmin \
ncftp \ ncftp \
net-tools \ newgrp \
newusers \
nmap \ nmap \
ntpdate \ ntpdate \
openldap \ openldap \
openssl \ openssl \
open-iscsi \
p4 \ p4 \
pack200 \
passwd \
perl \ perl \
pgrep \
pine \ pine \
ping \
pkg-config \ pkg-config \
pkg_install \ pkg_delete \
pkgtools \ pkgtools \
pm-utils \ pm-hibernate \
pm-is-supported \
pm-powersave \
portinstall \
portupgrade \ portupgrade \
postcat \
postconf \
postfix \ postfix \
postgresql \ postgresql \
postmap \
postsuper \
povray \ povray \
prelink \ prelink \
procps \
protoc \ protoc \
puppet \ puppet \
pwck \
pwdx \
pwgen \ pwgen \
python \ python \
qdbus \ qdbus \
qemu \ qemu \
qrunner \
querybts \
quota-tools \ quota-tools \
rcs \ rcs \
rdesktop \ rdesktop \
renice \
reptyr \ reptyr \
reportbug \ reportbug \
resolvconf \ resolvconf \
rfkill \ rfkill \
ri \ ri \
rmmod \
route \
rpcdebug \ rpcdebug \
rpm \ rpm \
rpm2tgz \ rpm2tgz \
@ -166,33 +242,49 @@ bashcomp_DATA = abook \
screen \ screen \
service \ service \
sh \ sh \
shadow \
sitecopy \ sitecopy \
slackpkg \ slackpkg \
slapt \ slapt-get \
slapt-src \
smartctl \ smartctl \
snownews \ snownews \
sqlite3 \ sqlite3 \
ssh \ ssh \
ssh-copy-id \
sshfs \ sshfs \
sshmitm \
sshow \
strace \ strace \
svk \ svk \
sysbench \ sysbench \
sysctl \ sysctl \
sysv-rc \
tar \ tar \
tcpdump \ tcpdump \
tcpkill \
tcpnice \
tracepath \
tune2fs \
unace \ unace \
unpack200 \
unrar \ unrar \
unshunt \
update-alternatives \ update-alternatives \
util-linux \ update-rc.d \
urlsnarf \
useradd \
userdel \
usermod \
vipw \
vncviewer \ vncviewer \
vpnc \ vpnc \
watch \
webmitm \
wireless-tools \ wireless-tools \
wodim \ wodim \
wol \ wol \
wtf \ wtf \
wvdial \ wvdial \
xfreerdp \
xgamma \ xgamma \
xhost \ xhost \
xm \ xm \
@ -204,6 +296,7 @@ bashcomp_DATA = abook \
xrdb \ xrdb \
xsltproc \ xsltproc \
xz \ xz \
xzdec \
yp-tools \ yp-tools \
yum-arch yum-arch

41
completions/aclocal Normal file
View File

@ -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

26
completions/alias Normal file
View File

@ -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

80
completions/apt-cache Normal file
View File

@ -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

View File

@ -72,79 +72,6 @@ _apt_get()
} && } &&
complete -F _apt_get 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: # Local variables:
# mode: shell-script # mode: shell-script
# sh-basic-offset: 4 # sh-basic-offset: 4

37
completions/arping Normal file
View File

@ -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

34
completions/arpspoof Normal file
View File

@ -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

View File

@ -1,4 +1,4 @@
# Completions for autoconf tools # autoconf(1) completion
_autoconf() _autoconf()
{ {
@ -37,75 +37,6 @@ _autoconf()
} && } &&
complete -F _autoconf 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: # Local variables:
# mode: shell-script # mode: shell-script
# sh-basic-offset: 4 # sh-basic-offset: 4

View File

@ -1,4 +1,4 @@
# Completions for automake tools # automake(1) completion
_automake() _automake()
{ {
@ -33,38 +33,6 @@ _automake()
} && } &&
complete -F _automake automake automake-1.11 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: # Local variables:
# mode: shell-script # mode: shell-script
# sh-basic-offset: 4 # sh-basic-offset: 4

47
completions/autoreconf Normal file
View File

@ -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

40
completions/autoscan Normal file
View File

@ -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

26
completions/avctrl Normal file
View File

@ -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

38
completions/badblocks Normal file
View File

@ -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

View File

@ -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

View File

@ -376,35 +376,6 @@ _hciattach()
} && } &&
complete -F _hciattach 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: # Local variables:
# mode: shell-script # mode: shell-script
# sh-basic-offset: 4 # sh-basic-offset: 4

18
completions/cancel Normal file
View File

@ -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

27
completions/cfagent Normal file
View File

@ -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

View File

@ -1,22 +1,4 @@
# bash completion for cfengine # cfrun 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
_cfrun() _cfrun()
{ {

32
completions/chage Normal file
View File

@ -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

21
completions/check_perms Normal file
View File

@ -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

46
completions/chgrp Normal file
View File

@ -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

52
completions/chown Normal file
View File

@ -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

35
completions/chpasswd Normal file
View File

@ -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

22
completions/cleanarch Normal file
View File

@ -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

56
completions/complete Normal file
View File

@ -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

View File

@ -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

33
completions/dmesg Normal file
View File

@ -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

32
completions/dnsspoof Normal file
View File

@ -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

View File

@ -99,112 +99,6 @@ _dpkg_reconfigure()
} && } &&
complete -F _dpkg_reconfigure -o default 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: # Local variables:
# mode: shell-script # mode: shell-script
# sh-basic-offset: 4 # sh-basic-offset: 4

113
completions/dpkg-source Normal file
View File

@ -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

View File

@ -1,52 +1,4 @@
# dsniff util completion # dsniff 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() _dsniff()
{ {
@ -71,149 +23,6 @@ _dsniff()
} && } &&
complete -F _dsniff 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: # Local variables:
# mode: shell-script # mode: shell-script
# sh-basic-offset: 4 # sh-basic-offset: 4

24
completions/dumpdb Normal file
View File

@ -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

34
completions/dumpe2fs Normal file
View File

@ -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

30
completions/e2freefrag Normal file
View File

@ -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

View File

@ -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

21
completions/e2label Normal file
View File

@ -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

33
completions/ether-wake Normal file
View File

@ -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

31
completions/export Normal file
View File

@ -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

34
completions/faillog Normal file
View File

@ -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

45
completions/fbgs Normal file
View File

@ -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

View File

@ -1,4 +1,4 @@
# bash completion for fbi(1) and fbgs(1) # bash completion for fbi(1)
_fbi() _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)' _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 } && 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: # Local variables:
# mode: shell-script # mode: shell-script
# sh-basic-offset: 4 # sh-basic-offset: 4

23
completions/filefrag Normal file
View File

@ -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

28
completions/filesnarf Normal file
View File

@ -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

View File

@ -1,23 +1,4 @@
# freeciv completions # freeciv client 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
_civclient() _civclient()
{ {

View File

@ -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

28
completions/function Normal file
View File

@ -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

View File

@ -1,4 +1,4 @@
# bash completion for fuse # fusermount completion
_fusermount() _fusermount()
{ {

21
completions/genaliases Normal file
View File

@ -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

18
completions/gendiff Normal file
View File

@ -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

31
completions/gpasswd Normal file
View File

@ -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

33
completions/groupadd Normal file
View File

@ -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

11
completions/groupdel Normal file
View File

@ -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

32
completions/groupmems Normal file
View File

@ -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

35
completions/groupmod Normal file
View File

@ -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

View File

@ -1,4 +1,4 @@
# dvd+rw-tools completions # growisofs(1) completion
_growisofs() _growisofs()
{ {

23
completions/grpck Normal file
View File

@ -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

21
completions/hid2hci Normal file
View File

@ -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

24
completions/id Normal file
View File

@ -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

View File

@ -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 # 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 # list of all available modules for the version of the kernel currently
# running. # running.

45
completions/invoke-rc.d Normal file
View File

@ -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

63
completions/ionice Normal file
View File

@ -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

View File

@ -1,4 +1,4 @@
# iproute2 tools completion # ip(8) completion
_ip() _ip()
{ {

62
completions/jarsigner Normal file
View File

@ -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

View File

@ -315,229 +315,6 @@ _javac()
} && } &&
complete -F _javac 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: # Local variables:
# mode: shell-script # mode: shell-script
# sh-basic-offset: 4 # sh-basic-offset: 4

40
completions/javaws Normal file
View File

@ -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

31
completions/jps Normal file
View File

@ -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

24
completions/kill Normal file
View File

@ -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

25
completions/killall Normal file
View File

@ -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

View File

@ -1,4 +1,4 @@
# bash completion for FreeBSD kernel module commands # FreeBSD kldload completion
[ $UNAME = FreeBSD ] || return 1 [ $UNAME = FreeBSD ] || return 1
@ -19,16 +19,6 @@ _kldload()
} && } &&
complete -F _kldload 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: # Local variables:
# mode: shell-script # mode: shell-script
# sh-basic-offset: 4 # sh-basic-offset: 4

21
completions/kldunload Normal file
View File

@ -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

View File

@ -1,4 +1,4 @@
# bash completion for heimdal # ktutil completion
_heimdal_principals() _heimdal_principals()
{ {

34
completions/lastlog Normal file
View File

@ -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

View File

@ -1,4 +1,4 @@
# bash completion for lftp # lftp(1) completion
_lftp() _lftp()
{ {
@ -26,17 +26,6 @@ _lftp()
} && } &&
complete -F _lftp 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: # Local variables:
# mode: shell-script # mode: shell-script
# sh-basic-offset: 4 # sh-basic-offset: 4

20
completions/lftpget Normal file
View File

@ -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

22
completions/list_lists Normal file
View File

@ -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

20
completions/look Normal file
View File

@ -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

34
completions/lpq Normal file
View File

@ -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

View File

@ -1,13 +1,4 @@
# bash completion for cups # lpr(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
_lpr() _lpr()
{ {
@ -39,31 +30,6 @@ _lpr()
} && } &&
complete -F _lpr 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: # Local variables:
# mode: shell-script # mode: shell-script
# sh-basic-offset: 4 # sh-basic-offset: 4

29
completions/macof Normal file
View File

@ -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

View File

@ -5,19 +5,6 @@ _mailman_lists()
COMPREPLY=( $( compgen -W '$( list_lists -b )' -- "$cur" ) ) 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() _add_members()
{ {
local cur prev words cword split local cur prev words cword split
@ -143,20 +130,6 @@ _sync_members()
} && } &&
complete -F _sync_members 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() _list_admins()
{ {
local cur prev words cword local cur prev words cword
@ -352,19 +325,6 @@ _arch()
} && } &&
complete -F _arch 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() _inject()
{ {
local cur prev words cword split local cur prev words cword split
@ -388,21 +348,6 @@ _inject()
} && } &&
complete -F _inject 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() _check_db()
{ {
local cur prev words cword local cur prev words cword
@ -417,72 +362,6 @@ _check_db()
} && } &&
complete -F _check_db 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: # Local variables:
# mode: shell-script # mode: shell-script
# sh-basic-offset: 4 # sh-basic-offset: 4

24
completions/mailmanctl Normal file
View File

@ -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

68
completions/mdtool Normal file
View File

@ -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

33
completions/mii-diag Normal file
View File

@ -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

38
completions/mii-tool Normal file
View File

@ -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

35
completions/mktemp Normal file
View File

@ -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

21
completions/mmsitepass Normal file
View File

@ -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

View File

@ -1,4 +1,4 @@
# Monodevelop completion # monodevelop completion
_monodevelop() _monodevelop()
{ {
@ -17,65 +17,6 @@ _monodevelop()
} && } &&
complete -F _monodevelop 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: # Local variables:
# mode: shell-script # mode: shell-script
# sh-basic-offset: 4 # sh-basic-offset: 4

View File

@ -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

View File

@ -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

34
completions/munin-run Normal file
View File

@ -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

33
completions/munin-update Normal file
View File

@ -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

19
completions/munindoc Normal file
View File

@ -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

View File

@ -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

22
completions/newgrp Normal file
View File

@ -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

37
completions/newusers Normal file
View File

@ -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

Some files were not shown because too many files have changed in this diff Show More