Merge branch 'master' into garik
This commit is contained in:
commit
c18a7e3f95
44
CHANGES
44
CHANGES
@ -1,18 +1,56 @@
|
||||
bash-completion (2.x)
|
||||
[ Guillaume Rousse ]
|
||||
* added pure-perl perldoc completion helper, using work from Aristotle
|
||||
Pagaltzis (pagaltzis@gmx.de)
|
||||
|
||||
[ David Paleino ]
|
||||
* Fixed "service" completion, thanks to John Hedges (Debian: #586210)
|
||||
|
||||
[ Ville Skyttä ]
|
||||
* Activate hping2 completion also for hping and hping3.
|
||||
* Add crontab and lrzip completions.
|
||||
* Add gif to mplayer filename completions (Alioth: #312512).
|
||||
* Add badblocks, compgen, crontab, dumpe2fs, e2freefrag, e2label, ether-wake,
|
||||
filefrag, iftop, lrzip, POSIX sh, sysbench, tune2fs, xmodmap, and xrdb
|
||||
completions.
|
||||
* Add *.gif (Alioth: #312512), *.3gpp, *.3gpp2, and *.awb to mplayer
|
||||
filename completions.
|
||||
* Add "short" tarball extensions to unxz, unlzma etc completions.
|
||||
* Improve /etc/init.d/* and sqlite3 completions.
|
||||
* Improve /etc/init.d/*, ipmitool, jar, mencoder, mplayer, povray, sqlite3,
|
||||
and general help parsing completions.
|
||||
* Fix p4 and povray completions (Alioth: #312625).
|
||||
* Add *.xsd, *.xsl, *.rng, and *.wsdl to xmllint filename completions.
|
||||
* Recognize rpm query mode based on the --file, --group, --package, and
|
||||
--all long options (RedHat: #630328).
|
||||
* Improve rpm query option completions.
|
||||
* Drop bad kompare filename completion (Alioth: #312708).
|
||||
* Make _filedir and _filedir_xspec complete uppercase versions of their
|
||||
filename extension arguments in addition to exact case matches.
|
||||
* IPv6 known hosts completion fixes (Alioth: #312695, RedHat: #630658).
|
||||
* Fixes to completions for filenames containing tabs (RedHat: #629518).
|
||||
|
||||
[ Freddy Vulto ]
|
||||
* Added _tilde(), fix ~username completion (Alioth: #312613, Debian: #587095)
|
||||
* Speed up `compopt' availability detection
|
||||
* Fix _filedir `-o filenames' detection on bash-3 (Alioth: #312646)
|
||||
* Fix __reassemble_comp_words_by_ref (Alioth #312740)
|
||||
|
||||
[ Anton Khirnov ]
|
||||
* Improve mplayer and mencoder completions.
|
||||
|
||||
[ Paul Walmsley ]
|
||||
* Add *.webm to mplayer file completions (Debian: #588079).
|
||||
|
||||
[ Miklos Vajna ]
|
||||
* Add *.amr to mplayer file completions (Alioth: #312634).
|
||||
|
||||
[ Andrej Gelenberg ]
|
||||
* Add *.part (partially downloaded) to mplayer and xine-based player
|
||||
completions (Alioth: #312657).
|
||||
|
||||
[ Stephen Gildea ]
|
||||
* Fix false posives for non-option words in _parse_help (Alioth: #312750).
|
||||
|
||||
[ Andrey G. Grozin ]
|
||||
* Add *.fb2 to okular filename completions.
|
||||
|
||||
-- David Paleino <d.paleino@gmail.com> Wed, 16 Jun 2010 17:53:22 +0200
|
||||
|
||||
|
174
Makefile.am
174
Makefile.am
@ -1,175 +1,7 @@
|
||||
SUBDIRS = test
|
||||
SUBDIRS = completions helpers test
|
||||
|
||||
sysconf_DATA = bash_completion
|
||||
|
||||
bashcompdir = $(sysconfdir)/bash_completion.d
|
||||
bashcomp_DATA = contrib/abook \
|
||||
contrib/ant \
|
||||
contrib/apache2ctl \
|
||||
contrib/apt \
|
||||
contrib/apt-build \
|
||||
contrib/aptitude \
|
||||
contrib/aspell \
|
||||
contrib/autorpm \
|
||||
contrib/bash-builtins \
|
||||
contrib/bind-utils \
|
||||
contrib/bitkeeper \
|
||||
contrib/bittorrent \
|
||||
contrib/bluez \
|
||||
contrib/brctl \
|
||||
contrib/bzip2 \
|
||||
contrib/cardctl \
|
||||
contrib/cfengine \
|
||||
contrib/chkconfig \
|
||||
contrib/chsh \
|
||||
contrib/cksfv \
|
||||
contrib/clisp \
|
||||
contrib/configure \
|
||||
contrib/coreutils \
|
||||
contrib/cowsay \
|
||||
contrib/cpan2dist \
|
||||
contrib/cpio \
|
||||
contrib/crontab \
|
||||
contrib/cups \
|
||||
contrib/cryptsetup \
|
||||
contrib/cvs \
|
||||
contrib/cvsps \
|
||||
contrib/dd \
|
||||
contrib/dhclient \
|
||||
contrib/dict \
|
||||
contrib/dpkg \
|
||||
contrib/dselect \
|
||||
contrib/dsniff \
|
||||
contrib/findutils \
|
||||
contrib/freeciv \
|
||||
contrib/fuse \
|
||||
contrib/gcc \
|
||||
contrib/gcl \
|
||||
contrib/gdb \
|
||||
contrib/genisoimage \
|
||||
contrib/getent \
|
||||
contrib/gkrellm \
|
||||
contrib/gnatmake \
|
||||
contrib/gpg \
|
||||
contrib/gpg2 \
|
||||
contrib/gzip \
|
||||
contrib/heimdal \
|
||||
contrib/hping2 \
|
||||
contrib/iconv \
|
||||
contrib/ifupdown \
|
||||
contrib/imagemagick \
|
||||
contrib/info \
|
||||
contrib/iptables \
|
||||
contrib/ipmitool \
|
||||
contrib/ipsec \
|
||||
contrib/ipv6calc \
|
||||
contrib/isql \
|
||||
contrib/jar \
|
||||
contrib/java \
|
||||
contrib/k3b \
|
||||
contrib/kldload \
|
||||
contrib/larch \
|
||||
contrib/ldapvi \
|
||||
contrib/lftp \
|
||||
contrib/lilo \
|
||||
contrib/links \
|
||||
contrib/lintian \
|
||||
contrib/lisp \
|
||||
contrib/lrzip \
|
||||
contrib/lvm \
|
||||
contrib/lzma \
|
||||
contrib/lzop \
|
||||
contrib/mailman \
|
||||
contrib/make \
|
||||
contrib/man \
|
||||
contrib/mc \
|
||||
contrib/mcrypt \
|
||||
contrib/mdadm \
|
||||
contrib/medusa \
|
||||
contrib/minicom \
|
||||
contrib/mkinitrd \
|
||||
contrib/module-init-tools \
|
||||
contrib/monodevelop \
|
||||
contrib/mount \
|
||||
contrib/mplayer \
|
||||
contrib/msynctool \
|
||||
contrib/mtx \
|
||||
contrib/munin-node \
|
||||
contrib/mutt \
|
||||
contrib/mysqladmin \
|
||||
contrib/ncftp \
|
||||
contrib/net-tools \
|
||||
contrib/nmap \
|
||||
contrib/ntpdate \
|
||||
contrib/openldap \
|
||||
contrib/openssl \
|
||||
contrib/p4 \
|
||||
contrib/perl \
|
||||
contrib/pine \
|
||||
contrib/pkg-config \
|
||||
contrib/pkg_install \
|
||||
contrib/pkgtools \
|
||||
contrib/pm-utils \
|
||||
contrib/portupgrade \
|
||||
contrib/postfix \
|
||||
contrib/postgresql \
|
||||
contrib/povray \
|
||||
contrib/procps \
|
||||
contrib/python \
|
||||
contrib/qdbus \
|
||||
contrib/qemu \
|
||||
contrib/quota-tools \
|
||||
contrib/rcs \
|
||||
contrib/rdesktop \
|
||||
contrib/reportbug \
|
||||
contrib/resolvconf \
|
||||
contrib/rfkill \
|
||||
contrib/ri \
|
||||
contrib/rpcdebug \
|
||||
contrib/rpm \
|
||||
contrib/rpmcheck \
|
||||
contrib/rrdtool \
|
||||
contrib/rsync \
|
||||
contrib/rtcwake \
|
||||
contrib/samba \
|
||||
contrib/sbcl \
|
||||
contrib/screen \
|
||||
contrib/service \
|
||||
contrib/shadow \
|
||||
contrib/sitecopy \
|
||||
contrib/smartctl \
|
||||
contrib/snownews \
|
||||
contrib/sqlite3 \
|
||||
contrib/ssh \
|
||||
contrib/sshfs \
|
||||
contrib/strace \
|
||||
contrib/svk \
|
||||
contrib/sysctl \
|
||||
contrib/sysv-rc \
|
||||
contrib/tar \
|
||||
contrib/tcpdump \
|
||||
contrib/unace \
|
||||
contrib/unrar \
|
||||
contrib/update-alternatives \
|
||||
contrib/util-linux \
|
||||
contrib/vncviewer \
|
||||
contrib/vpnc \
|
||||
contrib/wireless-tools \
|
||||
contrib/wodim \
|
||||
contrib/wol \
|
||||
contrib/wtf \
|
||||
contrib/wvdial \
|
||||
contrib/xhost \
|
||||
contrib/xm \
|
||||
contrib/xmllint \
|
||||
contrib/xmlwf \
|
||||
contrib/xmms \
|
||||
contrib/xrandr \
|
||||
contrib/xsltproc \
|
||||
contrib/xz \
|
||||
contrib/yp-tools \
|
||||
contrib/yum-arch
|
||||
|
||||
profiledir = $(sysconfdir)/profile.d
|
||||
profile_DATA = bash_completion.sh
|
||||
|
||||
@ -178,6 +10,4 @@ bash_completion.sh: bash_completion.sh.in Makefile
|
||||
|
||||
CLEANFILES = bash_completion.sh
|
||||
|
||||
EXTRA_DIST = CHANGES $(sysconf_DATA) $(bashcomp_DATA) bash_completion.sh.in \
|
||||
contrib/_mock contrib/_modules contrib/_subversion contrib/_yum \
|
||||
contrib/_yum-utils
|
||||
EXTRA_DIST = CHANGES $(sysconf_DATA) bash_completion.sh.in
|
||||
|
160
bash_completion
160
bash_completion
@ -70,7 +70,7 @@ complete -d pushd
|
||||
# START exclude -- do NOT remove this line
|
||||
# bzcmp, bzdiff, bz*grep, bzless, bzmore intentionally not here, see Debian: #455510
|
||||
complete -f -X '!*.?(t)bz?(2)' bunzip2 bzcat pbunzip2 pbzcat
|
||||
complete -f -X '!*.@(zip|ZIP|[ejw]ar|[EJW]AR|exe|EXE|pk3|wsz|zargo|xpi|sxw|o[tx]t|od[fgpst]|epub)' unzip zipinfo
|
||||
complete -f -X '!*.@(zip|[ejw]ar|exe|pk3|wsz|zargo|xpi|sxw|o[tx]t|od[fgpst]|epub)' unzip zipinfo
|
||||
complete -f -X '*.Z' compress znew
|
||||
# zcmp, zdiff, z*grep, zless, zmore intentionally not here, see Debian: #455510
|
||||
complete -f -X '!*.@(Z|[gGd]z|t[ag]z)' gunzip zcat unpigz
|
||||
@ -79,33 +79,32 @@ complete -f -X '!*.Z' uncompress
|
||||
complete -f -X '!*.@(tlz|lzma)' lzcat lzegrep lzfgrep lzgrep lzless lzmore unlzma
|
||||
complete -f -X '!*.@(?(t)xz|tlz|lzma)' unxz xzcat
|
||||
complete -f -X '!*.lrz' lrunzip
|
||||
complete -f -X '!*.@(gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|GIF|JP?(E)G|MIFF|TIF?(F)|PN[GM]|P[BGP]M|BMP|XPM|ICO|XWD|TGA|PCX)' ee
|
||||
complete -f -X '!*.@(gif|jp?(e)g|tif?(f)|png|p[bgp]m|bmp|x[bp]m|rle|rgb|pcx|fits|pm|GIF|JPG|JP?(E)G|TIF?(F)|PNG|P[BGP]M|BMP|X[BP]M|RLE|RGB|PCX|FITS|PM)' xv qiv
|
||||
complete -f -X '!*.@(gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx)' ee
|
||||
complete -f -X '!*.@(gif|jp?(e)g|tif?(f)|png|p[bgp]m|bmp|x[bp]m|rle|rgb|pcx|fits|pm)' xv qiv
|
||||
complete -f -X '!*.@(@(?(e)ps|?(E)PS|pdf|PDF)?(.gz|.GZ|.bz2|.BZ2|.Z))' gv ggv kghostview
|
||||
complete -f -X '!*.@(dvi|DVI)?(.@(gz|Z|bz2))' xdvi
|
||||
complete -f -X '!*.@(dvi|DVI)?(.@(gz|Z|bz2))' kdvi
|
||||
complete -f -X '!*.@(dvi|DVI)' dvips dviselect dvitype dvipdf advi dvipdfm dvipdfmx
|
||||
complete -f -X '!*.@(pdf|PDF)' acroread gpdf xpdf
|
||||
complete -f -X '!*.@(?(e)ps|?(E)PS|pdf|PDF)' kpdf
|
||||
complete -f -X '!*.@(@(?(e)ps|?(E)PS|pdf|PDF|dvi|DVI)?(.gz|.GZ|.bz2|.BZ2)|cb[rz]|CB[RZ]|djv?(u)|DJV?(U)|dvi|DVI|gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|GIF|JP?(E)G|MIFF|TIF?(F)|PN[GM]|P[BGP]M|BMP|XPM|ICO|XWD|TGA|PCX|fdf|FDF)' evince
|
||||
complete -f -X '!*.@(okular|@(?(e|x)ps|?(E|X)PS|pdf|PDF|dvi|DVI|cb[rz]|CB[RZ]|djv?(u)|DJV?(U)|dvi|DVI|gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|GIF|JP?(E)G|MIFF|TIF?(F)|PN[GM]|P[BGP]M|BMP|XPM|ICO|XWD|TGA|PCX|epub|EPUB|odt|ODT|fb|FB|mobi|MOBI|g3|G3|chm|CHM|fdf|FDF)?(.?(gz|GZ|bz2|BZ2)))' okular
|
||||
complete -f -X '!*.@(?(e)ps|?(E)PS|pdf|PDF)' ps2pdf ps2pdf12 ps2pdf13 ps2pdf14 ps2pdfwr
|
||||
complete -f -X '!*.@(dvi|DVI)?(.@(gz|Z|bz2))' xdvi kdvi
|
||||
complete -f -X '!*.dvi' dvips dviselect dvitype dvipdf advi dvipdfm dvipdfmx
|
||||
complete -f -X '!*.pdf' acroread gpdf xpdf
|
||||
complete -f -X '!*.@(?(e)ps|pdf)' kpdf
|
||||
complete -f -X '!*.@(@(?(e)ps|?(E)PS|pdf|PDF|dvi|DVI)?(.gz|.GZ|.bz2|.BZ2)|cb[rz]|djv?(u)|gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|fdf)' evince
|
||||
complete -f -X '!*.@(okular|@(?(e|x)ps|?(E|X)PS|pdf|PDF|dvi|DVI|cb[rz]|CB[RZ]|djv?(u)|DJV?(U)|dvi|DVI|gif|jp?(e)g|miff|tif?(f)|pn[gm]|p[bgp]m|bmp|xpm|ico|xwd|tga|pcx|GIF|JP?(E)G|MIFF|TIF?(F)|PN[GM]|P[BGP]M|BMP|XPM|ICO|XWD|TGA|PCX|epub|EPUB|odt|ODT|fb?(2)|FB?(2)|mobi|MOBI|g3|G3|chm|CHM|fdf|FDF)?(.?(gz|GZ|bz2|BZ2)))' okular
|
||||
complete -f -X '!*.@(?(e)ps|pdf)' ps2pdf ps2pdf12 ps2pdf13 ps2pdf14 ps2pdfwr
|
||||
complete -f -X '!*.texi*' makeinfo texi2html
|
||||
complete -f -X '!*.@(?(la)tex|?(LA)TEX|texi|TEXI|dtx|DTX|ins|INS|ltx|LTX)' tex latex slitex jadetex pdfjadetex pdftex pdflatex texi2dvi
|
||||
complete -f -X '!*.@(mp3|MP3)' mpg123 mpg321 madplay
|
||||
complete -f -X '!*@(.@(mp?(e)g|MP?(E)G|wma|avi|AVI|asf|vob|VOB|bin|dat|divx|DIVX|vcd|ps|pes|fli|flv|FLV|fxm|FXM|viv|rm|ram|yuv|mov|MOV|qt|QT|wmv|mp[234]|MP[234]|m4[pv]|M4[PV]|mkv|MKV|og[gmv]|OG[GMV]|t[ps]|T[PS]|wav|WAV|flac|FLAC|asx|ASX|mng|MNG|srt|m[eo]d|M[EO]D|s[3t]m|S[3T]M|it|IT|xm|XM)|+([0-9]).@(vdr|VDR))' xine aaxine fbxine kaffeine dragon
|
||||
complete -f -X '!*.@(?(la)tex|texi|dtx|ins|ltx)' tex latex slitex jadetex pdfjadetex pdftex pdflatex texi2dvi
|
||||
complete -f -X '!*.mp3' mpg123 mpg321 madplay
|
||||
complete -f -X '!*@(.@(mp?(e)g|MP?(E)G|wma|avi|AVI|asf|vob|VOB|bin|dat|divx|DIVX|vcd|ps|pes|fli|flv|FLV|fxm|FXM|viv|rm|ram|yuv|mov|MOV|qt|QT|wmv|mp[234]|MP[234]|m4[pv]|M4[PV]|mkv|MKV|og[gmv]|OG[GMV]|t[ps]|T[PS]|wav|WAV|flac|FLAC|asx|ASX|mng|MNG|srt|m[eo]d|M[EO]D|s[3t]m|S[3T]M|it|IT|xm|XM)|+([0-9]).@(vdr|VDR))?(.part)' xine aaxine fbxine kaffeine dragon
|
||||
complete -f -X '!*.@(avi|asf|wmv)' aviplay
|
||||
complete -f -X '!*.@(rm?(j)|ra?(m)|smi?(l))' realplay
|
||||
complete -f -X '!*.@(mpg|mpeg|avi|mov|qt)' xanim
|
||||
complete -f -X '!*.@(ogg|OGG|m3u|flac|spx)' ogg123
|
||||
complete -f -X '!*.@(mp3|MP3|ogg|OGG|pls|m3u)' gqmpeg freeamp
|
||||
complete -f -X '!*.@(ogg|m3u|flac|spx)' ogg123
|
||||
complete -f -X '!*.@(mp3|ogg|pls|m3u)' gqmpeg freeamp
|
||||
complete -f -X '!*.fig' xfig
|
||||
complete -f -X '!*.@(mid?(i)|MID?(I)|cmf|CMF)' playmidi
|
||||
complete -f -X '!*.@(mid?(i)|MID?(I)|rmi|RMI|rcp|RCP|[gr]36|[GR]36|g18|G18|mod|MOD|xm|XM|it|IT|x3m|X3M|s[3t]m|S[3T]M|kar|KAR)' timidity
|
||||
complete -f -X '!*.@(m[eo]d|M[EO]D|s[3t]m|S[3T]M|xm|XM|it|IT)' modplugplay modplug123
|
||||
complete -f -X '*.@(o|so|so.!(conf)|a|rpm|gif|GIF|jp?(e)g|JP?(E)G|mp3|MP3|mp?(e)g|MPG|avi|AVI|asf|ASF|ogg|OGG|class|CLASS)' vi vim gvim rvim view rview rgvim rgview gview emacs xemacs sxemacs kate kwrite
|
||||
complete -f -X '!*.@(mid?(i)|cmf)' playmidi
|
||||
complete -f -X '!*.@(mid?(i)|rmi|rcp|[gr]36|g18|mod|xm|it|x3m|s[3t]m|kar)' timidity
|
||||
complete -f -X '!*.@(m[eo]d|s[3t]m|xm|it)' modplugplay modplug123
|
||||
complete -f -X '*.@(o|so|so.!(conf)|a|[rs]pm|gif|jp?(e)g|mp3|mp?(e)g|avi|asf|ogg|class)' vi vim gvim rvim view rview rgvim rgview gview emacs xemacs sxemacs kate kwrite
|
||||
complete -f -X '!*.@([eE][xX][eE]?(.[sS][oO])|[cC][oO][mM]|[sS][cC][rR])' wine
|
||||
complete -f -X '!*.@(zip|ZIP|z|Z|gz|GZ|tgz|TGZ)' bzme
|
||||
complete -f -X '!*.@(zip|z|gz|tgz)' bzme
|
||||
# konqueror not here on purpose, it's more than a web/html browser
|
||||
complete -f -X '!*.@(?([xX]|[sS])[hH][tT][mM]?([lL]))' netscape mozilla lynx opera galeon dillo elinks amaya firefox mozilla-firefox iceweasel google-chrome chromium-browser epiphany
|
||||
complete -f -X '!*.@(sxw|stw|sxg|sgl|doc?([mx])|dot?([mx])|rtf|txt|htm|html|odt|ott|odm)' oowriter
|
||||
@ -114,14 +113,13 @@ complete -f -X '!*.@(sxc|stc|xls?([bmx])|xlw|xlt?([mx])|[ct]sv|ods|ots)' oocalc
|
||||
complete -f -X '!*.@(sxd|std|sda|sdd|odg|otg)' oodraw
|
||||
complete -f -X '!*.@(sxm|smf|mml|odf)' oomath
|
||||
complete -f -X '!*.odb' oobase
|
||||
complete -f -X '!*.rpm' rpm2cpio
|
||||
complete -f -X '!*.[rs]pm' rpm2cpio
|
||||
complete -f -X '!*.aux' bibtex
|
||||
complete -f -X '!*.po' poedit gtranslator kbabel lokalize
|
||||
complete -f -X '!*.@([Pp][Rr][Gg]|[Cc][Ll][Pp])' harbour gharbour hbpp
|
||||
complete -f -X '!*.[Hh][Rr][Bb]' hbrun
|
||||
complete -f -X '!*.ly' lilypond ly2dvi
|
||||
complete -f -X '!*.@(dif?(f)|?(d)patch)?(.@([gx]z|bz2|lzma))' cdiff
|
||||
complete -f -X '!*.@(dif?(f)|?(d)patch)' kompare
|
||||
complete -f -X '!*.lyx' lyx
|
||||
# FINISH exclude -- do not remove this line
|
||||
|
||||
@ -310,7 +308,7 @@ __reassemble_comp_words_by_ref() {
|
||||
ref="$2[$j]"
|
||||
eval $2[$j]=\${!ref}\${COMP_WORDS[i]}
|
||||
# Indicate new cword
|
||||
[[ $i == $COMP_CWORD && ${COMP_WORDS[i]} ]] && eval $3=$j
|
||||
[[ $i == $COMP_CWORD ]] && eval $3=$j
|
||||
done
|
||||
else
|
||||
# No, list of word completions separators hasn't changed;
|
||||
@ -612,11 +610,12 @@ _quote_readline_by_ref()
|
||||
# This function performs file and directory completion. It's better than
|
||||
# simply using 'compgen -f', because it honours spaces in filenames.
|
||||
# @param $1 If `-d', complete only on directories. Otherwise filter/pick only
|
||||
# completions with `.$1' as file extension.
|
||||
# completions with `.$1' and the uppercase version of it as file
|
||||
# extension.
|
||||
#
|
||||
_filedir()
|
||||
{
|
||||
local i IFS=$'\t\n' xspec
|
||||
local i IFS=$'\n' xspec
|
||||
|
||||
_tilde "$cur" || return 0
|
||||
|
||||
@ -638,47 +637,16 @@ _filedir()
|
||||
))
|
||||
|
||||
if [[ "$1" != -d ]]; then
|
||||
xspec=${1:+"!*.$1"}
|
||||
# Munge xspec to contain uppercase version too
|
||||
[[ ${BASH_VERSINFO[0]} -ge 4 ]] && \
|
||||
xspec=${1:+"!*.@($1|${1^^})"} || \
|
||||
xspec=${1:+"!*.@($1|$(printf %s $1 | tr '[:lower:]' '[:upper:]'))"}
|
||||
toks=( ${toks[@]-} $( compgen -f -X "$xspec" -- $quoted) )
|
||||
if [ ${#toks[@]} -ne 0 ]; then
|
||||
# If `compopt' is available, set `-o filenames'
|
||||
type compopt &>/dev/null && compopt -o filenames ||
|
||||
# No, `compopt' isn't available;
|
||||
# Is `-o filenames' set?
|
||||
[[ (
|
||||
${COMP_WORDS[0]} &&
|
||||
"$(complete -p ${COMP_WORDS[0]})" == *"-o filenames"*
|
||||
) ]] || {
|
||||
# No, `-o filenames' isn't set;
|
||||
# Emulate `-o filenames'
|
||||
# NOTE: A side-effect of emulating `-o filenames' is that
|
||||
# backslash escape characters are visible within the list
|
||||
# of presented completions, e.g. the completions look
|
||||
# like:
|
||||
#
|
||||
# $ foo a<TAB>
|
||||
# a\ b/ a\$b/
|
||||
#
|
||||
# whereas with `-o filenames' active the completions look
|
||||
# like:
|
||||
#
|
||||
# $ ls a<TAB>
|
||||
# a b/ a$b/
|
||||
#
|
||||
for ((i=0; i < ${#toks[@]}; i++)); do
|
||||
# If directory exists, append slash (/)
|
||||
if [[ ${cur:0:1} != "'" ]]; then
|
||||
[[ -d ${toks[i]} ]] && toks[i]="${toks[i]}"/
|
||||
if [[ ${cur:0:1} == '"' ]]; then
|
||||
toks[i]=${toks[i]//\\/\\\\}
|
||||
toks[i]=${toks[i]//\"/\\\"}
|
||||
toks[i]=${toks[i]//\$/\\\$}
|
||||
else
|
||||
toks[i]=$(printf %q ${toks[i]})
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
# Turn on -o filenames; see http://bugs.debian.org/272660#64 for
|
||||
# info about the compgen hack (bash < 4)
|
||||
compopt -o filenames 2>/dev/null || \
|
||||
compgen -f /non-existing-dir/ >/dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
@ -703,13 +671,13 @@ _split_longopt()
|
||||
return 1
|
||||
}
|
||||
|
||||
# This function tries to parse the output of $command --help
|
||||
# This function tries to parse the help output of the given command.
|
||||
# @param $1 command
|
||||
# @param $2 command options (default: --help)
|
||||
#
|
||||
_parse_help() {
|
||||
local cmd
|
||||
cmd=$1
|
||||
$cmd --help 2>&1 | command grep -- "^[[:space:]]*-" | tr "," " " | \
|
||||
awk '{print $1; if ($2 ~ /-.*/) { print $2 } }' | sed -e "s:=.*::g"
|
||||
$1 ${2:---help} 2>&1 | sed -e '/^[[:space:]]*-/!d' -e 's|[,/]| |g' | \
|
||||
awk '{ print $1; if ($2 ~ /^-/) { print $2 } }' | sed -e 's|=.*||'
|
||||
}
|
||||
|
||||
# This function completes on signal names
|
||||
@ -1276,16 +1244,16 @@ _known_hosts_real()
|
||||
awkcur=${awkcur//\./\\\.}
|
||||
curd=$awkcur
|
||||
|
||||
if [[ "$awkcur" == [0-9]*.* ]]; then
|
||||
# Digits followed by a dot - just search for that
|
||||
awkcur="^$awkcur.*"
|
||||
if [[ "$awkcur" == [0-9]*[.:]* ]]; then
|
||||
# Digits followed by a dot or a colon - just search for that
|
||||
awkcur="^$awkcur[.:]*"
|
||||
elif [[ "$awkcur" == [0-9]* ]]; then
|
||||
# Digits followed by no dot - search for digits followed
|
||||
# by a dot
|
||||
awkcur="^$awkcur.*\."
|
||||
# Digits followed by no dot or colon - search for digits followed
|
||||
# by a dot or a colon
|
||||
awkcur="^$awkcur.*[.:]"
|
||||
elif [ -z "$awkcur" ]; then
|
||||
# A blank - search for a dot or an alpha character
|
||||
awkcur="[a-z.]"
|
||||
# A blank - search for a dot, a colon, or an alpha character
|
||||
awkcur="[a-z.:]"
|
||||
else
|
||||
awkcur="^$awkcur"
|
||||
fi
|
||||
@ -1294,9 +1262,8 @@ _known_hosts_real()
|
||||
# FS needs to look for a comma separated list
|
||||
COMPREPLY=( "${COMPREPLY[@]}" $( awk 'BEGIN {FS=","}
|
||||
/^\s*[^|\#]/ {for (i=1; i<=2; ++i) { \
|
||||
gsub(" .*$", "", $i); \
|
||||
gsub("[\\[\\]]", "", $i); \
|
||||
gsub(":[0-9]+$", "", $i); \
|
||||
sub(" .*$", "", $i); \
|
||||
sub("^\\[", "", $i); sub("\\](:[0-9]+)?$", "", $i); \
|
||||
if ($i ~ /'"$awkcur"'/) {print $i} \
|
||||
}}' "${kh[@]}" 2>/dev/null ) )
|
||||
fi
|
||||
@ -1359,7 +1326,7 @@ complete -F _known_hosts traceroute traceroute6 tracepath tracepath6 ping \
|
||||
#
|
||||
_cd()
|
||||
{
|
||||
local cur IFS=$'\t\n' i j k
|
||||
local cur IFS=$'\n' i j k
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
# try to allow variable completion
|
||||
@ -1368,7 +1335,9 @@ _cd()
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Enable -o filenames option, see Debian bug #272660
|
||||
# Turn on -o filenames; see http://bugs.debian.org/272660#64 for
|
||||
# info about the compgen hack (bash < 4)
|
||||
compopt -o filenames 2>/dev/null || \
|
||||
compgen -f /non-existing-dir/ >/dev/null
|
||||
|
||||
# Use standard dir completion if no CDPATH or parameter starts with /,
|
||||
@ -1382,7 +1351,7 @@ _cd()
|
||||
local -r mark_symdirs=$(_rl_enabled mark-symlinked-directories && echo y)
|
||||
|
||||
# we have a CDPATH, so loop on its contents
|
||||
for i in ${CDPATH//:/$'\t'}; do
|
||||
for i in ${CDPATH//:/$'\n'}; do
|
||||
# create an array of matched subdirs
|
||||
k="${#COMPREPLY[@]}"
|
||||
for j in $( compgen -d $i/$cur ); do
|
||||
@ -1562,7 +1531,7 @@ _filedir_xspec()
|
||||
{
|
||||
local IFS cur xspec
|
||||
|
||||
IFS=$'\t\n'
|
||||
IFS=$'\n'
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
@ -1587,8 +1556,19 @@ _filedir_xspec()
|
||||
}
|
||||
))
|
||||
|
||||
# Munge xspec to contain uppercase version too
|
||||
eval xspec="${xspec}"
|
||||
local matchop=!
|
||||
if [[ $xspec == !* ]]; then
|
||||
xspec=${xspec#!}
|
||||
matchop=@
|
||||
fi
|
||||
[[ ${BASH_VERSINFO[0]} -ge 4 ]] && \
|
||||
xspec="$matchop($xspec|${xspec^^})" || \
|
||||
xspec="$matchop($xspec|$(printf %s $xspec | tr '[:lower:]' '[:upper:]'))"
|
||||
|
||||
toks=( ${toks[@]-} $(
|
||||
eval compgen -f -X "$xspec" -- "\$(quote_readline "\$cur")" | {
|
||||
eval compgen -f -X "!$xspec" -- "\$(quote_readline "\$cur")" | {
|
||||
while read -r tmp; do
|
||||
[ -n $tmp ] && printf '%s\n' $tmp
|
||||
done
|
||||
@ -1625,8 +1605,8 @@ 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
|
||||
i=$BASH_COMPLETION_COMPAT_DIR/$i
|
||||
[[ ${i##*/} != @(*~|*.bak|*.swp|\#*\#|*.dpkg*|*.rpm@(orig|new|save)) \
|
||||
&& ( -f $i || -h $i ) && -r $i ]] && . "$i"
|
||||
[[ ${i##*/} != @(*~|*.bak|*.swp|\#*\#|*.dpkg*|*.rpm@(orig|new|save)|Makefile*) \
|
||||
&& -f $i && -r $i ]] && . "$i"
|
||||
done
|
||||
fi
|
||||
if [[ $BASH_COMPLETION_DIR != $BASH_COMPLETION_COMPAT_DIR && \
|
||||
@ -1634,8 +1614,8 @@ if [[ $BASH_COMPLETION_DIR != $BASH_COMPLETION_COMPAT_DIR && \
|
||||
-x $BASH_COMPLETION_DIR ]]; then
|
||||
for i in $(LC_ALL=C command ls "$BASH_COMPLETION_DIR"); do
|
||||
i=$BASH_COMPLETION_DIR/$i
|
||||
[[ ${i##*/} != @(*~|*.bak|*.swp|\#*\#|*.dpkg*|*.rpm@(orig|new|save)) \
|
||||
&& ( -f $i || -h $i ) && -r $i ]] && . "$i"
|
||||
[[ ${i##*/} != @(*~|*.bak|*.swp|\#*\#|*.dpkg*|*.rpm@(orig|new|save)|Makefile*) \
|
||||
&& -f $i && -r $i ]] && . "$i"
|
||||
done
|
||||
fi
|
||||
unset i
|
||||
|
176
completions/Makefile.am
Normal file
176
completions/Makefile.am
Normal file
@ -0,0 +1,176 @@
|
||||
bashcomp_DATA = abook \
|
||||
ant \
|
||||
apache2ctl \
|
||||
apt \
|
||||
apt-build \
|
||||
aptitude \
|
||||
aspell \
|
||||
autorpm \
|
||||
bash-builtins \
|
||||
bind-utils \
|
||||
bitkeeper \
|
||||
bittorrent \
|
||||
bluez \
|
||||
brctl \
|
||||
bzip2 \
|
||||
cardctl \
|
||||
cfengine \
|
||||
chkconfig \
|
||||
chsh \
|
||||
cksfv \
|
||||
clisp \
|
||||
configure \
|
||||
coreutils \
|
||||
cowsay \
|
||||
cpan2dist \
|
||||
cpio \
|
||||
crontab \
|
||||
cups \
|
||||
cryptsetup \
|
||||
cvs \
|
||||
cvsps \
|
||||
dd \
|
||||
dhclient \
|
||||
dict \
|
||||
dpkg \
|
||||
dselect \
|
||||
dsniff \
|
||||
e2fsprogs \
|
||||
findutils \
|
||||
freeciv \
|
||||
freerdp \
|
||||
fuse \
|
||||
gcc \
|
||||
gcl \
|
||||
gdb \
|
||||
genisoimage \
|
||||
getent \
|
||||
gkrellm \
|
||||
gnatmake \
|
||||
gpg \
|
||||
gpg2 \
|
||||
gzip \
|
||||
heimdal \
|
||||
hping2 \
|
||||
iconv \
|
||||
iftop \
|
||||
ifupdown \
|
||||
imagemagick \
|
||||
info \
|
||||
iptables \
|
||||
ipmitool \
|
||||
ipsec \
|
||||
ipv6calc \
|
||||
isql \
|
||||
jar \
|
||||
java \
|
||||
k3b \
|
||||
kldload \
|
||||
larch \
|
||||
ldapvi \
|
||||
lftp \
|
||||
lilo \
|
||||
links \
|
||||
lintian \
|
||||
lisp \
|
||||
lrzip \
|
||||
lvm \
|
||||
lzma \
|
||||
lzop \
|
||||
mailman \
|
||||
make \
|
||||
man \
|
||||
mc \
|
||||
mcrypt \
|
||||
mdadm \
|
||||
medusa \
|
||||
minicom \
|
||||
mkinitrd \
|
||||
module-init-tools \
|
||||
monodevelop \
|
||||
mount \
|
||||
mplayer \
|
||||
msynctool \
|
||||
mtx \
|
||||
munin-node \
|
||||
mutt \
|
||||
mysqladmin \
|
||||
ncftp \
|
||||
net-tools \
|
||||
nmap \
|
||||
ntpdate \
|
||||
openldap \
|
||||
openssl \
|
||||
p4 \
|
||||
perl \
|
||||
pine \
|
||||
pkg-config \
|
||||
pkg_install \
|
||||
pkgtools \
|
||||
pm-utils \
|
||||
portupgrade \
|
||||
postfix \
|
||||
postgresql \
|
||||
povray \
|
||||
procps \
|
||||
python \
|
||||
qdbus \
|
||||
qemu \
|
||||
quota-tools \
|
||||
rcs \
|
||||
rdesktop \
|
||||
reportbug \
|
||||
resolvconf \
|
||||
rfkill \
|
||||
ri \
|
||||
rpcdebug \
|
||||
rpm \
|
||||
rpmcheck \
|
||||
rrdtool \
|
||||
rsync \
|
||||
rtcwake \
|
||||
samba \
|
||||
sbcl \
|
||||
screen \
|
||||
service \
|
||||
sh \
|
||||
shadow \
|
||||
sitecopy \
|
||||
smartctl \
|
||||
snownews \
|
||||
sqlite3 \
|
||||
ssh \
|
||||
sshfs \
|
||||
strace \
|
||||
svk \
|
||||
sysbench \
|
||||
sysctl \
|
||||
sysv-rc \
|
||||
tar \
|
||||
tcpdump \
|
||||
unace \
|
||||
unrar \
|
||||
update-alternatives \
|
||||
util-linux \
|
||||
vncviewer \
|
||||
vpnc \
|
||||
wireless-tools \
|
||||
wodim \
|
||||
wol \
|
||||
wtf \
|
||||
wvdial \
|
||||
xhost \
|
||||
xm \
|
||||
xmllint \
|
||||
xmlwf \
|
||||
xmms \
|
||||
xmodmap \
|
||||
xrandr \
|
||||
xrdb \
|
||||
xsltproc \
|
||||
xz \
|
||||
yp-tools \
|
||||
yum-arch
|
||||
|
||||
EXTRA_DIST = $(bashcomp_DATA) \
|
||||
_mock _modules _subversion _yum _yum-utils
|
@ -72,7 +72,7 @@ _mock()
|
||||
--sources --verbose --quiet --trace --enable-plugin \
|
||||
--disable-plugin --print-root-path' -- "$cur" ) )
|
||||
else
|
||||
_filedir '?(no)src.rpm'
|
||||
_filedir '@(?(no)src.r|s)pm'
|
||||
fi
|
||||
} &&
|
||||
complete -F _mock -o filenames mock
|
@ -85,10 +85,9 @@ _complete()
|
||||
;;
|
||||
|
||||
-A)
|
||||
COMPREPLY=( $( compgen -W 'alias arrayvar binding \
|
||||
builtin command directory disabled enabled \
|
||||
export file function group helptopic hostname \
|
||||
job keyword running service setopt shopt \
|
||||
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
|
||||
;;
|
||||
@ -111,13 +110,14 @@ _complete()
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
# relevant options completion
|
||||
COMPREPLY=( $( compgen -W '-a -b -c -d -e -f -g -j -k -o -s -v -u -A \
|
||||
-G -W -P -S -X -F -C' -- "$cur" ) )
|
||||
local opts="-a -b -c -d -e -f -g -j -k -o -s -u -v -A -G -W -P -S -X"
|
||||
[[ $1 != compgen ]] && opts="$opts -F -C"
|
||||
COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) )
|
||||
else
|
||||
COMPREPLY=( $( compgen -A command -- "$cur" ) )
|
||||
fi
|
||||
}
|
||||
complete -F _complete complete
|
||||
complete -F _complete compgen complete
|
||||
|
||||
# Local variables:
|
||||
# mode: shell-script
|
@ -21,7 +21,7 @@ _bzip2()
|
||||
return 0
|
||||
fi
|
||||
|
||||
local IFS=$'\t\n'
|
||||
local IFS=$'\n'
|
||||
|
||||
xspec="*.bz2"
|
||||
if [[ "$prev" == --* ]]; then
|
179
completions/e2fsprogs
Normal file
179
completions/e2fsprogs
Normal file
@ -0,0 +1,179 @@
|
||||
# bash completion for e2fsprogs
|
||||
|
||||
have badblocks &&
|
||||
_badblocks()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur prev
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-b|-c|-e|-d|-p|-t)
|
||||
return 0
|
||||
;;
|
||||
-i|-o)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
# -w (dangerous) and -X (internal use) not here on purpose
|
||||
COMPREPLY=( $( compgen -W '-b -c -e -d -f -i -n -o -p -s -t -v' \
|
||||
-- "$cur" ) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
cur=${cur:=/dev/}
|
||||
_filedir
|
||||
} &&
|
||||
complete -F _badblocks -o filenames badblocks
|
||||
|
||||
|
||||
have dumpe2fs &&
|
||||
_dumpe2fs()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur prev
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-o|-V)
|
||||
return 0
|
||||
;;
|
||||
-i)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-b -o -f -h -i -x -V' -- "$cur" ) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
cur=${cur:=/dev/}
|
||||
_filedir
|
||||
} &&
|
||||
complete -F _dumpe2fs -o filenames dumpe2fs
|
||||
|
||||
|
||||
have e2freefrag &&
|
||||
_e2freefrag()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur prev
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-c|-h)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-c -h' -- "$cur" ) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
cur=${cur:=/dev/}
|
||||
_filedir
|
||||
} &&
|
||||
complete -F _e2freefrag -o filenames e2freefrag
|
||||
|
||||
|
||||
have e2label &&
|
||||
_e2label()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur cword
|
||||
_get_comp_words_by_ref cur cword
|
||||
|
||||
if [ $cword -eq 1 ]; then
|
||||
cur=${cur:=/dev/}
|
||||
_filedir
|
||||
fi
|
||||
} &&
|
||||
complete -F _e2label -o filenames e2label
|
||||
|
||||
|
||||
have filefrag &&
|
||||
_filefrag()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-B -b -s -v -x' -- "$cur" ) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
_filedir
|
||||
} &&
|
||||
complete -F _filefrag -o filenames filefrag
|
||||
|
||||
|
||||
have tune2fs &&
|
||||
_tune2fs()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur prev
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
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 ^filetype ^flex_bg ^has_journal
|
||||
^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 '-c -C -e -E -f -g -i -j -J -l -L -m -M -o
|
||||
-O -r -T -u -U' -- "$cur" ) )
|
||||
fi
|
||||
|
||||
cur=${cur:=/dev/}
|
||||
_filedir
|
||||
} &&
|
||||
complete -F _tune2fs -o filenames 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
|
47
completions/freerdp
Normal file
47
completions/freerdp
Normal file
@ -0,0 +1,47 @@
|
||||
# bash completion for xfreerdp
|
||||
|
||||
have xfreerdp &&
|
||||
_xfreerdp()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-k)
|
||||
COMPREPLY=( $( compgen -W "$(xfreerdp --kbd-list | \
|
||||
awk '/^0x/ {print $1}')" -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-a)
|
||||
COMPREPLY=( $( compgen -W '8 15 16 24 32' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-x)
|
||||
COMPREPLY=( $( compgen -W 'b broadband m modem l lan' -- $cur ) )
|
||||
return 0
|
||||
;;
|
||||
--plugin)
|
||||
COMPREPLY=( $( compgen -W 'cliprdr rdpsnd rdpdr' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-u -d -s -c -p -n -t -g -a -z -f -x -O -o \
|
||||
-k --kbd-list -h --plugin --data' -- "$cur" ) )
|
||||
else
|
||||
_known_hosts_real "$cur"
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _xfreerdp xfreerdp
|
||||
|
||||
# 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,7 +21,7 @@ _gzip()
|
||||
return 0
|
||||
fi
|
||||
|
||||
local IFS=$'\t\n'
|
||||
local IFS=$'\n'
|
||||
|
||||
xspec="*.@(gz|t[ag]z)"
|
||||
if [[ "$prev" == --* ]]; then
|
35
completions/iftop
Normal file
35
completions/iftop
Normal file
@ -0,0 +1,35 @@
|
||||
# iftop(8) completion
|
||||
|
||||
have iftop &&
|
||||
_iftop()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur prev
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-h|-f|-F|-m)
|
||||
return 0
|
||||
;;
|
||||
-i)
|
||||
_available_interfaces -a
|
||||
return 0
|
||||
;;
|
||||
-c)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
COMPREPLY=( $( compgen -W '-h -n -N -p -P -b -B -i -f -F -c -m' \
|
||||
-- "$cur" ) )
|
||||
} &&
|
||||
complete -F _iftop -o filenames iftop
|
||||
|
||||
# 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
|
214
completions/ipmitool
Normal file
214
completions/ipmitool
Normal file
@ -0,0 +1,214 @@
|
||||
# bash completion for ipmitool
|
||||
|
||||
have ipmitool && {
|
||||
|
||||
_ipmitool_singleline_help()
|
||||
{
|
||||
COMPREPLY=( $( compgen -W "$( $1 $2 2>&1 | \
|
||||
sed -ne 's/[,\r]//g' -e 's/^.*[Cc]ommands://p' )" -- "$cur" ) )
|
||||
}
|
||||
|
||||
_ipmitool()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-h|-V|-p|-U|-e|-k|-y|-P|-m|-b|-t|-B|-T|-l)
|
||||
return 0
|
||||
;;
|
||||
-d)
|
||||
COMPREPLY=( $( compgen -W "$( \
|
||||
command ls -d /dev/ipmi* /dev/ipmi/* /dev/ipmidev/* \
|
||||
2>/dev/null | sed -ne 's/^[^0-9]*\([0-9]\{1,\}\)/\1/p' )" \
|
||||
-- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-I)
|
||||
COMPREPLY=( $( compgen -W "$( $1 -h 2>&1 | \
|
||||
sed -e '/^Interfaces:/,/^[[:space:]]*$/!d' \
|
||||
-ne 's/^[[:space:]]\{1,\}\([^[:space:]]\{1,\}\).*/\1/p' )" \
|
||||
-- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-H)
|
||||
_known_hosts_real "$cur"
|
||||
return 0
|
||||
;;
|
||||
-f|-S|-O)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-C)
|
||||
COMPREPLY=( $( compgen -W '0 1 2 3 4 5 6 7 8 9 10 11 12 13 14' \
|
||||
-- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-L)
|
||||
COMPREPLY=( $( compgen -W 'CALLBACK USER OPERATOR ADMINISTRATOR' \
|
||||
-- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-A)
|
||||
COMPREPLY=( $( compgen -W 'NONE PASSWORD MD2 MD5 OEM' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-o)
|
||||
COMPREPLY=( $( compgen -W "$( $1 -o list 2>&1 | \
|
||||
awk '/^[ \t]+/ { print $1 }' ) list" -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-h -V -v -c -d -I -H -p -U -f -S -a \
|
||||
-e -C -k -y -L -A -P -E -K -m -b -t -B -T -l -o -O' -- "$cur" ) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Find out command and subcommand
|
||||
|
||||
local cmds=( raw i2c spd lan chassis power event mc sdr sensor fru gendev
|
||||
sel pef sol tsol isol user channel session sunoem kontronoem picmg fwum
|
||||
firewall shell exec set hpm ekanalyzer)
|
||||
local i c cmd subcmd
|
||||
for (( i=1; i < ${#COMP_WORDS[@]}-1; i++ )); do
|
||||
[[ -n $cmd ]] && subcmd=${COMP_WORDS[i]} && break
|
||||
for c in ${cmds[@]}; do
|
||||
[ ${COMP_WORDS[i]} = $c ] && cmd=$c && break
|
||||
done
|
||||
done
|
||||
|
||||
if [ -z "$cmd" ]; then
|
||||
COMPREPLY=( $( compgen -W '${cmds[@]}' -- "$cur" ) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Command/subcommand completions
|
||||
|
||||
case $cmd in
|
||||
|
||||
shell)
|
||||
;;
|
||||
|
||||
exec)
|
||||
_filedir
|
||||
;;
|
||||
|
||||
chassis|power|kontronoem|fwum)
|
||||
_ipmitool_singleline_help $1 $cmd
|
||||
;;
|
||||
|
||||
lan)
|
||||
case $subcmd in
|
||||
print|set)
|
||||
;;
|
||||
alert)
|
||||
[ "$prev" = alert ] && \
|
||||
COMPREPLY=( $( compgen -W 'print set' -- "$cur" ) )
|
||||
;;
|
||||
stats)
|
||||
[ "$prev" = stats ] && \
|
||||
COMPREPLY=( $( compgen -W 'print set' -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=( $( compgen -W 'print set alert stats' \
|
||||
-- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
sdr)
|
||||
case $subcmd in
|
||||
get|info|type|list|entity)
|
||||
;;
|
||||
elist)
|
||||
COMPREPLY=( $( compgen -W 'all full compact event mclog fru
|
||||
generic' -- "$cur" ) )
|
||||
;;
|
||||
dump)
|
||||
_filedir
|
||||
;;
|
||||
fill)
|
||||
case $prev in
|
||||
fill)
|
||||
COMPREPLY=( $( compgen -W 'sensors file' \
|
||||
-- "$cur" ) )
|
||||
;;
|
||||
file)
|
||||
_filedir
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=( $( compgen -W 'get info type list elist entity
|
||||
dump fill' -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
sensor)
|
||||
case $subcmd in
|
||||
list|get|thresh)
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=( $( compgen -W 'list get thresh' -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
sel)
|
||||
case $subcmd in
|
||||
info|clear|list|elist|delete)
|
||||
;;
|
||||
add|save|writeraw|readraw)
|
||||
_filedir
|
||||
;;
|
||||
time)
|
||||
[ "$prev" = time ] && \
|
||||
COMPREPLY=( $( compgen -W 'get set' -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=( $( compgen -W 'info clear list elist delete add
|
||||
get save writeraw readraw time' -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
user)
|
||||
case $subcmd in
|
||||
summary|list|disable|enable|priv|test)
|
||||
;;
|
||||
set)
|
||||
[ "$prev" = set ] && \
|
||||
COMPREPLY=( $( compgen -W 'name password' -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=( $( compgen -W 'summary list set disable enable
|
||||
priv test' -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
set)
|
||||
[ "$prev" = set ] && \
|
||||
COMPREPLY=( $( compgen -W 'hostname username password privlvl
|
||||
authtype localaddr targetaddr port csv verbose' \
|
||||
-- "$cur" ) )
|
||||
;;
|
||||
|
||||
esac
|
||||
}
|
||||
|
||||
} &&
|
||||
complete -F _ipmitool -o filenames ipmitool
|
||||
|
||||
# Local variables:
|
||||
# mode: shell-script
|
||||
# sh-basic-offset: 4
|
||||
# sh-indent-comment: t
|
||||
# indent-tabs-mode: nil
|
||||
# End:
|
||||
# ex: ts=4 sw=4 et filetype=sh
|
@ -18,7 +18,7 @@ _jar()
|
||||
_filedir
|
||||
;;
|
||||
*f)
|
||||
_filedir '?([ejw]ar|zip|[EJW]AR|ZIP)'
|
||||
_filedir '@([ejw]ar|zip)'
|
||||
;;
|
||||
*)
|
||||
_filedir
|
@ -48,7 +48,7 @@ _lrzip()
|
||||
|
||||
_expand || return 0
|
||||
|
||||
local IFS=$'\t\n'
|
||||
local IFS=$'\n'
|
||||
COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \
|
||||
$( compgen -d -- "$cur" ) )
|
||||
} &&
|
@ -16,7 +16,7 @@ _lzma()
|
||||
return 0
|
||||
fi
|
||||
|
||||
local IFS=$'\t\n'
|
||||
local IFS=$'\n'
|
||||
|
||||
xspec="*.@(lzma|tlz)"
|
||||
if [[ "$prev" == --* ]]; then
|
@ -53,7 +53,7 @@ _lzop()
|
||||
|
||||
_expand || return 0
|
||||
|
||||
local IFS=$'\t\n'
|
||||
local IFS=$'\n'
|
||||
COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \
|
||||
$( compgen -d -- "$cur" ) )
|
||||
} &&
|
@ -58,12 +58,12 @@ _mcrypt()
|
||||
--list-hash --verbose --quiet --help \
|
||||
--version --license' -- "$cur" ) )
|
||||
elif [[ ${COMP_WORDS[0]} == mdecrypt ]]; then
|
||||
_filedir '@(nc)'
|
||||
_filedir nc
|
||||
else
|
||||
decrypt=0
|
||||
for (( i=1; i < ${#COMP_WORDS[@]}-1; i++ )); do
|
||||
if [[ ${COMP_WORDS[i]} == -@(d|-decrypt) ]]; then
|
||||
_filedir '@(nc)'
|
||||
_filedir nc
|
||||
decrypt=1
|
||||
break
|
||||
fi
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user