Abort completion file loading earlier if required commands are not available.

Cuts ~10% from bash completion load time on two different systems I
just tested.
This commit is contained in:
Ville Skyttä 2011-04-05 00:35:51 +03:00
parent a7c3da6322
commit 9af6f3504e
161 changed files with 315 additions and 215 deletions

View File

@ -7,6 +7,7 @@ bash-completion (2.x)
* Drop rpm query support for rpm < 4.1. * Drop rpm query support for rpm < 4.1.
* Split rpm and rpmbuild completions and improve them both. * Split rpm and rpmbuild completions and improve them both.
* Add $_backup_glob for matching various backup files. * Add $_backup_glob for matching various backup files.
* Load speedups.
[ Guillaume Rousse ] [ Guillaume Rousse ]
* added puppet completion, using work from Mathieu Parent (sathieudebian.org) * added puppet completion, using work from Mathieu Parent (sathieudebian.org)

View File

@ -3,7 +3,8 @@
# bash completion for mock # bash completion for mock
have mock && have mock || return
_mock() _mock()
{ {
local cur prev plugins cfgdir split=false local cur prev plugins cfgdir split=false

View File

@ -19,7 +19,7 @@
# Test for existence of /etc/profile.d/modules.sh too because we may end up # 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. # being sourced before it and thus before the `module' alias has been defined.
[ -f /etc/profile.d/modules.sh ] || have module && { [ -f /etc/profile.d/modules.sh ] || have module || return
_module_list () _module_list ()
{ {
@ -81,7 +81,6 @@ _module ()
return 0 return 0
} && } &&
complete -F _module -o default module complete -F _module -o default module
}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

View File

@ -3,8 +3,8 @@
# svn completion # svn completion
have svn && have svn || return
{
_svn() _svn()
{ {
local cur prev commands options command local cur prev commands options command
@ -349,7 +349,6 @@ _svnlook()
return 0 return 0
} && } &&
complete -F _svnlook -o default svnlook complete -F _svnlook -o default svnlook
}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

View File

@ -3,7 +3,8 @@
# yum(8) completion # yum(8) completion
have yum && { have yum || return
_yum_list() _yum_list()
{ {
if [[ "$1" == all ]] ; then if [[ "$1" == all ]] ; then
@ -144,7 +145,6 @@ _yum()
--skip-broken --color' -- $cur ) ) --skip-broken --color' -- $cur ) )
return 0 return 0
fi fi
}
} && } &&
complete -F _yum yum complete -F _yum yum

View File

@ -3,7 +3,8 @@
# bash completion for repomanage # bash completion for repomanage
have repomanage && have repomanage || return
_repomanage() _repomanage()
{ {
local cur prev local cur prev

View File

@ -1,6 +1,7 @@
# abook(1) completion # abook(1) completion
have abook && have abook || return
_abook() _abook()
{ {
local cur prev local cur prev

View File

@ -1,7 +1,7 @@
# bash completion for ant # bash completion for ant
have ant && have ant || return
{
_ant() _ant()
{ {
local cur prev buildfile i local cur prev buildfile i
@ -59,7 +59,6 @@ _ant()
} && } &&
have complete-ant-cmd.pl && \ have complete-ant-cmd.pl && \
complete -C complete-ant-cmd.pl -F _ant ant || complete -F _ant ant complete -C complete-ant-cmd.pl -F _ant ant || complete -F _ant ant
}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

View File

@ -1,6 +1,7 @@
# apache2ctl(1) completion # apache2ctl(1) completion
have apache2ctl && { have apache2ctl || return
_apache2ctl() _apache2ctl()
{ {
local APWORDS cur local APWORDS cur
@ -14,7 +15,6 @@ _apache2ctl()
COMPREPLY=( $( compgen -W "$APWORDS" -- "$cur" ) ) COMPREPLY=( $( compgen -W "$APWORDS" -- "$cur" ) )
} && } &&
complete -F _apache2ctl apache2ctl complete -F _apache2ctl apache2ctl
}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

View File

@ -1,6 +1,7 @@
# Debian apt-build(1) completion. # Debian apt-build(1) completion.
have apt-build && have apt-build || return
_apt_build() _apt_build()
{ {
local cur prev special i local cur prev special i

View File

@ -1,6 +1,7 @@
# Debian aptitude(1) completion # Debian aptitude(1) completion
have aptitude && { have aptitude || return
have grep-status && { have grep-status && {
_comp_dpkg_hold_packages() _comp_dpkg_hold_packages()
{ {
@ -87,7 +88,6 @@ _aptitude()
return 0 return 0
} && } &&
complete -F _aptitude -o default aptitude complete -F _aptitude -o default aptitude
}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

View File

@ -1,6 +1,7 @@
# bash completion for aspell # bash completion for aspell
have aspell && { have aspell || return
_aspell_dictionary() _aspell_dictionary()
{ {
local datadir local datadir
@ -90,7 +91,6 @@ _aspell()
fi fi
} && } &&
complete -F _aspell aspell complete -F _aspell aspell
}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

View File

@ -1,6 +1,7 @@
# autorpm(8) completion # autorpm(8) completion
have autorpm && have autorpm || return
_autorpm() _autorpm()
{ {
local cur local cur

View File

@ -1,6 +1,7 @@
# bash completion for nslookup # bash completion for nslookup
have nslookup && have nslookup || return
_nslookup() _nslookup()
{ {
local cur local cur

View File

@ -1,6 +1,7 @@
# BitKeeper completion adapted from code by Bart Trojanowski <bart@jukie.net> # BitKeeper completion adapted from code by Bart Trojanowski <bart@jukie.net>
have bk && have bk || return
_bk() _bk()
{ {
local BKCMDS local BKCMDS

View File

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

View File

@ -1,6 +1,7 @@
# bash completion for bluez utils # bash completion for bluez utils
have hcitool && { have hcitool || return
_bluetooth_adresses() _bluetooth_adresses()
{ {
if [ -n "${COMP_BLUETOOTH_SCAN:-}" ]; then if [ -n "${COMP_BLUETOOTH_SCAN:-}" ]; then
@ -419,7 +420,6 @@ _avctrl()
fi fi
} && } &&
complete -F _avctrl avctrl complete -F _avctrl avctrl
}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

View File

@ -1,6 +1,7 @@
# bash completion for brctl # bash completion for brctl
have brctl && have brctl || return
_brctl() _brctl()
{ {
local cur command local cur command

View File

@ -1,6 +1,7 @@
# bash completion for bzip2 # bash completion for bzip2
have bzip2 || have pbzip2 && have bzip2 || have pbzip2 || return
_bzip2() _bzip2()
{ {
local cur prev xspec helpopts local cur prev xspec helpopts

View File

@ -1,6 +1,7 @@
# Linux cardctl(8) completion # Linux cardctl(8) completion
have cardctl || have pccardctl && have cardctl || have pccardctl || return
_cardctl() _cardctl()
{ {
local cur local cur

View File

@ -1,6 +1,7 @@
# bash completion for cfengine # bash completion for cfengine
have cfagent && { have cfagent || return
_cfagent_options() _cfagent_options()
{ {
COMPREPLY=( $( compgen -W '--sysadm --force-net-copy --no-check-files \ COMPREPLY=( $( compgen -W '--sysadm --force-net-copy --no-check-files \
@ -77,7 +78,6 @@ _cfrun()
esac esac
} && } &&
complete -F _cfrun cfrun complete -F _cfrun cfrun
}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

View File

@ -1,6 +1,7 @@
# chkconfig(8) completion # chkconfig(8) completion
have chkconfig && have chkconfig || return
_chkconfig() _chkconfig()
{ {
local cur prev split=false local cur prev split=false

View File

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

View File

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

View File

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

View File

@ -1,5 +1,7 @@
# bash completion for configure # bash completion for configure
# No "have configure" here on purpose, it's rarely in any $PATH
_configure() _configure()
{ {
local cur prev split=false local cur prev split=false

View File

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

View File

@ -1,6 +1,7 @@
# bash completion for cpan2dist # bash completion for cpan2dist
have cpan2dist && have cpan2dist || return
_cpan2dist() _cpan2dist()
{ {
local cur prev packagelist cpandirs local cur prev packagelist cpandirs

View File

@ -1,6 +1,7 @@
# bash completion for cpio # bash completion for cpio
have cpio && { have cpio || return
_cpio_format() _cpio_format()
{ {
COMPREPLY=( $( compgen -W 'bin odc newc crc tar ustar hpbin hpodc' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'bin odc newc crc tar ustar hpbin hpodc' -- "$cur" ) )
@ -92,7 +93,6 @@ _cpio()
fi fi
} && } &&
complete -F _cpio cpio complete -F _cpio cpio
}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

View File

@ -1,6 +1,7 @@
# crontab(1) completion # crontab(1) completion
have crontab && have crontab || return
_crontab() _crontab()
{ {
local cur prev local cur prev

View File

@ -1,5 +1,7 @@
# bash completion for cryptsetup # bash completion for cryptsetup
have cryptsetup || return
_cryptsetup_name() _cryptsetup_name()
{ {
COMPREPLY=( $( compgen -X control -W '$( command ls /dev/mapper )' \ COMPREPLY=( $( compgen -X control -W '$( command ls /dev/mapper )' \
@ -12,7 +14,6 @@ _cryptsetup_device()
_filedir _filedir
} }
have cryptsetup &&
_cryptsetup() _cryptsetup()
{ {
local cur prev arg local cur prev arg

View File

@ -1,6 +1,7 @@
# bash completion for cups # bash completion for cups
have cancel && have cancel || return
_cancel() _cancel()
{ {
local cur local cur

View File

@ -1,6 +1,7 @@
# cvs(1) completion # cvs(1) completion
have cvs && { have cvs || return
set_prefix() set_prefix()
{ {
[ -z ${prefix:-} ] || prefix=${cur%/*}/ [ -z ${prefix:-} ] || prefix=${cur%/*}/
@ -381,7 +382,6 @@ _cvs()
return 0 return 0
} && } &&
complete -F _cvs -o default cvs complete -F _cvs -o default cvs
}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

View File

@ -1,6 +1,7 @@
# bash completion for cvsps # bash completion for cvsps
have cvsps && have cvsps || return
_cvsps() _cvsps()
{ {
COMPREPLY=() COMPREPLY=()

View File

@ -1,6 +1,7 @@
# bash completion for dd # bash completion for dd
have dd && have dd || return
_dd() _dd()
{ {
local cur local cur

View File

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

View File

@ -1,6 +1,7 @@
# dict(1) completion # dict(1) completion
have dict || have rdict && { have dict || have rdict || return
_dictdata() _dictdata()
{ {
dict $host $port $1 2>/dev/null | sed -ne \ dict $host $port $1 2>/dev/null | sed -ne \
@ -66,7 +67,6 @@ _dict()
COMPREPLY=( $( compgen -W '$( cat $dictfile )' -- "$cur" ) ) COMPREPLY=( $( compgen -W '$( cat $dictfile )' -- "$cur" ) )
} && } &&
complete -F _dict -o default dict rdict complete -F _dict -o default dict rdict
}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

View File

@ -1,6 +1,7 @@
# Debian Linux dselect(8) completion. # Debian Linux dselect(8) completion.
have dselect && have dselect || return
_dselect() _dselect()
{ {
local cur prev local cur prev

View File

@ -1,6 +1,7 @@
# dvd+rw-tools completions # dvd+rw-tools completions
have growisofs && have growisofs || return
_growisofs() _growisofs()
{ {
COMPREPLY=() COMPREPLY=()

View File

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

View File

@ -1,6 +1,7 @@
# bash completion for xfreerdp # bash completion for xfreerdp
have xfreerdp && have xfreerdp || return
_xfreerdp() _xfreerdp()
{ {
local cur prev local cur prev

View File

@ -1,6 +1,7 @@
# bash completion for fuse # bash completion for fuse
have fusermount && have fusermount || return
_fusermount() _fusermount()
{ {
COMPREPLY=() COMPREPLY=()

View File

@ -8,7 +8,8 @@
# ask the driver ("g++") for the name of the compiler ("cc1"), and parse the # ask the driver ("g++") for the name of the compiler ("cc1"), and parse the
# --help output of the compiler. # --help output of the compiler.
have gcc && have gcc || return
_gcc() _gcc()
{ {
local cur cc backend local cur cc backend

View File

@ -1,7 +1,8 @@
# bash programmable completion for various Common Lisp implementations by # bash programmable completion for various Common Lisp implementations by
# Nikodemus Siivola <nikodemus@random-state.net> # Nikodemus Siivola <nikodemus@random-state.net>
have gcl && have gcl || return
_gcl() _gcl()
{ {
local cur local cur

View File

@ -1,6 +1,7 @@
# bash completion for gdb # bash completion for gdb
have gdb && have gdb || return
_gdb() _gdb()
{ {
local cur prev local cur prev

View File

@ -1,6 +1,7 @@
# bash completion for mkisofs/genisoimage # bash completion for mkisofs/genisoimage
have mkisofs || have genisoimage && have mkisofs || have genisoimage || return
_mkisofs() _mkisofs()
{ {
local cur prev local cur prev

View File

@ -1,6 +1,7 @@
# bash completion for getent # bash completion for getent
have getent && have getent || return
_getent() _getent()
{ {
local cur prev local cur prev

View File

@ -1,6 +1,7 @@
# gkrellm(1) completion # gkrellm(1) completion
have gkrellm || have gkrellm2 && have gkrellm || have gkrellm2 || return
_gkrellm() _gkrellm()
{ {
local cur prev local cur prev

View File

@ -1,6 +1,7 @@
# Gnatmake completion by Ralf_Schroth@t-online.de (Ralf Schroth) # Gnatmake completion by Ralf_Schroth@t-online.de (Ralf Schroth)
have gnatmake && have gnatmake || return
_gnatmake() _gnatmake()
{ {
local cur local cur

View File

@ -1,6 +1,7 @@
# bash completion for gpg # bash completion for gpg
have gpg && have gpg || return
_gpg() _gpg()
{ {
local cur prev local cur prev

View File

@ -1,6 +1,7 @@
# gpg2(1) completion # gpg2(1) completion
have gpg2 && { have gpg2 || return
_gpg2() _gpg2()
{ {
local cur prev local cur prev
@ -41,7 +42,6 @@ _gpg2()
fi fi
} && } &&
complete -F _gpg2 -o default gpg2 complete -F _gpg2 -o default gpg2
}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

View File

@ -1,6 +1,7 @@
# bash completion for gzip # bash completion for gzip
have gzip || have pigz && have gzip || have pigz || return
_gzip() _gzip()
{ {
local cur prev xspec helpopts local cur prev xspec helpopts

View File

@ -1,6 +1,7 @@
# bash completion for heimdal # bash completion for heimdal
have ktutil && { have ktutil || return
_heimdal_principals() _heimdal_principals()
{ {
COMPREPLY=( $( compgen -W "$( kadmin -l dump 2>/dev/null | \ COMPREPLY=( $( compgen -W "$( kadmin -l dump 2>/dev/null | \
@ -119,7 +120,6 @@ _ktutil()
fi fi
} && } &&
complete -F _ktutil ktutil complete -F _ktutil ktutil
}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

View File

@ -1,6 +1,7 @@
# bash completion for hping2 # bash completion for hping2
have hping || have hping2 || have hping3 && have hping || have hping2 || have hping3 || return
_hping2() _hping2()
{ {
local cur prev local cur prev

View File

@ -1,6 +1,7 @@
# iconv(1) completion # iconv(1) completion
have iconv && have iconv || return
_iconv() _iconv()
{ {
local cur prev split=false local cur prev split=false

View File

@ -1,6 +1,7 @@
# iftop(8) completion # iftop(8) completion
have iftop && have iftop || return
_iftop() _iftop()
{ {
COMPREPLY=() COMPREPLY=()

View File

@ -1,6 +1,7 @@
# Red Hat & Debian GNU/Linux if{up,down} completion # Red Hat & Debian GNU/Linux if{up,down} completion
# #
[ $USERLAND = GNU ] && { have ifup || have ifdown; } && [ $USERLAND = GNU ] && have ifup || have ifdown || return
_ifupdown() _ifupdown()
{ {
local cur local cur

View File

@ -1,6 +1,7 @@
# bash completion for ImageMagick # bash completion for ImageMagick
have convert && { have convert || return
_ImageMagick() _ImageMagick()
{ {
local cur prev local cur prev
@ -521,7 +522,6 @@ _stream()
fi fi
} && } &&
complete -F _stream stream complete -F _stream stream
}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

View File

@ -1,6 +1,7 @@
# bash completion for info # bash completion for info
have info && have info || return
_info() _info()
{ {
local cur i infopath local cur i infopath

View File

@ -1,6 +1,6 @@
# bash completion for ipmitool # bash completion for ipmitool
have ipmitool && { have ipmitool || return
_ipmitool_singleline_help() _ipmitool_singleline_help()
{ {
@ -200,8 +200,6 @@ _ipmitool()
;; ;;
esac esac
}
} && } &&
complete -F _ipmitool ipmitool complete -F _ipmitool ipmitool

View File

@ -1,6 +1,7 @@
# iproute2 tools completion # iproute2 tools completion
have ip && have ip || return
_ip() _ip()
{ {
COMPREPLY=() COMPREPLY=()

View File

@ -1,6 +1,7 @@
# Linux ipsec(8) completion (for FreeS/WAN) # Linux ipsec(8) completion (for FreeS/WAN)
# #
[ $UNAME = Linux ] && have ipsec && [ $UNAME = Linux ] && have ipsec || return
_ipsec() _ipsec()
{ {
local cur local cur

View File

@ -1,6 +1,7 @@
# bash completion for iptables # bash completion for iptables
have iptables && have iptables || return
_iptables() _iptables()
{ {
local cur prev table chain local cur prev table chain

View File

@ -1,4 +1,5 @@
have ipv6calc && have ipv6calc || return
_ipv6calc() _ipv6calc()
{ {
local cur prev split=false local cur prev split=false

View File

@ -1,6 +1,7 @@
# isql completion by Victor Bogado da Silva Lins <victor@bogado.net> # isql completion by Victor Bogado da Silva Lins <victor@bogado.net>
have isql && have isql || return
_isql() _isql()
{ {
local cur local cur

View File

@ -1,6 +1,7 @@
# jar(1) completion # jar(1) completion
have jar && have jar || return
_jar() _jar()
{ {
local cur local cur

View File

@ -1,6 +1,7 @@
# bash completion for k3b # bash completion for k3b
have k3b && have k3b || return
_k3b() _k3b()
{ {
local cur prev local cur prev

View File

@ -1,7 +1,6 @@
# bash completion for FreeBSD kernel module commands # bash completion for FreeBSD kernel module commands
[ $UNAME = FreeBSD ] && [ $UNAME = FreeBSD ] || return
{
_kldload() _kldload()
{ {
@ -29,8 +28,6 @@ _kldunload()
} && } &&
complete -F _kldunload kldunload complete -F _kldunload kldunload
}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script
# sh-basic-offset: 4 # sh-basic-offset: 4

View File

@ -1,6 +1,7 @@
# larch(1) completion by Alex Shinn <foof@synthcode.com> # larch(1) completion by Alex Shinn <foof@synthcode.com>
have larch && have larch || return
_larch() _larch()
{ {
local cur prev local cur prev

View File

@ -1,6 +1,7 @@
# bash completion for ldapvi # bash completion for ldapvi
have ldapvi && have ldapvi || return
_ldapvi() _ldapvi()
{ {
local cur prev local cur prev

View File

@ -1,6 +1,7 @@
# bash completion for lilo(8) # bash completion for lilo(8)
have lilo && { have lilo || return
_lilo_labels() _lilo_labels()
{ {
COMPREPLY=( $( compgen -W "$( awk -F'=' '/label/ {print $2}' \ COMPREPLY=( $( compgen -W "$( awk -F'=' '/label/ {print $2}' \
@ -49,7 +50,6 @@ _lilo()
fi fi
} && } &&
complete -F _lilo lilo complete -F _lilo lilo
}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

View File

@ -1,6 +1,7 @@
# bash completion for links # bash completion for links
have links && have links || return
_links() _links()
{ {
local cur local cur

View File

@ -3,7 +3,8 @@
# #
# bash completion for lintian(1) and lintian-info(1) # bash completion for lintian(1) and lintian-info(1)
have lintian && { have lintian || return
_lintian_tags() _lintian_tags()
{ {
local match search tags local match search tags
@ -188,4 +189,3 @@ _lintian_info()
return 0 return 0
} && } &&
complete -F _lintian_info lintian-info complete -F _lintian_info lintian-info
}

View File

@ -1,7 +1,8 @@
# bash programmable completion for various Common Lisp implementations by # bash programmable completion for various Common Lisp implementations by
# Nikodemus Siivola <nikodemus@random-state.net> # Nikodemus Siivola <nikodemus@random-state.net>
have lisp && have lisp || return
_lisp() _lisp()
{ {
local cur local cur

View File

@ -1,6 +1,7 @@
# lrzip(1) completion # lrzip(1) completion
have lrzip && have lrzip || return
_lrzip() _lrzip()
{ {
COMPREPLY=() COMPREPLY=()

View File

@ -1,6 +1,7 @@
# lsof(8) completion # lsof(8) completion
have lsof && have lsof || return
_lsof() _lsof()
{ {
COMPREPLY=() COMPREPLY=()

View File

@ -1,6 +1,7 @@
# bash completion for lvm # bash completion for lvm
have lvm && { have lvm || return
_volumegroups() _volumegroups()
{ {
COMPREPLY=( $(compgen -W "$( vgscan 2>/dev/null | \ COMPREPLY=( $(compgen -W "$( vgscan 2>/dev/null | \
@ -1083,7 +1084,6 @@ _lvm()
fi fi
} && } &&
complete -F _lvm lvm complete -F _lvm lvm
}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

View File

@ -1,6 +1,7 @@
# lzma(1) completion by Per Øyvind Karlsen <peroyvind@mandriva.org> # lzma(1) completion by Per Øyvind Karlsen <peroyvind@mandriva.org>
have lzma && have lzma || return
_lzma() _lzma()
{ {
local cur prev xspec local cur prev xspec

View File

@ -1,6 +1,7 @@
# lzop(1) completion # lzop(1) completion
have lzop && have lzop || return
_lzop() _lzop()
{ {
local cur prev xspec local cur prev xspec

View File

@ -1,6 +1,7 @@
# bash completion for GNU make # bash completion for GNU make
have make || have gmake || have gnumake || have pmake && have make || have gmake || have gnumake || have pmake || return
_make() _make()
{ {
local file makef makef_dir="." makef_inc cur prev i split=false local file makef makef_dir="." makef_inc cur prev i split=false

View File

@ -1,6 +1,7 @@
# bash completion for mc # bash completion for mc
have mc && have mc || return
_mc() _mc()
{ {
local cur prev split=false local cur prev split=false

View File

@ -1,6 +1,7 @@
# mcrypt(1) completion by Ariel Fermani <the_end@bbs.frc.utn.edu.ar> # mcrypt(1) completion by Ariel Fermani <the_end@bbs.frc.utn.edu.ar>
have mcrypt || have mdecrypt && have mcrypt || have mdecrypt || return
_mcrypt() _mcrypt()
{ {
local cur prev i decrypt local cur prev i decrypt

View File

@ -1,7 +1,7 @@
# bash completion for mdadm # bash completion for mdadm
have mdadm && have mdadm || return
{
_mdadm_raid_level() _mdadm_raid_level()
{ {
local mode local mode
@ -151,7 +151,6 @@ _mdadm()
fi fi
} && } &&
complete -F _mdadm mdadm complete -F _mdadm mdadm
}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

View File

@ -1,6 +1,7 @@
# bash completion for medusa # bash completion for medusa
have medusa && have medusa || return
_medusa() _medusa()
{ {
local cur prev local cur prev

View File

@ -1,6 +1,7 @@
# bash completion for minicom # bash completion for minicom
have minicom && have minicom || return
_minicom() _minicom()
{ {
local cur prev confdir local cur prev confdir

View File

@ -1,6 +1,7 @@
# bash completion for mkinitrd # bash completion for mkinitrd
have mkinitrd && have mkinitrd || return
_mkinitrd() _mkinitrd()
{ {
local cur prev args split=false local cur prev args split=false

View File

@ -4,8 +4,7 @@
# query the server for a list of all available exports and complete on # query the server for a list of all available exports and complete on
# that instead. # that instead.
# #
have mount && have mount || return
{
# Just like COMPREPLY=(`compgen -W "${COMPREPLY[*]}" -- "$cur"`), only better! # Just like COMPREPLY=(`compgen -W "${COMPREPLY[*]}" -- "$cur"`), only better!
# #
@ -154,8 +153,6 @@ _umount()
} && } &&
complete -F _umount -o dirnames umount complete -F _umount -o dirnames umount
}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script
# sh-basic-offset: 4 # sh-basic-offset: 4

View File

@ -1,6 +1,7 @@
# mplayer(1) completion # mplayer(1) completion
have mplayer && { have mplayer || return
_mplayer_options_list() _mplayer_options_list()
{ {
cur=${cur%\\} cur=${cur%\\}
@ -258,7 +259,6 @@ _mplayer()
return 0 return 0
} && } &&
complete -F _mplayer mplayer mencoder gmplayer kplayer complete -F _mplayer mplayer mencoder gmplayer kplayer
}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

View File

@ -1,6 +1,7 @@
# bash completion for msynctool # bash completion for msynctool
have msynctool && have msynctool || return
_msynctool() _msynctool()
{ {
local cur prev anteprev local cur prev anteprev

View File

@ -1,6 +1,7 @@
# mtx completion by Jon Middleton <jjm@ixtab.org.uk> # mtx completion by Jon Middleton <jjm@ixtab.org.uk>
have mtx && have mtx || return
_mtx() _mtx()
{ {
local cur prev options tapes drives local cur prev options tapes drives

View File

@ -3,7 +3,7 @@
# Mutt doesn't have an "addressbook" like Pine, but it has aliases and # Mutt doesn't have an "addressbook" like Pine, but it has aliases and
# a "query" function to retrieve addresses, so that's what we use here. # a "query" function to retrieve addresses, so that's what we use here.
have mutt || have muttng && { have mutt || have muttng || return
# @param $1 (cur) Current word to complete # @param $1 (cur) Current word to complete
_muttaddr() _muttaddr()
@ -175,7 +175,6 @@ _mutt()
esac esac
} && } &&
complete -F _mutt -o default mutt muttng complete -F _mutt -o default mutt muttng
}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

View File

@ -1,6 +1,7 @@
# bash completion for mysqladmin # bash completion for mysqladmin
have mysqladmin && have mysqladmin || return
_mysqladmin() _mysqladmin()
{ {
local cur prev split=false local cur prev split=false

View File

@ -1,6 +1,7 @@
# bash completion for ncftp # bash completion for ncftp
have ncftp && have ncftp || return
_ncftp() _ncftp()
{ {
local cur local cur

View File

@ -1,6 +1,7 @@
# bash completion for nmap # bash completion for nmap
have nmap && have nmap || return
_nmap() _nmap()
{ {
local cur prev local cur prev

View File

@ -1,6 +1,7 @@
# bash completion for ntpdate # bash completion for ntpdate
have ntpdate && have ntpdate || return
_ntpdate() _ntpdate()
{ {
local cur prev local cur prev

View File

@ -1,6 +1,7 @@
# iscsiadm(1) completion # iscsiadm(1) completion
have iscsiadm && have iscsiadm || return
_iscsiadm() _iscsiadm()
{ {
local cur prev mode split=false local cur prev mode split=false

View File

@ -1,6 +1,7 @@
# bash completion for openldap # bash completion for openldap
have ldapsearch && { have ldapsearch || return
_ldap_uris() _ldap_uris()
{ {
COMPREPLY=( $( compgen -W 'ldap:// ldaps://' -- "$cur" ) ) COMPREPLY=( $( compgen -W 'ldap:// ldaps://' -- "$cur" ) )
@ -255,7 +256,6 @@ _ldappasswd()
fi fi
} && } &&
complete -F _ldappasswd ldappasswd complete -F _ldappasswd ldappasswd
}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

View File

@ -1,6 +1,7 @@
# bash completion for openssl # bash completion for openssl
have openssl && { have openssl || return
_openssl_sections() _openssl_sections()
{ {
local config f local config f
@ -243,7 +244,6 @@ _openssl()
fi fi
} && } &&
complete -F _openssl -o default openssl complete -F _openssl -o default openssl
}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

View File

@ -1,6 +1,7 @@
# Perforce completion by Frank Cusack <frank@google.com> # Perforce completion by Frank Cusack <frank@google.com>
have p4 && have p4 || return
_p4() _p4()
{ {
local cur prev words cword p4commands p4filetypes local cur prev words cword p4commands p4filetypes

View File

@ -1,7 +1,7 @@
# bash completion for perl # bash completion for perl
have perl && have perl || return
{
_perlmodules() _perlmodules()
{ {
COMPREPLY=( $( compgen -P "$prefix" -W \ COMPREPLY=( $( compgen -P "$prefix" -W \
@ -127,7 +127,6 @@ _perldoc()
fi fi
} && } &&
complete -F _perldoc -o bashdefault perldoc complete -F _perldoc -o bashdefault perldoc
}
# Local variables: # Local variables:
# mode: shell-script # mode: shell-script

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