Merge branch 'dynamic-loading'

This commit is contained in:
Ville Skyttä 2011-10-25 20:18:42 +03:00
commit b377dc5de8
349 changed files with 5407 additions and 4208 deletions

30
README
View File

@ -70,24 +70,11 @@ believed to be a bug in bash.
II.
The have() function is used to conserve memory by only installing
completion functions for those programs that are actually present on
your system. The current method of determining whether or not a given
binary is present is whether or not it can be found along a certain
path of directories. The path that is currently searched is:
$PATH:/sbin:/usr/sbin:/usr/local/sbin
where $PATH is your user path at the time the bash completion file is
sourced.
III.
Many of the completion functions assume GNU versions of the various
text utilities that they call (e.g. grep, sed and awk). Your mileage
may vary.
IV.
III.
If you are seeing 'unbound variable' warnings from bash when hitting
<Tab>, this is because you have either 'set -u' or 'set -o nounset'
@ -127,10 +114,17 @@ Q. I author/maintain package X and would like to maintain my own
completion code for this package. Where should I put it to be sure
that interactive bash shells will find it and source it?
Put it in the directory pointed to by $BASH_COMPLETION_COMPAT_DIR, which
is defined at the beginning of the main completion script. Any
scripts placed in this directory will be sourced by interactive
bash shells. Usually, this is /etc/bash_completion.d.
Install it in one of the directories pointed to by
bash-completion's pkgconfig file variables. There are two
alternatives: the recommended one is 'completionsdir' (get it with
"pkg-config --variable=completionsdir bash-completion") from which
completions are loaded on demand based on invoked commands' names,
so be sure to name your completion file accordingly, and to include
for example symbolic links in case the file provides completions
for more than one command. The other one which is present for
backwards compatibility reasons is 'compatdir' (get it with
"pkg-config --variable=compatdir bash-completion") from which files
are loaded when bash_completion is loaded.
Q. I use CVS in combination with passwordless ssh access to my remote
repository. How can I have the cvs command complete on remotely

33
TODO
View File

@ -1,33 +0,0 @@
bash completion needs to be rewritten from the ground up.
---------------------------------------------------------
bash completion really needs to be rewritten from the ground up, using all of
the features available in bash 4.1+ and without regard for compatibility with
earlier versions.
At that time, it should be split into multiple files for easier source
management. Whether or not it is actually installed on the destination
computer as separate files is a matter for future debate.
If it were installed as tens or even hundreds of files, each of which had to
be opened to decide whether it should be sourced in its entirety, that could
prove very expensive on some systems.
Alternatively, a master file could decide which of the individual completion
files should be sourced. In that way, we wouldn't need to open extra files
just to ascertain that the commands for those functions aren't on the system,
anyway.
A further alternative is that a build process be created, which would
concatenate the various files into a single completion file, similar to what
we have now. This option is my least favourite, because a system with a lot of
packages installed currently has to deal with sourcing over 200 kB of bash
code for each invocation of an interactive shell.
An even better alternative would be if bash supported dynamic loading of shell
functions (in the manner of zsh), but I don't believe there are any plans to
add this feature.
--
Ian Macdonald
Amsterdam, March 2006

View File

@ -46,17 +46,6 @@ readonly BASH_COMPLETION_COMPAT_DIR
#
_blacklist_glob='@(acroread.sh)'
# Set a couple of useful vars
#
UNAME=$( uname -s )
# strip OS type and version under Cygwin (e.g. CYGWIN_NT-5.1 => Cygwin)
UNAME=${UNAME/CYGWIN_*/Cygwin}
case ${UNAME} in
Linux|GNU|GNU/*) USERLAND=GNU ;;
*) USERLAND=${UNAME} ;;
esac
# Turn on extended globbing and programmable completion
shopt -s extglob progcomp
@ -103,16 +92,31 @@ complete -b builtin
# start of section containing completion functions called by other functions
# Check if we're running on the given userland
# @param $1 userland to check for
_userland()
{
local userland=$( uname -s )
[[ $userland == @(Linux|GNU/*) ]] && userland=GNU
[[ $userland == $1 ]]
}
# This function checks whether we have a given program on the system.
# No need for bulky functions in memory if we don't.
#
_have()
{
# Completions for system administrator commands are installed as well in
# case completion is attempted via `sudo command ...'.
PATH=$PATH:/usr/sbin:/sbin:/usr/local/sbin type $1 &>/dev/null
}
# Backwards compatibility for compat completions that use have().
# @deprecated should no longer be used; generally not needed with dynamically
# loaded completions, and _have is suitable for runtime use.
have()
{
unset -v have
# Completions for system administrator commands are installed as well in
# case completion is attempted via `sudo command ...'.
PATH=$PATH:/usr/sbin:/sbin:/usr/local/sbin type $1 &>/dev/null &&
have="yes"
_have $1 && have=yes
}
# This function checks whether a given readline variable
@ -601,11 +605,11 @@ _split_longopt()
return 1
}
# Initialize completion and deal with redirections: do file completion where
# appropriate, and adjust prev, words, and cword as if no redirections exist
# so that completions do not need to deal with them. Before calling this
# function, make sure cur, prev, words, and cword are local, ditto split if
# you use -s.
# Initialize completion and deal with various general things: do file
# and variable completion where appropriate, and adjust prev, words,
# and cword as if no redirections exist so that completions do not
# need to deal with them. Before calling this function, make sure
# cur, prev, words, and cword are local, ditto split if you use -s.
#
# Options:
# -n EXCLUDE Passed to _get_comp_words_by_ref -n with redirection chars
@ -640,6 +644,14 @@ _init_completion()
local redir="@(?([0-9])<|?([0-9&])>?(>)|>&)"
_get_comp_words_by_ref -n "$exclude<>&" cur prev words cword
# Complete variable names.
if [[ $cur =~ ^(\$\{?)([A-Za-z0-9_]*)$ ]]; then
[[ $cur == *{* ]] && local suffix=} || local suffix=
COMPREPLY=( $( compgen -P ${BASH_REMATCH[1]} -S "$suffix" -v -- \
"${BASH_REMATCH[2]}" ) )
return 1
fi
# Complete on files if current is a redirect possibly followed by a
# filename, e.g. ">foo", or previous is a "bare" redirect, e.g. ">".
if [[ $cur == $redir* || $prev == $redir ]]; then
@ -954,7 +966,7 @@ _expand()
# This function completes on process IDs.
# AIX and Solaris ps prefers X/Open syntax.
[[ $UNAME == @(SunOS|AIX) ]] &&
[[ $OSTYPE == *@(solaris|aix)* ]] &&
_pids()
{
COMPREPLY=( $( compgen -W '$( command ps -efo pid | sed 1d )' -- "$cur" ))
@ -966,7 +978,7 @@ _pids()
# This function completes on process group IDs.
# AIX and SunOS prefer X/Open, all else should be BSD.
[[ $UNAME == @(SunOS|AIX) ]] &&
[[ $OSTYPE == *@(solaris|aix)* ]] &&
_pgids()
{
COMPREPLY=( $( compgen -W '$( command ps -efo pgid | sed 1d )' -- "$cur" ))
@ -978,7 +990,7 @@ _pgids()
# This function completes on process names.
# AIX and SunOS prefer X/Open, all else should be BSD.
[[ $UNAME == @(SunOS|AIX) ]] &&
[[ $OSTYPE == *@(solaris|aix)* ]] &&
_pnames()
{
COMPREPLY=( $( compgen -X '<defunct>' -W '$( command ps -efo comm | \
@ -1272,9 +1284,9 @@ _terms()
}
# a little help for FreeBSD ports users
[ $UNAME = FreeBSD ] && complete -W 'index search fetch fetch-list extract \
patch configure build install reinstall deinstall clean clean-depends \
kernel buildworld' make
[[ $OSTYPE == *freebsd* ]] && complete -W 'index search fetch fetch-list
extract patch configure build install reinstall deinstall clean
clean-depends kernel buildworld' make
# This function provides simple user@host completion
#
@ -1691,15 +1703,12 @@ _longopt()
fi
}
# makeinfo and texi2dvi are defined elsewhere.
for i in a2ps awk base64 bash bc bison cat colordiff cp csplit \
complete -F _longopt a2ps awk base64 bash bc bison cat colordiff cp csplit \
cut date df diff dir du enscript env expand fmt fold gperf \
grep grub head indent irb ld ldd less ln ls m4 md5sum mkdir mkfifo mknod \
mv netstat nl nm objcopy objdump od paste patch pr ptx readelf rm rmdir \
sed seq sha{,1,224,256,384,512}sum shar sort split strip sum tac tail tee \
texindex touch tr uname unexpand uniq units vdir wc wget who; do
have $i && complete -F _longopt $i
done
unset i
texindex touch tr uname unexpand uniq units vdir wc wget who
declare -A _xspecs
_filedir_xspec()
@ -1810,7 +1819,52 @@ _install_xspec '!@(*.@(ks|jks|jceks|p12|pfx|bks|ubr|gkr|cer|crt|cert|p7b|pkipath
_install_xspec '!*.@(mp[234c]|og[ag]|@(fl|a)ac|m4[abp]|spx|tta|w?(a)v|wma|aif?(f)|asf|ape)' kid3 kid3-qt
unset -f _install_xspec
# source completion directory definitions
# Minimal completion to use as fallback in _completion_loader.
_minimal()
{
local cur prev words cword split
_init_completion -s || return
$split && return
_filedir
}
# set up dynamic completion loading
_completion_loader()
{
local compdir=./completions
[[ $BASH_SOURCE == */* ]] && compdir="${BASH_SOURCE%/*}/completions"
# Special case for init.d scripts.
if [[ $1 == /etc?(/rc.d)/init.d/* ]]; then
. "$compdir/service" &>/dev/null && return 124 || return 1
fi
# Try basename.
. "$compdir/${1##*/}" &>/dev/null && return 124
# Need to define *something*, otherwise there will be no completion at all.
complete -F _minimal "$1" && return 124
} &&
complete -D -F _completion_loader
# Function for loading and calling functions from dynamically loaded
# completion files that may not have been sourced yet.
# @param $1 completion file to load function from in case it is missing
# @param $2... function and its arguments
_xfunc()
{
set -- "$@"
local srcfile=$1
shift
declare -F $1 &>/dev/null || {
local compdir=./completions
[[ $BASH_SOURCE == */* ]] && compdir="${BASH_SOURCE%/*}/completions"
. "$compdir/$srcfile"
}
"$@"
}
# source compat completion directory definitions
if [[ -d $BASH_COMPLETION_COMPAT_DIR && -r $BASH_COMPLETION_COMPAT_DIR && \
-x $BASH_COMPLETION_COMPAT_DIR ]]; then
for i in $(LC_ALL=C command ls "$BASH_COMPLETION_COMPAT_DIR"); do
@ -1819,22 +1873,13 @@ if [[ -d $BASH_COMPLETION_COMPAT_DIR && -r $BASH_COMPLETION_COMPAT_DIR && \
&& -f $i && -r $i ]] && . "$i"
done
fi
if [[ "${BASH_SOURCE[0]%/*}/completions" != $BASH_COMPLETION_COMPAT_DIR && \
-d "${BASH_SOURCE[0]%/*}/completions" && -r "${BASH_SOURCE[0]%/*}/completions" && \
-x "${BASH_SOURCE[0]%/*}/completions" ]]; then
for i in $(LC_ALL=C command ls "${BASH_SOURCE[0]%/*}/completions"); do
i="${BASH_SOURCE[0]%/*}/completions/$i"
[[ ${i##*/} != @($_backup_glob|Makefile*|$_blacklist_glob) \
&& -f $i && -r $i ]] && . "$i"
done
fi
unset i
# source user completion file
[[ ${BASH_SOURCE[0]} != ~/.bash_completion && -r ~/.bash_completion ]] \
&& . ~/.bash_completion
unset -f have
unset UNAME USERLAND have
unset have
set $BASH_COMPLETION_ORIGINAL_V_VALUE
unset BASH_COMPLETION_ORIGINAL_V_VALUE

176
completions/.gitignore vendored Normal file
View File

@ -0,0 +1,176 @@
a2x
aclocal-1.11
alpine
alternatives
animate
apropos
asciidoc.py
autoheader
automake-1.11
autossh
autoupdate
btdownloadcurses.py
btdownloadgui.py
c++
cc
cdrecord
ci
ciptool
civclient
civserver
co
compare
compgen
composite
conjure
cowthink
createdb
dcop
declare
dfutool
display
dpkg-deb
dpkg-reconfigure
dropdb
edquota
filebucket
freeciv-sdl
freeciv-xaw
g++
g4
g77
gcj
gkrellm2
gmake
gmplayer
gnumake
gpc
hciattach
hciconfig
host
hping
hping3
identify
ifdown
ifstatus
import
javac
javadoc
kplayer
l2ping
lbzip2
ldapadd
ldapcompare
ldapdelete
ldapmodify
ldapmodrdn
ldappasswd
ldapwhoami
lintian-info
lvchange
lvcreate
lvdisplay
lvextend
lvmdiskscan
lvreduce
lvremove
lvrename
lvresize
lvs
lvscan
mailsnarf
mdecrypt
mencoder
mkisofs
modinfo
modprobe
mogrify
montage
mplayer2
msgsnarf
muttng
ncal
pbzip2
pccardctl
perldoc
phing
pidof
pigz
pinfo
ping6
pkg_deinstall
pkg_info
pkill
pm-suspend
pm-suspend-hybrid
pmake
postalias
puppetca
puppetd
puppetdoc
puppetmasterd
puppetqd
puppetrun
pvchange
pvcreate
pvdisplay
pvmove
pvremove
pvs
pvscan
pxz
python2
python3
quotacheck
quotaoff
quotaon
ralsh
rcsdiff
rdict
repquota
rfcomm
rlog
rpm2targz
rpm2txz
rpmbuild
rpmbuild-md5
sbcl-mt
scp
sdptool
setquota
sftp
slogin
smbcacls
smbcquotas
smbget
smbpasswd
smbtar
smbtree
spovray
stream
tightvncviewer
tracepath6
typeset
umount
vgcfgbackup
vgcfgrestore
vgchange
vgck
vgconvert
vgdisplay
vgexport
vgextend
vgimport
vgmerge
vgmknodes
vgreduce
vgremove
vgrename
vgs
vgscan
vgsplit
vigr
whatis
xpovray
xvnc4viewer
ypcat

View File

@ -1,38 +1,57 @@
bashcompdir = $(pkgdatadir)/completions
bashcomp_DATA = abook \
aclocal \
add_members \
alias \
ant \
apache2ctl \
apt \
apt-build \
apt-cache \
apt-get \
aptitude \
arch \
arping \
arpspoof \
asciidoc \
aspell \
autoconf \
automake \
autoreconf \
autorpm \
bash-builtins \
bind-utils \
bitkeeper \
bittorrent \
bluez \
autoscan \
badblocks \
bk \
brctl \
btdownloadheadless.py \
bzip2 \
cal \
cancel \
cardctl \
cfengine \
cfagent \
cfrun \
chage \
change_pw \
check_db \
check_perms \
chgrp \
chkconfig \
chown \
chpasswd \
chrpath \
chsh \
cksfv \
cleanarch \
clisp \
clone_member \
complete \
config_list \
configure \
coreutils \
convert \
cowsay \
cpan2dist \
cpio \
cppcheck \
crontab \
cups \
curl \
cryptsetup \
cvs \
@ -40,119 +59,197 @@ bashcomp_DATA = abook \
dd \
dhclient \
dict \
dmesg \
dot \
dpkg \
dpkg-source \
dselect \
dsniff \
dvd+rw-tools \
e2fsprogs \
dumpdb \
dumpe2fs \
e2freefrag \
e2label \
ether-wake \
evince \
explodepkg \
export \
faillog \
fbgs \
fbi \
feh \
file \
findutils \
freeciv \
freerdp \
fuse \
filefrag \
filesnarf \
find \
find_member \
freeciv-gtk2 \
freeciv-server \
function \
fusermount \
gcc \
gcl \
gdb \
genaliases \
gendiff \
genisoimage \
getent \
gkrellm \
gnatmake \
gnome-mplayer \
gpasswd \
gpg \
gpg2 \
gprof \
groupadd \
groupdel \
groupmems \
groupmod \
growisofs \
grpck \
gzip \
hcitool \
hddtemp \
heimdal \
hid2hci \
hping2 \
htpasswd \
iconv \
idn \
iftop \
ifupdown \
imagemagick \
ifup \
info \
inject \
insmod \
installpkg \
invoke-rc.d \
ionice \
ip \
iptables \
ipmitool \
iproute2 \
ipsec \
iputils \
ipv6calc \
iscsiadm \
isql \
iwconfig \
iwlist \
iwpriv \
iwspy \
jar \
jarsigner \
java \
javaws \
jps \
k3b \
kcov \
kill \
killall \
kldload \
kldunload \
ktutil \
larch \
lastlog \
ldapsearch \
ldapvi \
lftp \
lftpget \
lilo \
links \
lintian \
lisp \
list_admins \
list_lists \
list_members \
list_owners \
look \
lpq \
lpr \
lrzip \
lsof \
lvm \
lzma \
lzop \
mailman \
macof \
mailmanctl \
make \
makepkg \
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 \
newlist \
newusers \
nmap \
nslookup \
ntpdate \
openldap \
openssl \
open-iscsi \
p4 \
pack200 \
passwd \
perl \
pgrep \
pine \
ping \
pkg-config \
pkg_install \
pkgtools \
pm-utils \
pkg_delete \
pkgtool \
pm-hibernate \
pm-is-supported \
pm-powersave \
portinstall \
portupgrade \
postcat \
postconf \
postfix \
postgresql \
postmap \
postsuper \
povray \
prelink \
procps \
protoc \
psql \
puppet \
pwck \
pwdx \
pwgen \
python \
qdbus \
qemu \
quota-tools \
qrunner \
querybts \
quota \
rcs \
rdesktop \
remove_members \
removepkg \
renice \
reptyr \
reportbug \
resolvconf \
rfkill \
ri \
rmlist \
rmmod \
route \
rpcdebug \
rpm \
rpm2tgz \
@ -160,39 +257,57 @@ bashcomp_DATA = abook \
rrdtool \
rsync \
rtcwake \
samba \
sbcl \
sbopkg \
screen \
service \
sh \
shadow \
sitecopy \
slackpkg \
slapt \
slapt-get \
slapt-src \
smartctl \
smbclient \
snownews \
sqlite3 \
ssh \
ssh-copy-id \
sshfs \
sshmitm \
sshow \
strace \
svk \
sync_members \
sysbench \
sysctl \
sysv-rc \
tar \
tcpdump \
tcpkill \
tcpnice \
tracepath \
tune2fs \
unace \
unpack200 \
unrar \
unshunt \
update-alternatives \
util-linux \
update-rc.d \
upgradepkg \
urlsnarf \
useradd \
userdel \
usermod \
vipw \
vncviewer \
vpnc \
wireless-tools \
watch \
webmitm \
withlist \
wodim \
wol \
wtf \
wvdial \
xfreerdp \
xgamma \
xhost \
xm \
@ -204,8 +319,473 @@ bashcomp_DATA = abook \
xrdb \
xsltproc \
xz \
yp-tools \
xzdec \
ypmatch \
yum-arch
EXTRA_DIST = $(bashcomp_DATA) \
_mock _modules _subversion _yum _yum-utils
CLEANFILES = \
a2x \
aclocal-1.11 \
alpine \
alternatives \
animate \
apropos \
asciidoc.py \
autoheader \
automake-1.11 \
autossh \
autoupdate \
btdownloadcurses.py \
btdownloadgui.py \
c++ \
cc \
cdrecord \
ci \
ciptool \
civclient \
civserver \
co \
compare \
compgen \
composite \
conjure \
cowthink \
createdb \
dcop \
declare \
dfutool \
display \
dpkg-deb \
dpkg-reconfigure \
dropdb \
edquota \
filebucket \
freeciv-sdl \
freeciv-xaw \
g++ \
g4 \
g77 \
gcj \
gkrellm2 \
gmake \
gmplayer \
gnumake \
gpc \
hciattach \
hciconfig \
host \
hping \
hping3 \
identify \
ifdown \
ifstatus \
import \
javac \
javadoc \
kplayer \
l2ping \
lbzip2 \
ldapadd \
ldapcompare \
ldapdelete \
ldapmodify \
ldapmodrdn \
ldappasswd \
ldapwhoami \
lintian-info \
lvchange \
lvcreate \
lvdisplay \
lvextend \
lvmdiskscan \
lvreduce \
lvremove \
lvrename \
lvresize \
lvs \
lvscan \
mailsnarf \
mdecrypt \
mencoder \
mkisofs \
modinfo \
modprobe \
mogrify \
montage \
mplayer2 \
msgsnarf \
muttng \
ncal \
pbzip2 \
pccardctl \
perldoc \
phing \
pidof \
pigz \
pinfo \
ping6 \
pkg_deinstall \
pkg_info \
pkill \
pm-suspend \
pm-suspend-hybrid \
pmake \
postalias \
puppetca \
puppetd \
puppetdoc \
puppetmasterd \
puppetqd \
puppetrun \
pvchange \
pvcreate \
pvdisplay \
pvmove \
pvremove \
pvs \
pvscan \
pxz \
python2 \
python3 \
quotacheck \
quotaoff \
quotaon \
ralsh \
rcsdiff \
rdict \
repquota \
rfcomm \
rlog \
rpm2targz \
rpm2txz \
rpmbuild \
rpmbuild-md5 \
sbcl-mt \
scp \
sdptool \
setquota \
sftp \
slogin \
smbcacls \
smbcquotas \
smbget \
smbpasswd \
smbtar \
smbtree \
spovray \
stream \
tightvncviewer \
tracepath6 \
typeset \
umount \
vgcfgbackup \
vgcfgrestore \
vgchange \
vgck \
vgconvert \
vgdisplay \
vgexport \
vgextend \
vgimport \
vgmerge \
vgmknodes \
vgreduce \
vgremove \
vgrename \
vgs \
vgscan \
vgsplit \
vigr \
whatis \
xpovray \
xvnc4viewer \
ypcat
symlinks:
for file in aclocal-1.11 ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) aclocal $(targetdir)/$$file ; \
done
for file in phing ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) ant $(targetdir)/$$file ; \
done
for file in a2x asciidoc.py ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) asciidoc $(targetdir)/$$file ; \
done
for file in automake-1.11 ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) automake $(targetdir)/$$file ; \
done
for file in autoheader ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) autoreconf $(targetdir)/$$file ; \
done
for file in autoupdate ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) autoscan $(targetdir)/$$file ; \
done
for file in btdownloadcurses.py btdownloadgui.py ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) btdownloadheadless.py $(targetdir)/$$file ; \
done
for file in lbzip2 pbzip2 ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) bzip2 $(targetdir)/$$file ; \
done
for file in ncal ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) cal $(targetdir)/$$file ; \
done
for file in pccardctl ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) cardctl $(targetdir)/$$file ; \
done
for file in compgen ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) complete $(targetdir)/$$file ; \
done
for file in mogrify display animate identify montage composite \
compare conjure import stream ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) convert $(targetdir)/$$file ; \
done
for file in cowthink ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) cowsay $(targetdir)/$$file ; \
done
for file in rdict ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) dict $(targetdir)/$$file ; \
done
for file in dpkg-deb dpkg-reconfigure ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) dpkg $(targetdir)/$$file ; \
done
for file in mailsnarf msgsnarf ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) filesnarf $(targetdir)/$$file ; \
done
for file in civclient freeciv-sdl freeciv-xaw ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) freeciv-gtk2 $(targetdir)/$$file ; \
done
for file in civserver ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) freeciv-server $(targetdir)/$$file ; \
done
for file in declare typeset ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) function $(targetdir)/$$file ; \
done
for file in g++ c++ g77 gcj gpc cc ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) gcc $(targetdir)/$$file ; \
done
for file in mkisofs ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) genisoimage $(targetdir)/$$file ; \
done
for file in gkrellm2 ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) gkrellm $(targetdir)/$$file ; \
done
for file in pigz ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) gzip $(targetdir)/$$file ; \
done
for file in sdptool l2ping rfcomm ciptool dfutool hciconfig \
hciattach ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) hcitool $(targetdir)/$$file ; \
done
for file in hping hping3 ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) hping2 $(targetdir)/$$file ; \
done
for file in ifdown ifstatus ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) ifup $(targetdir)/$$file ; \
done
for file in pinfo ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) info $(targetdir)/$$file ; \
done
for file in modprobe modinfo ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) insmod $(targetdir)/$$file ; \
done
for file in javac javadoc ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) java $(targetdir)/$$file ; \
done
for file in pkill ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) killall $(targetdir)/$$file ; \
done
for file in ldapadd ldapmodify ldapdelete ldapcompare ldapmodrdn \
ldapwhoami ldappasswd ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) ldapsearch $(targetdir)/$$file ; \
done
for file in lintian-info ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) lintian $(targetdir)/$$file ; \
done
for file in lvmdiskscan pvscan pvs pvdisplay pvchange pvcreate pvmove \
pvremove vgscan vgs vgdisplay vgchange vgremove vgrename \
vgreduce vgextend vgimport vgexport vgck vgconvert \
vgcfgbackup vgcfgrestore vgmerge vgsplit vgmknodes lvscan lvs \
lvdisplay lvchange lvcreate lvremove lvrename lvreduce \
lvresize lvextend ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) lvm $(targetdir)/$$file ; \
done
for file in gmake gnumake pmake ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) make $(targetdir)/$$file ; \
done
for file in apropos whatis ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) man $(targetdir)/$$file ; \
done
for file in mdecrypt ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) mcrypt $(targetdir)/$$file ; \
done
for file in umount ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) mount $(targetdir)/$$file ; \
done
for file in mplayer2 mencoder gmplayer kplayer ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) mplayer $(targetdir)/$$file ; \
done
for file in muttng ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) mutt $(targetdir)/$$file ; \
done
for file in host ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) nslookup $(targetdir)/$$file ; \
done
for file in g4 ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) p4 $(targetdir)/$$file ; \
done
for file in perldoc ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) perl $(targetdir)/$$file ; \
done
for file in pidof ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) pgrep $(targetdir)/$$file ; \
done
for file in alpine ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) pine $(targetdir)/$$file ; \
done
for file in ping6 ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) ping $(targetdir)/$$file ; \
done
for file in pkg_info pkg_deinstall ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) pkg_delete $(targetdir)/$$file ; \
done
for file in pm-suspend pm-suspend-hybrid ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) pm-hibernate $(targetdir)/$$file ; \
done
for file in createdb dropdb ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) psql $(targetdir)/$$file ; \
done
for file in postalias ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) postmap $(targetdir)/$$file ; \
done
for file in xpovray spovray ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) povray $(targetdir)/$$file ; \
done
for file in puppetmasterd puppetd puppetca ralsh puppetrun puppetqd \
filebucket puppetdoc ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) puppet $(targetdir)/$$file ; \
done
for file in python2 python3 ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) python $(targetdir)/$$file ; \
done
for file in dcop ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) qdbus $(targetdir)/$$file ; \
done
for file in setquota edquota quotacheck repquota quotaon quotaoff ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) quota $(targetdir)/$$file ; \
done
for file in ci co rlog rcsdiff ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) rcs $(targetdir)/$$file ; \
done
for file in rpmbuild rpmbuild-md5 ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) rpm $(targetdir)/$$file ; \
done
for file in rpm2txz rpm2targz ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) rpm2tgz $(targetdir)/$$file ; \
done
for file in smbget smbcacls smbcquotas smbpasswd smbtar smbtree ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) smbclient $(targetdir)/$$file ; \
done
for file in sbcl-mt ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) sbcl $(targetdir)/$$file ; \
done
for file in slogin autossh sftp scp ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) ssh $(targetdir)/$$file ; \
done
for file in tracepath6 ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) tracepath $(targetdir)/$$file ; \
done
for file in alternatives ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) update-alternatives $(targetdir)/$$file ; \
done
for file in vigr ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) vipw $(targetdir)/$$file ; \
done
for file in tightvncviewer xvnc4viewer ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) vncviewer $(targetdir)/$$file ; \
done
for file in cdrecord ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) wodim $(targetdir)/$$file ; \
done
for file in pxz ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) xz $(targetdir)/$$file ; \
done
for file in ypcat ; do \
rm -f $(targetdir)/$$file && \
$(LN_S) ypmatch $(targetdir)/$$file ; \
done
.PHONY: symlinks
all-local: targetdir = $(srcdir)
all-local: symlinks
install-data-local: targetdir = $(DESTDIR)$(bashcompdir)
install-data-local: symlinks

View File

@ -3,8 +3,6 @@
# bash completion for mock
have mock || return
_mock()
{
local cur prev words cword split

View File

@ -19,7 +19,7 @@
# Test for existence of /etc/profile.d/modules.sh too because we may end up
# being sourced before it and thus before the `module' alias has been defined.
[ -f /etc/profile.d/modules.sh ] || have module || return
[ -f /etc/profile.d/modules.sh ] || return 1
_module_list ()
{

View File

@ -3,8 +3,6 @@
# svn completion
have svn || return
_svn()
{
local cur prev words cword

View File

@ -3,8 +3,6 @@
# yum(8) completion
have yum || return
_yum_list()
{
if [[ "$1" == all ]] ; then

View File

@ -3,8 +3,6 @@
# bash completion for repomanage
have repomanage || return
_repomanage()
{
local cur prev words cword split

View File

@ -1,7 +1,5 @@
# abook(1) completion
have abook || return
_abook()
{
local cur prev words cword

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

38
completions/add_members Normal file
View File

@ -0,0 +1,38 @@
# mailman add_members completion
_add_members()
{
local cur prev words cword split
_init_completion -s || return
case $prev in
-r|-d|--regular-members-file|--digest-members-file)
_filedir
return 0
;;
-w|-a|--welcome-msg|--admin-notify)
COMPREPLY=( $( compgen -W 'y n' -- "$cur") )
return 0
;;
esac
$split && return 0
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--regular-members-file \
--digest-members-file --welcome-msg \
--admin-notify --help' -- "$cur" ) )
else
_xfunc list_lists _mailman_lists
fi
} &&
complete -F _add_members add_members
# 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

View File

@ -1,7 +1,5 @@
# bash completion for ant and phing
have ant || have phing || return
_ant()
{
local cur prev words cword
@ -59,9 +57,9 @@ _ant()
COMPREPLY=( $( compgen -W '$targets' -- "$cur" ) )
fi
} &&
have ant && { type complete-ant-cmd.pl &>/dev/null && \
complete -C complete-ant-cmd.pl -F _ant ant || complete -F _ant ant; }
have phing && complete -F _ant phing
complete -F _ant ant phing
type complete-ant-cmd.pl &>/dev/null && \
complete -C complete-ant-cmd.pl -F _ant ant || :
# Local variables:
# mode: shell-script

View File

@ -1,7 +1,5 @@
# apache2ctl(1) completion
have apache2ctl || return
_apache2ctl()
{
local cur prev words cword

View File

@ -1,7 +1,5 @@
# Debian apt-build(1) completion.
have apt-build || return
_apt_build()
{
local cur prev words cword

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

@ -1,6 +1,5 @@
# Debian apt-get(8) completion.
have apt-get &&
_apt_get()
{
local cur prev words cword
@ -21,7 +20,7 @@ _apt_get()
COMPREPLY=( $( _comp_dpkg_installed_packages $cur ) )
else
# assume RPM based
_rpm_installed_packages
_xfunc rpm _rpm_installed_packages
fi
return 0
;;
@ -73,80 +72,6 @@ _apt_get()
} &&
complete -F _apt_get apt-get
# Debian apt-cache(8) completion.
#
have apt-cache &&
_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

View File

@ -1,8 +1,6 @@
# Debian aptitude(1) completion
have aptitude || return
have grep-status && {
_have grep-status && {
_comp_dpkg_hold_packages()
{
grep-status -P -e "^$1" -a -FStatus 'hold' -n -s Package

53
completions/arch Normal file
View File

@ -0,0 +1,53 @@
# mailman arch completion
# Try to detect whether this is the mailman "arch" to avoid installing
# it for the coreutils/util-linux-ng one.
_have mailmanctl &&
_arch()
{
local cur prev words cword split
_init_completion -s || return
case $prev in
-w|-g|-d|--welcome-msg|--goodbye-msg|--digest)
COMPREPLY=( $( compgen -W 'y n' -- "$cur") )
return 0
;;
-d|--file)
_filedir
return 0
;;
esac
$split && return 0
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--wipe --start --end --quiet \
--help' -- "$cur" ) )
else
local args=$cword
for (( i=1; i < cword; i++ )); do
if [[ "${words[i]}" == -* ]]; then
args=$(($args-1))
fi
done
case $args in
1)
_xfunc list_lists _mailman_lists
;;
2)
_filedir
;;
esac
fi
} &&
complete -F _arch arch
# 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/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,5 +1,3 @@
have asciidoc || have a2x || return
_asciidoc_doctype()
{
COMPREPLY+=( $( compgen -W 'article book manpage' -- "$cur" ) )

View File

@ -1,7 +1,5 @@
# bash completion for aspell
have aspell || return
_aspell_dictionary()
{
local datadir

View File

@ -1,6 +1,5 @@
# Completions for autoconf tools
# autoconf(1) completion
have autoconf &&
_autoconf()
{
local cur prev words cword split
@ -38,77 +37,6 @@ _autoconf()
} &&
complete -F _autoconf autoconf
have autoreconf || have autoheader &&
_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
have autoscan || have autoupdate &&
_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

View File

@ -1,6 +1,5 @@
# Completions for automake tools
# automake(1) completion
have automake &&
_automake()
{
local cur prev words cword split
@ -34,39 +33,6 @@ _automake()
} &&
complete -F _automake automake automake-1.11
have aclocal &&
_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

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

View File

@ -1,7 +1,5 @@
# autorpm(8) completion
have autorpm || return
_autorpm()
{
local cur prev words cword

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

@ -1,14 +1,12 @@
# BitKeeper completion adapted from code by Bart Trojanowski <bart@jukie.net>
have bk || return
_bk()
{
local cur prev words cword
_init_completion || return
local BKCMDS="$( bk help topics | awk '/^ bk/ { print $4 }' | \
xargs printf '%s ' )"
local BKCMDS="$( bk help topics 2>/dev/null | \
awk '/^ bk/ { print $4 }' | xargs printf '%s ' )"
COMPREPLY=( $( compgen -W "$BKCMDS" -- "$cur" ) )
_filedir

View File

@ -1,7 +1,5 @@
# bash completion for brctl
have brctl || return
_brctl()
{
local cur prev words cword

View File

@ -1,8 +1,5 @@
# btdownloadheadless(1) completion
have btdownloadheadless.py || have btdownloadcurses.py || \
have btdownloadgui.py || return
_btdownload()
{
local cur prev words cword

View File

@ -1,7 +1,5 @@
# bash completion for bzip2
have bzip2 || have pbzip2 || have lbzip2 || return
_bzip2()
{
local cur prev words cword

View File

@ -1,5 +1,3 @@
have cal || have ncal || return
_cal()
{
local cur prev words cword

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

View File

@ -1,7 +1,5 @@
# Linux cardctl(8) completion
have cardctl || have pccardctl || return
_cardctl()
{
local cur prev words cword

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,24 +1,4 @@
# bash completion for cfengine
have cfagent || return
_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()
{

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

31
completions/change_pw Normal file
View File

@ -0,0 +1,31 @@
# mailman change_pw completion
_change_pw()
{
local cur prev words cword split
_init_completion -s || return
case $prev in
-l|--listname)
_xfunc list_lists _mailman_lists
return 0
;;
esac
$split && return 0
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--all --domain --listname \
--password --quiet --help' -- "$cur" ) )
fi
} &&
complete -F _change_pw change_pw
# 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

23
completions/check_db Normal file
View File

@ -0,0 +1,23 @@
# mailman check_db completion
_check_db()
{
local cur prev words cword
_init_completion || return
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--all --verbose --help' -- "$cur" ) )
else
_xfunc list_lists _mailman_lists
fi
} &&
complete -F _check_db check_db
# 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

View File

@ -1,7 +1,5 @@
# chkconfig(8) completion
have chkconfig || return
_chkconfig()
{
local cur prev words cword split

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

View File

@ -1,5 +1,3 @@
have chrpath || return
_chrpath()
{
local cur prev words cword

View File

@ -1,7 +1,5 @@
# chsh(1) completion
have chsh || return
_chsh()
{
local cur prev words cword

View File

@ -1,7 +1,5 @@
# cksfv completion by Chris <xris@forevermore.net>
have cksfv || return
_cksfv()
{
local cur prev words cword

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

View File

@ -1,8 +1,6 @@
# bash brogrammable completion for various Common Lisp implementations by
# Nikodemus Siivola <nikodemus@random-state.net>
have clisp || return
_clisp()
{
local cur prev words cword

31
completions/clone_member Normal file
View File

@ -0,0 +1,31 @@
# mailman clone_member completion
_clone_member()
{
local cur prev words cword split
_init_completion -s || return
case $prev in
-l|--listname)
_xfunc list_lists _mailman_lists
return 0
;;
esac
$split && return 0
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--listname --remove --admin \
--quiet --nomodify --help' -- "$cur" ) )
fi
} &&
complete -F _clone_member clone_member
# 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

33
completions/config_list Normal file
View File

@ -0,0 +1,33 @@
# mailman config_list completion
_config_list()
{
local cur prev words cword split
_init_completion -s || return
case $prev in
-i|-o|--inputfile|--outputfile)
_filedir
return 0
;;
esac
$split && return 0
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--inputfile --outputfile \
--checkonly --verbose --help' -- "$cur" ) )
else
_xfunc list_lists _mailman_lists
fi
} &&
complete -F _config_list config_list
# 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,7 +1,5 @@
# bash completion for configure
# No "have configure" here on purpose, it's rarely in any $PATH
_configure()
{
local cur prev words cword split

View File

@ -1,7 +1,5 @@
# bash completion for ImageMagick
have convert || return
_ImageMagick()
{
case $prev in

View File

@ -1,143 +0,0 @@
# Completions for various core utilities
# chown(1) completion
#
have chown &&
_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
#
have chgrp &&
_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
#
have id &&
_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
#
have mktemp &&
_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

View File

@ -1,7 +1,5 @@
# bash completion for cowsay
have cowsay || return
_cowsay()
{
local cur prev words cword

View File

@ -1,7 +1,5 @@
# bash completion for cpan2dist
have cpan2dist || return
_cpan2dist()
{
local cur prev words cword

View File

@ -1,7 +1,5 @@
# bash completion for cpio
have cpio || return
_cpio_format()
{
COMPREPLY=( $( compgen -W 'bin odc newc crc tar ustar hpbin hpodc' -- "$cur" ) )

View File

@ -1,7 +1,5 @@
# bash completion for cppcheck(1)
have cppcheck || return
_cppcheck()
{
local cur prev words cword split

View File

@ -1,7 +1,5 @@
# crontab(1) completion
have crontab || return
_crontab()
{
local cur prev words cword

View File

@ -1,7 +1,5 @@
# bash completion for cryptsetup
have cryptsetup || return
_cryptsetup_name()
{
COMPREPLY=( $( compgen -X control -W '$( command ls /dev/mapper )' \

View File

@ -1,5 +1,3 @@
have curl || return
_curl()
{
local cur prev words cword

View File

@ -1,7 +1,5 @@
# cvs(1) completion
have cvs || return
_cvs_entries()
{
local prefix=${cur%/*}/ IFS=$'\n'

View File

@ -1,7 +1,5 @@
# bash completion for cvsps
have cvsps || return
_cvsps()
{
local cur prev words cword
@ -44,7 +42,7 @@ _cvsps()
return 0
;;
--root)
declare -F _cvs_roots &>/dev/null && _cvs_roots
_xfunc cvs _cvs_roots
return 0
;;
esac
@ -52,7 +50,7 @@ _cvsps()
if [[ "$cur" == -* ]] ; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" -h )' -- "$cur" ) )
else
declare -F _cvs_roots &>/dev/null && _cvs_roots
_xfunc cvs _cvs_roots
fi
} &&
complete -F _cvsps cvsps

View File

@ -1,7 +1,5 @@
# bash completion for dd
have dd || return
_dd()
{
local cur prev words cword

View File

@ -1,7 +1,5 @@
# bash completion for dhclient
have dhclient || return
_dhclient()
{
local cur prev words cword

View File

@ -1,7 +1,5 @@
# dict(1) completion
have dict || have rdict || return
_dictdata()
{
dict $host $port $1 2>/dev/null | sed -ne \

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

@ -1,7 +1,5 @@
# dot(1) completion
have dot || return
_dot()
{
local cur prev words cword

View File

@ -1,6 +1,6 @@
# This function is required by _dpkg() and _dpkg-reconfigure()
have dpkg && {
have grep-status && {
_have grep-status && {
_comp_dpkg_installed_packages()
{
grep-status -P -e "^$1" -a -FStatus 'install ok installed' -n -s Package
@ -66,11 +66,9 @@ _dpkg()
[[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _dpkg dpkg dpkg-deb
}
# Debian GNU dpkg-reconfigure(8) completion
#
have dpkg-reconfigure &&
_dpkg_reconfigure()
{
local cur prev words cword
@ -101,113 +99,6 @@ _dpkg_reconfigure()
} &&
complete -F _dpkg_reconfigure -o default dpkg-reconfigure
# Debian dpkg-source completion
#
have dpkg-source &&
_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

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,7 +1,5 @@
# Debian Linux dselect(8) completion.
have dselect || return
_dselect()
{
local cur prev words cword

View File

@ -1,56 +1,5 @@
# dsniff util completion
# dsniff completion
have arpspoof &&
_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
have dnsspoof &&
_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
have dsniff &&
_dsniff()
{
local cur prev words cword
@ -74,157 +23,6 @@ _dsniff()
} &&
complete -F _dsniff dsniff
have filesnarf || have mailsnarf || have msgsnarf &&
_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
have macof &&
_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
have sshmitm &&
_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
have sshow &&
_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
have tcpkill &&
_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
have tcpnice &&
_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
have urlsnarf &&
_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
have webmitm &&
_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

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,176 +0,0 @@
# bash completion for e2fsprogs
have badblocks &&
_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
have dumpe2fs &&
_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
have e2freefrag &&
_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
have e2label &&
_e2label()
{
local cur prev words cword
_init_completion || return
if [ $cword -eq 1 ]; then
cur=${cur:=/dev/}
_filedir
fi
} &&
complete -F _e2label e2label
have filefrag &&
_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
have tune2fs &&
_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

View File

@ -1,5 +1,3 @@
have evince || return
_evince()
{
local cur prev words cword split

11
completions/explodepkg Normal file
View File

@ -0,0 +1,11 @@
# Slackware Linux explodepkg completion
complete -o plusdirs -f -X '!*.t[bglx]z' explodepkg
# 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,6 +1,4 @@
# bash completion for fbi(1) and fbgs(1)
have fbi || return
# bash completion for fbi(1)
_fbi()
{
@ -53,43 +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
have fbgs &&
_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

View File

@ -1,7 +1,5 @@
# bash completion for feh(1)
have feh || return
_feh()
{
local cur prev words cword split

View File

@ -1,5 +1,3 @@
have file || return
_file()
{
local cur prev words cword

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

@ -2,8 +2,6 @@
# globs and contains Linux specific code for completing the parameter
# to the -fstype option.
have find || return
_find()
{
local cur prev words cword

31
completions/find_member Normal file
View File

@ -0,0 +1,31 @@
# mailman find_member completion
_find_member()
{
local cur prev words cword split
_init_completion -s || return
case $prev in
-l|-x|--listname|--exclude)
_xfunc list_lists _mailman_lists
return 0
;;
esac
$split && return 0
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--listname --exclude --owners \
--help' -- "$cur" ) )
fi
} &&
complete -F _find_member find_member
# 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,26 +1,5 @@
# freeciv completions
# freeciv client completions
have civserver || have freeciv-server &&
_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
have civclient || have freeciv-gtk2 || have freeciv-sdl || have freeciv-xaw &&
_civclient()
{
local cur prev words cword

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

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