bash_completion: delete from tree.
This was an old version of bash_completion and not included in the image. An haikuports recipe is available if you need it. Fixes #11660. Signed-off-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
parent
62ede2e6a2
commit
0de25abadc
|
@ -244,17 +244,6 @@ AddFilesToHaikuImage home config settings Tracker "Tracker New Templates"
|
|||
"<tracker-new-templates>text file"
|
||||
;
|
||||
|
||||
#local bashCompletionFiles = [ Glob $(etcDir)/bash_completion.d : * ] ;
|
||||
#local bashCompletionHelperFiles
|
||||
# = [ Glob $(etcDir)/bash_completion.d/helpers : * ] ;
|
||||
#bashCompletionFiles = $(bashCompletionFiles:G=bash-completion) ;
|
||||
#bashCompletionHelperFiles = $(bashCompletionHelperFiles:G=bash-completion-hlp) ;
|
||||
#AddDirectoryToHaikuImage system etc bash_completion.d ;
|
||||
#AddDirectoryToHaikuImage system etc bash_completion.d helpers ;
|
||||
#AddFilesToHaikuImage system etc bash_completion.d : $(bashCompletionFiles) ;
|
||||
#AddFilesToHaikuImage system etc bash_completion.d helpers
|
||||
# : $(bashCompletionHelperFiles) ;
|
||||
|
||||
# decorators
|
||||
#AddFilesToHaikuImage system non-packaged add-ons decorators
|
||||
# : BeDecorator MacDecorator WinDecorator ;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,62 +0,0 @@
|
|||
# abook(1) completion
|
||||
|
||||
have abook &&
|
||||
_abook()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
# abook only takes options, tabbing after command name adds a single
|
||||
# dash (bash4)
|
||||
[[ ${BASH_VERSINFO[0]} -ge 4 && $COMP_CWORD -eq 1 && -z "$cur" ]] &&
|
||||
{
|
||||
compopt -o nospace
|
||||
COMPREPLY=( "-" )
|
||||
return 0
|
||||
}
|
||||
|
||||
case $cur in
|
||||
-*)
|
||||
_longopt abook
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
case $prev in
|
||||
--informat)
|
||||
COMPREPLY=( $( compgen -W "$(abook --formats | \
|
||||
sed -n -e 's/^\t\([a-z]*\).*/\1/p' -e '/^$/q')" -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
--outformat)
|
||||
COMPREPLY=( $( compgen -W "$(abook --formats | \
|
||||
sed -n -e '/^$/,$s/^\t\([a-z]*\).*/\1/p')" -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
--infile)
|
||||
COMPREPLY=( $( compgen -W stdin -- "$cur" ) )
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
--outfile)
|
||||
COMPREPLY=( $( compgen -W stdout -- "$cur" ) )
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
--config|--datafile)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
} &&
|
||||
complete -F _abook abook
|
||||
|
||||
# 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
|
|
@ -1,70 +0,0 @@
|
|||
# bash completion for ant
|
||||
|
||||
have ant &&
|
||||
{
|
||||
_ant()
|
||||
{
|
||||
local cur prev buildfile i
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-buildfile|-file|-f)
|
||||
_filedir 'xml'
|
||||
return 0
|
||||
;;
|
||||
-logfile|-l)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-propertyfile)
|
||||
_filedir properties
|
||||
return 0
|
||||
;;
|
||||
-nice)
|
||||
COMPREPLY=( $( compgen -W '1 2 3 4 5 6 7 8 9 10' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-lib|-logger|-listener|-D|-inputhandler|-main)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-help -projecthelp -version -diagnostics \
|
||||
-quiet -verbose -debug -emacs -lib -logfile -logger -listener \
|
||||
-noinput -buildfile -D -keep-going -propertyfile -inputhandler \
|
||||
-find -s -nice -nouserlib -noclasspath -autoproxy -main' \
|
||||
-- "$cur" ) )
|
||||
else
|
||||
# available targets completion
|
||||
# find which buildfile to use
|
||||
buildfile=build.xml
|
||||
for (( i=1; i < COMP_CWORD; i++ )); do
|
||||
if [[ "${COMP_WORDS[i]}" == -@(?(build)file|f) ]]; then
|
||||
buildfile=${COMP_WORDS[i+1]}
|
||||
break
|
||||
fi
|
||||
done
|
||||
[ ! -f $buildfile ] && return 0
|
||||
|
||||
# parse buildfile for targets
|
||||
# some versions of sed complain if there's no trailing linefeed,
|
||||
# hence the 2>/dev/null
|
||||
COMPREPLY=( $( compgen -W "$( cat $buildfile | tr "'\t\n>" "\" \n" | \
|
||||
sed -ne 's/.*<target .*name="\([^"]*\).*/\1/p' 2>/dev/null )" \
|
||||
-- "$cur" ) )
|
||||
fi
|
||||
}
|
||||
have complete-ant-cmd.pl && \
|
||||
complete -C complete-ant-cmd.pl -F _ant ant || complete -F _ant ant
|
||||
}
|
||||
|
||||
# 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
|
|
@ -1,24 +0,0 @@
|
|||
# apache2ctl(1) completion
|
||||
|
||||
have apache2ctl && {
|
||||
_apache2ctl() {
|
||||
local APWORDS cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
APWORDS=$(apache2ctl 2>&1 >/dev/null | awk 'NR<2 { print $3; exit }' | \
|
||||
tr "|" " ")
|
||||
|
||||
COMPREPLY=( $( compgen -W "$APWORDS" -- "$cur" ) )
|
||||
}
|
||||
complete -F _apache2ctl apache2ctl
|
||||
}
|
||||
|
||||
# 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
|
|
@ -1,157 +0,0 @@
|
|||
# Debian apt-get(8) completion.
|
||||
|
||||
have apt-get &&
|
||||
_apt_get()
|
||||
{
|
||||
local cur prev special i
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
|
||||
if [[ ${COMP_WORDS[i]} == @(install|remove|autoremove|purge|source|build-dep) ]]; then
|
||||
special=${COMP_WORDS[i]}
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$special" ]; then
|
||||
case $special in
|
||||
remove|autoremove|purge)
|
||||
if [ -f /etc/debian_version ]; then
|
||||
# Debian system
|
||||
COMPREPLY=( $( _comp_dpkg_installed_packages $cur ) )
|
||||
else
|
||||
# assume RPM based
|
||||
_rpm_installed_packages
|
||||
fi
|
||||
return 0
|
||||
;;
|
||||
source)
|
||||
COMPREPLY=( $( apt-cache --no-generate pkgnames "$cur" \
|
||||
2> /dev/null ) $( 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|--config-file)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-t|--target-release|--default-release)
|
||||
COMPREPLY=( $( apt-cache policy | \
|
||||
command grep "release.o=Debian,a=$cur" | \
|
||||
sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2> /dev/null) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-d -f -h -v -m -q -s -y -u -t -b -c -o \
|
||||
--download-only --fix-broken --help --version --ignore-missing \
|
||||
--fix-missing --no-download --quiet --simulate --just-print \
|
||||
--dry-run --recon --no-act --yes --assume-yes --show-upgraded \
|
||||
--only-source --compile --build --ignore-hold --target-release \
|
||||
--no-upgrade --force-yes --print-uris --purge --reinstall \
|
||||
--list-cleanup --default-release --trivial-only --no-remove \
|
||||
--diff-only --no-install-recommends --tar-only --config-file \
|
||||
--option --auto-remove' -- "$cur" ) )
|
||||
else
|
||||
COMPREPLY=( $( compgen -W 'update upgrade dselect-upgrade \
|
||||
dist-upgrade install remove purge source build-dep \
|
||||
check clean autoclean autoremove' -- "$cur" ) )
|
||||
fi
|
||||
|
||||
return 0
|
||||
} &&
|
||||
complete -F _apt_get apt-get
|
||||
|
||||
# Debian apt-cache(8) completion.
|
||||
#
|
||||
have apt-cache &&
|
||||
_apt_cache()
|
||||
{
|
||||
local cur prev special i
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
if [ "$cur" != show ]; then
|
||||
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
|
||||
if [[ ${COMP_WORDS[i]} == @(add|depends|dotty|madison|policy|rdepends|show?(pkg|src|)) ]]; then
|
||||
special=${COMP_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
|
|
@ -1,66 +0,0 @@
|
|||
# Debian apt-build(1) completion.
|
||||
|
||||
have apt-build &&
|
||||
_apt_build()
|
||||
{
|
||||
local cur prev special i
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
|
||||
if [[ ${COMP_WORDS[i]} == @(install|remove|source|info|clean) ]]; then
|
||||
special=${COMP_WORDS[i]}
|
||||
fi
|
||||
done
|
||||
|
||||
if [ -n "$special" ]; then
|
||||
case $special in
|
||||
install|source|info)
|
||||
COMPREPLY=( $( apt-cache pkgnames "$cur" 2> /dev/null ) )
|
||||
return 0
|
||||
;;
|
||||
remove)
|
||||
COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
case $prev in
|
||||
--patch|--build-dir|--repository-dir)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-h|--help)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--help --show-upgraded -u --build-dir \
|
||||
--repository-dir --build-only --build-command --reinstall \
|
||||
--rebuild --remove-builddep --no-wrapper --purge --patch \
|
||||
--patch-strip -p --yes -y --version -v --no-source' -- "$cur" ) )
|
||||
|
||||
else
|
||||
COMPREPLY=( $( compgen -W 'update upgrade install remove source \
|
||||
dist-upgrade world clean info clean-build update-repository' \
|
||||
-- "$cur" ) )
|
||||
fi
|
||||
|
||||
|
||||
return 0
|
||||
} &&
|
||||
complete -F _apt_build apt-build
|
||||
|
||||
# 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
|
|
@ -1,98 +0,0 @@
|
|||
# Debian aptitude(1) completion
|
||||
|
||||
have aptitude && {
|
||||
have grep-status && {
|
||||
_comp_dpkg_hold_packages()
|
||||
{
|
||||
grep-status -P -e "^$1" -a -FStatus 'hold' -n -s Package
|
||||
}
|
||||
} || {
|
||||
_comp_dpkg_hold_packages()
|
||||
{
|
||||
command grep -B 2 'hold' /var/lib/dpkg/status | \
|
||||
command grep "Package: $1" | cut -d\ -f2
|
||||
}
|
||||
}
|
||||
|
||||
_aptitude()
|
||||
{
|
||||
local cur dashoptions prev special i
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
dashoptions='-S -u -i -h --help --version -s --simulate -d \
|
||||
--download-only -P --prompt -y --assume-yes -F \
|
||||
--display-format -O --sort -w --width -f -r -g \
|
||||
--with-recommends -R -G --without-recommends -t \
|
||||
--target-release -V --show-versions -D --show-deps\
|
||||
-Z -v --verbose --purge-unused --schedule-only'
|
||||
|
||||
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
|
||||
if [[ ${COMP_WORDS[i]} == @(@(|re)install|@(|un)hold|@(|un)markauto|@(dist|full)-upgrade|download|show|forbid-version|purge|remove|changelog|why@(|-not)|keep@(|-all)|build-dep|@(add|remove)-user-tag) ]]; then
|
||||
special=${COMP_WORDS[i]}
|
||||
fi
|
||||
#exclude some mutually exclusive options
|
||||
[[ ${COMP_WORDS[i]} == '-u' ]] && dashoptions=${dashoptions/-i}
|
||||
[[ ${COMP_WORDS[i]} == '-i' ]] && dashoptions=${dashoptions/-u}
|
||||
done
|
||||
|
||||
if [[ -n "$special" ]]; then
|
||||
case $special in
|
||||
install|hold|markauto|unmarkauto|dist-upgrade|full-upgrade| \
|
||||
download|show|changelog|why|why-not|build-dep|add-user-tag| \
|
||||
remove-user-tag)
|
||||
COMPREPLY=( $( apt-cache pkgnames $cur 2> /dev/null ) )
|
||||
return 0
|
||||
;;
|
||||
purge|remove|reinstall|forbid-version)
|
||||
COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
unhold)
|
||||
COMPREPLY=( $( _comp_dpkg_hold_packages "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
case $prev in
|
||||
# don't complete anything if these options are found
|
||||
autoclean|clean|forget-new|search|safe-upgrade|upgrade|update|keep-all)
|
||||
return 0
|
||||
;;
|
||||
-S)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-t|--target-release|--default-release)
|
||||
COMPREPLY=( $( apt-cache policy | \
|
||||
command grep "release.o=Debian,a=$cur" | \
|
||||
sed -e "s/.*a=\(\w*\).*/\1/" | uniq 2> /dev/null ) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W "$dashoptions" -- "$cur" ) )
|
||||
else
|
||||
COMPREPLY=( $( compgen -W 'update upgrade safe-upgrade forget-new \
|
||||
clean autoclean install reinstall remove \
|
||||
hold unhold purge markauto unmarkauto why why-not \
|
||||
dist-upgrade full-upgrade download search show \
|
||||
forbid-version changelog keep-all build-dep \
|
||||
add-user-tag remove-user-tag' -- "$cur" ) )
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
complete -F _aptitude -o default aptitude
|
||||
}
|
||||
|
||||
# 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
|
|
@ -1,96 +0,0 @@
|
|||
# bash completion for aspell
|
||||
|
||||
have aspell && {
|
||||
_aspell_dictionary()
|
||||
{
|
||||
local datadir
|
||||
datadir=$( aspell config data-dir 2>/dev/null || echo /usr/lib/aspell )
|
||||
# First, get aliases (dicts dump does not list them)
|
||||
COMPREPLY=( $( command ls $datadir/*.alias 2>/dev/null ) )
|
||||
COMPREPLY=( ${COMPREPLY[@]%.alias} )
|
||||
COMPREPLY=( ${COMPREPLY[@]#$datadir/} )
|
||||
# Then, add the canonical dicts
|
||||
COMPREPLY=( "${COMPREPLY[@]}" $( aspell dicts 2>/dev/null ) )
|
||||
COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) )
|
||||
}
|
||||
|
||||
_aspell()
|
||||
{
|
||||
local cur prev split=false
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
case $prev in
|
||||
-c|-p|check|--conf|--personal|--repl|--per-conf)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
--conf-dir|--data-dir|--dict-dir|--home-dir|--local-data-dir|--prefix)
|
||||
_filedir -d
|
||||
return 0
|
||||
;;
|
||||
dump|create|merge)
|
||||
COMPREPLY=( $( compgen -W 'master personal repl' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
--mode)
|
||||
COMPREPLY=( $( compgen -W 'none url email sgml tex' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
--sug-mode)
|
||||
COMPREPLY=( $( compgen -W 'ultra fast normal bad-speller' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
--keymapping)
|
||||
COMPREPLY=( $( compgen -W 'aspell ispell' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-d|--master)
|
||||
_aspell_dictionary
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
$split && return 0
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--conf --conf-dir --data-dir --dict-dir \
|
||||
--encoding --add-filter --rem-filter --mode \
|
||||
--add-extra-dicts --rem-extra-dicts \
|
||||
--home-dir --ignore --ignore-accents \
|
||||
--dont-ignore-accents --ignore-case --dont-ignore-case \
|
||||
--ignore-repl --dont-ignore-repl --jargon --keyboard \
|
||||
--lang --language-tag --local-data-dir --master \
|
||||
--module --add-module-search-order \
|
||||
--rem-module-search-order --per-conf --personal \
|
||||
--prefix --repl --run-together --dont-run-together \
|
||||
--run-together-limit --run-together-min --save-repl \
|
||||
--dont-save-repl --set-prefix --dont-set-prefix --size \
|
||||
--spelling --strip-accents --dont-strip-accents \
|
||||
--sug-mode --add-word-list-path --rem-word-list-path \
|
||||
--backup --dont-backup --reverse --dont-reverse \
|
||||
--time --dont-time --keymapping --add-email-quote \
|
||||
--rem-email-quote --email-margin --add-tex-command \
|
||||
--rem-tex-command --tex-check-comments \
|
||||
--dont-tex-check-comments --add-tex-extension \
|
||||
--rem-tex-extension --add-sgml-check --rem-sgml-check \
|
||||
--add-sgml-extension --rem-sgml-extension' -- "$cur" ) )
|
||||
else
|
||||
COMPREPLY=( $( compgen -W 'usage help check pipe list \
|
||||
config soundslike filter version dump create merge' -- "$cur" ) )
|
||||
fi
|
||||
|
||||
}
|
||||
complete -F _aspell aspell
|
||||
}
|
||||
|
||||
# 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
|
|
@ -1,124 +0,0 @@
|
|||
# Completions for autoconf tools
|
||||
|
||||
have autoconf &&
|
||||
_autoconf()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur prev split=false
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
case "$prev" in
|
||||
--help|-h|--version|-V|--trace|-t)
|
||||
return 0
|
||||
;;
|
||||
--output|-o)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
--warnings|-W)
|
||||
local cats=( cross obsolete syntax )
|
||||
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
|
||||
_longopt $1
|
||||
return
|
||||
fi
|
||||
|
||||
_filedir '@(ac|in)'
|
||||
} &&
|
||||
complete -F _autoconf autoconf
|
||||
|
||||
have autoreconf || have autoheader &&
|
||||
_autoreconf()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur prev split=false
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
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
|
||||
_longopt $1
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ $1 == autoheader ]] ; then
|
||||
_filedir '@(ac|in)'
|
||||
else
|
||||
_filedir -d
|
||||
fi
|
||||
} &&
|
||||
complete -F _autoreconf autoreconf autoheader
|
||||
|
||||
have autoscan || have autoupdate &&
|
||||
_autoscan()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur prev split=false
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
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
|
||||
_longopt $1
|
||||
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
|
|
@ -1,80 +0,0 @@
|
|||
# Completions for automake tools
|
||||
|
||||
have automake &&
|
||||
_automake()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur prev split=false
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
case "$prev" in
|
||||
--help|--version)
|
||||
return 0
|
||||
;;
|
||||
--warnings|-W)
|
||||
local cats=( gnu obsolete override portability syntax unsupported )
|
||||
COMPREPLY=( $( compgen -W \
|
||||
'${cats[@]} ${cats[@]/#/no-} all none error' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
--libdir)
|
||||
_filedir -d
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
$split && return 0
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
_longopt $1
|
||||
return
|
||||
fi
|
||||
|
||||
_filedir
|
||||
} &&
|
||||
complete -F _automake automake automake-1.11
|
||||
|
||||
have aclocal &&
|
||||
_aclocal()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur prev split=false
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
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
|
||||
|
||||
_longopt $1
|
||||
} &&
|
||||
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
|
|
@ -1,23 +0,0 @@
|
|||
# autorpm(8) completion
|
||||
|
||||
have autorpm &&
|
||||
_autorpm()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
COMPREPLY=( $( compgen -W '--notty --debug --help --version auto add \
|
||||
fullinfo info help install list remove set' -- "$cur" ) )
|
||||
|
||||
} &&
|
||||
complete -F _autorpm autorpm
|
||||
|
||||
# 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
|
|
@ -1,128 +0,0 @@
|
|||
# bash alias completion
|
||||
#
|
||||
_alias()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
case $COMP_LINE 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
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
case $COMP_LINE 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
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
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 [ $COMP_CWORD -eq 1 ]; then
|
||||
COMPREPLY=( $( compgen -A function -- "$cur" ) )
|
||||
else
|
||||
COMPREPLY=( "() $( type -- ${COMP_WORDS[1]} | sed -e 1,2d )" )
|
||||
fi
|
||||
}
|
||||
complete -F _function function declare typeset
|
||||
|
||||
# bash complete completion
|
||||
#
|
||||
_complete()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
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="$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
|
|
@ -1,23 +0,0 @@
|
|||
# bash completion for nslookup
|
||||
|
||||
have nslookup &&
|
||||
_nslookup()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
COMPREPLY=( $( compgen -P '-' -W 'all class= debug d2 domain= srchlist= \
|
||||
defname search port= querytype= type= recurse retry root timeout vc \
|
||||
ignoretc' -- "$cur" ) )
|
||||
} &&
|
||||
complete -F _nslookup nslookup
|
||||
|
||||
# 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
|
|
@ -1,26 +0,0 @@
|
|||
# BitKeeper completion adapted from code by Bart Trojanowski <bart@jukie.net>
|
||||
|
||||
have bk &&
|
||||
_bk() {
|
||||
local BKCMDS
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
BKCMDS="$( bk help topics | awk '/^ bk/ { print $4 }' | \
|
||||
xargs printf '%s ' )"
|
||||
|
||||
COMPREPLY=( $( compgen -W "$BKCMDS" -- "$cur" ) )
|
||||
_filedir
|
||||
|
||||
return 0
|
||||
} &&
|
||||
complete -F _bk bk
|
||||
|
||||
# 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
|
|
@ -1,41 +0,0 @@
|
|||
# btdownloadheadless(1) completion
|
||||
|
||||
have btdownloadheadless.py || have btdownloadcurses.py || \
|
||||
have btdownloadgui.py &&
|
||||
_btdownload()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
--responsefile|--saveas)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--max_uploads --keepalive_interval \
|
||||
--download_slice_size --request_backlog --max_message_length \
|
||||
--ip --minport --maxport --responsefile --url --saveas --timeout \
|
||||
--timeout_check_interval --max_slice_length --max_rate_period \
|
||||
--bind --upload_rate_fudge --display_interval --rerequest_interval \
|
||||
--min_peers --http_timeout --max_initiate --max_allow_in \
|
||||
--check_hashes --max_upload_rate --snub_time --spew \
|
||||
--rarest_first_cutoff --min_uploads --report_hash_failures' \
|
||||
-- "$cur" ) )
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
} &&
|
||||
complete -F _btdownload btdownloadheadless.py btdownloadcurses.py btdownloadgui.py
|
||||
|
||||
# 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
|
|
@ -1,432 +0,0 @@
|
|||
# bash completion for bluez utils
|
||||
|
||||
have hcitool && {
|
||||
_bluetooth_adresses()
|
||||
{
|
||||
if [ -n "${COMP_BLUETOOTH_SCAN:-}" ]; then
|
||||
COMPREPLY=( ${COMPREPLY[@]:-} $( compgen -W "$( hcitool scan | \
|
||||
awk '/^\t/{print $1}' )" -- "$cur" ) )
|
||||
fi
|
||||
}
|
||||
|
||||
_bluetooth_devices()
|
||||
{
|
||||
COMPREPLY=( ${COMPREPLY[@]:-} $( compgen -W "$( hcitool dev | \
|
||||
awk '/^\t/{print $1}' )" -- "$cur" ) )
|
||||
}
|
||||
|
||||
_bluetooth_services()
|
||||
{
|
||||
COMPREPLY=( $( compgen -W 'DID SP DUN LAN FAX OPUSH FTP HS HF HFAG \
|
||||
SAP NAP GN PANU HCRP HID CIP A2SRC A2SNK AVRCT AVRTG UDIUE \
|
||||
UDITE SYNCML' -- "$cur" ) )
|
||||
}
|
||||
|
||||
_bluetooth_packet_types()
|
||||
{
|
||||
COMPREPLY=( $( compgen -W 'DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3' \
|
||||
-- "$cur" ) )
|
||||
}
|
||||
|
||||
_hcitool()
|
||||
{
|
||||
local cur prev split=false arg
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
case $prev in
|
||||
-i)
|
||||
_bluetooth_devices
|
||||
return 0;
|
||||
;;
|
||||
--role)
|
||||
COMPREPLY=( $( compgen -W 'm s' -- "$cur" ) )
|
||||
return 0;
|
||||
;;
|
||||
--pkt-type)
|
||||
_bluetooth_packet_types
|
||||
return 0;
|
||||
;;
|
||||
esac
|
||||
|
||||
$split && return 0
|
||||
|
||||
_get_first_arg
|
||||
if [ -z $arg ]; then
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--help -i' -- "$cur" ) )
|
||||
else
|
||||
COMPREPLY=( $( compgen -W 'dev inq scan name info \
|
||||
spinq epinq cmd con cc dc sr cpt rssi lq tpl \
|
||||
afh lst auth enc key clkoff clock' -- "$cur" ) )
|
||||
fi
|
||||
else
|
||||
case $arg in
|
||||
name|info|dc|rssi|lq|afh|auth|key|clkoff|lst)
|
||||
_count_args
|
||||
if [ $args -eq 2 ]; then
|
||||
_bluetooth_adresses
|
||||
fi
|
||||
;;
|
||||
cc)
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--role --pkt-type' -- "$cur" ) )
|
||||
else
|
||||
_count_args
|
||||
if [ $args -eq 2 ]; then
|
||||
_bluetooth_adresses
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
sr)
|
||||
_count_args
|
||||
if [ $args -eq 2 ]; then
|
||||
_bluetooth_adresses
|
||||
else
|
||||
COMPREPLY=( $( compgen -W 'master slave' -- "$cur" ) )
|
||||
fi
|
||||
;;
|
||||
cpt)
|
||||
_count_args
|
||||
if [ $args -eq 2 ]; then
|
||||
_bluetooth_adresses
|
||||
else
|
||||
_bluetooth_packet_types
|
||||
fi
|
||||
;;
|
||||
tpl|enc|clock)
|
||||
_count_args
|
||||
if [ $args -eq 2 ]; then
|
||||
_bluetooth_adresses
|
||||
else
|
||||
COMPREPLY=( $( compgen -W '0 1' -- "$cur" ) )
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
complete -F _hcitool hcitool
|
||||
|
||||
_sdptool()
|
||||
{
|
||||
local cur prev split=false
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
case $prev in
|
||||
--bdaddr)
|
||||
_bluetooth_adresses
|
||||
return 0;
|
||||
;;
|
||||
esac
|
||||
|
||||
$split && return 0
|
||||
|
||||
_get_first_arg
|
||||
if [ -z $arg ]; then
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--help' -- "$cur" ) )
|
||||
else
|
||||
COMPREPLY=( $( compgen -W 'search browse records add \
|
||||
del get setattr setseq' -- "$cur" ) )
|
||||
fi
|
||||
else
|
||||
case $arg in
|
||||
search)
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--bdaddr \
|
||||
--tree --raw --xml' -- "$cur" ) )
|
||||
else
|
||||
_bluetooth_services
|
||||
fi
|
||||
;;
|
||||
browse|records)
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--tree --raw --xml' -- "$cur" ) )
|
||||
else
|
||||
_bluetooth_adresses
|
||||
fi
|
||||
;;
|
||||
add)
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--handle --channel' -- "$cur" ) )
|
||||
else
|
||||
_bluetooth_services
|
||||
fi
|
||||
;;
|
||||
get)
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--bdaddr \
|
||||
--tree --raw --xml' -- "$cur" ) )
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
complete -F _sdptool sdptool
|
||||
|
||||
_l2ping()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-i)
|
||||
_bluetooth_devices
|
||||
return 0;
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-i -s -c -t -f -r' -- "$cur" ) )
|
||||
else
|
||||
_bluetooth_adresses
|
||||
fi
|
||||
|
||||
}
|
||||
complete -F _l2ping l2ping
|
||||
|
||||
_rfcomm()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-f|--config)
|
||||
_filedir
|
||||
return 0;
|
||||
;;
|
||||
-i)
|
||||
_bluetooth_devices
|
||||
_bluetooth_adresses
|
||||
return 0;
|
||||
;;
|
||||
esac
|
||||
|
||||
_get_first_arg
|
||||
if [ -z $arg ]; then
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--help -a --raw \
|
||||
--config -i --auth --encrypt --secure --master' -- "$cur" ) )
|
||||
else
|
||||
COMPREPLY=( $( compgen -W 'show connect listen watch \
|
||||
bind release' -- "$cur" ) )
|
||||
fi
|
||||
else
|
||||
_count_args
|
||||
if [ $args -eq 2 ]; then
|
||||
_bluetooth_devices
|
||||
else
|
||||
case $arg in
|
||||
connect|bind)
|
||||
if [ $args -eq 3 ]; then
|
||||
_bluetooth_adresses
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
}
|
||||
complete -F _rfcomm rfcomm
|
||||
|
||||
_ciptool()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-i)
|
||||
_bluetooth_devices
|
||||
_bluetooth_adresses
|
||||
return 0;
|
||||
;;
|
||||
esac
|
||||
|
||||
_get_first_arg
|
||||
if [ -z $arg ]; then
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--help -i' -- "$cur" ) )
|
||||
else
|
||||
COMPREPLY=( $( compgen -W 'show search connect release \
|
||||
loopback' -- "$cur" ) )
|
||||
fi
|
||||
else
|
||||
case $arg in
|
||||
connect|release|loopback)
|
||||
_count_args
|
||||
if [ $args -eq 2 ]; then
|
||||
_bluetooth_adresses
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
complete -F _ciptool ciptool
|
||||
|
||||
_dfutool()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-d|--device)
|
||||
_bluetooth_devices
|
||||
return 0;
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--help --device' -- "$cur" ) )
|
||||
else
|
||||
_count_args
|
||||
case $args in
|
||||
1)
|
||||
COMPREPLY=( $( compgen -W 'verify modify \
|
||||
upgrade archive' -- "$cur" ) )
|
||||
;;
|
||||
2)
|
||||
_filedir
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
complete -F _dfutool dfutool
|
||||
|
||||
_hciconfig()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
_get_first_arg
|
||||
if [ -z $arg ]; then
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--help --all' -- "$cur" ) )
|
||||
else
|
||||
COMPREPLY=( $( compgen -W 'up down reset rstat auth \
|
||||
noauth encrypt noencrypt secmgr nosecmgr \
|
||||
piscan noscan iscan pscan ptype name class \
|
||||
voice iac inqmode inqdata inqtype inqparams \
|
||||
pageparms pageto afhmode aclmtu scomtu putkey \
|
||||
delkey commands features version revision lm' \
|
||||
-- "$cur" ) )
|
||||
fi
|
||||
else
|
||||
case $arg in
|
||||
putkey|delkey)
|
||||
_count_args
|
||||
if [ $args -eq 2 ]; then
|
||||
_bluetooth_adresses
|
||||
fi
|
||||
;;
|
||||
lm)
|
||||
_count_args
|
||||
if [ $args -eq 2 ]; then
|
||||
COMPREPLY=( $( compgen -W 'MASTER \
|
||||
SLAVE NONE ACCEPT' -- "$cur" ) )
|
||||
fi
|
||||
;;
|
||||
ptype)
|
||||
_count_args
|
||||
if [ $args -eq 2 ]; then
|
||||
_bluetooth_packet_types
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
complete -F _hciconfig hciconfig
|
||||
|
||||
_hciattach()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-n -p -t -b -s -l' -- "$cur" ) )
|
||||
else
|
||||
_count_args
|
||||
case $args in
|
||||
1)
|
||||
COMPREPLY=( $( printf '%s\n' /dev/tty* ) )
|
||||
COMPREPLY=( $( compgen -W '${COMPREPLY[@]} \
|
||||
${COMPREPLY[@]#/dev/}' -- "$cur" ) )
|
||||
;;
|
||||
2)
|
||||
COMPREPLY=( $( compgen -W 'any ericsson digi \
|
||||
xircom csr bboxes swave bcsp 0x0105 \
|
||||
0x080a 0x0160 0x0002' -- "$cur" ) )
|
||||
;;
|
||||
3)
|
||||
COMPREPLY=( $( compgen -W '9600 19200 38400 \
|
||||
57600 115200 230400 460800 921600' -- "$cur" ) )
|
||||
;;
|
||||
4)
|
||||
COMPREPLY=( $( compgen -W 'flow noflow' -- "$cur" ) )
|
||||
;;
|
||||
5)
|
||||
_bluetooth_adresses
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
}
|
||||
complete -F _hciattach hciattach
|
||||
|
||||
_hid2hci()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--help --quiet -0 --tohci -1 \
|
||||
--tohid' -- "$cur" ) )
|
||||
fi
|
||||
}
|
||||
complete -F _hid2hci hid2hci
|
||||
|
||||
_avctrl()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--help --quiet' -- "$cur" ) )
|
||||
else
|
||||
_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
|
|
@ -1,48 +0,0 @@
|
|||
# bash completion for brctl
|
||||
|
||||
have brctl &&
|
||||
_brctl()
|
||||
{
|
||||
local cur command
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
command=${COMP_WORDS[1]}
|
||||
|
||||
case $COMP_CWORD in
|
||||
1)
|
||||
COMPREPLY=( $( compgen -W "addbr delbr addif delif \
|
||||
setageing setbridgeprio setfd sethello \
|
||||
setmaxage setpathcost setportprio show \
|
||||
showmacs showstp stp" -- "$cur" ) )
|
||||
;;
|
||||
2)
|
||||
case $command in
|
||||
show)
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=( $( compgen -W "$(brctl show | \
|
||||
awk 'NR>1 {print $1}' )" -- "$cur" ) )
|
||||
esac
|
||||
;;
|
||||
3)
|
||||
case $command in
|
||||
addif|delif)
|
||||
_configured_interfaces
|
||||
;;
|
||||
stp)
|
||||
COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
} &&
|
||||
complete -F _brctl -o default brctl
|
||||
|
||||
# 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
|
|
@ -1,51 +0,0 @@
|
|||
# bash completion for bzip2
|
||||
|
||||
have bzip2 || have pbzip2 &&
|
||||
_bzip2()
|
||||
{
|
||||
local cur prev xspec helpopts
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
helpopts=`_parse_help ${COMP_WORDS[0]}`
|
||||
|
||||
case $prev in
|
||||
-b|-h|--help|-p)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W "${helpopts//#/} -2 -3 -4 -5 -6 -7 -8 -9" \
|
||||
-- "$cur" ) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
local IFS=$'\n'
|
||||
|
||||
xspec="*.bz2"
|
||||
if [[ "$prev" == --* ]]; then
|
||||
[[ "$prev" == --decompress || \
|
||||
"$prev" == --list || \
|
||||
"$prev" == --test ]] && xspec="!"$xspec
|
||||
[[ "$prev" == --compress ]] && xspec=
|
||||
elif [[ "$prev" == -* ]]; then
|
||||
[[ "$prev" == -*[dt]* ]] && xspec="!"$xspec
|
||||
[[ "$prev" == -*z* ]] && xspec=
|
||||
fi
|
||||
|
||||
_expand || return 0
|
||||
|
||||
_compopt_o_filenames
|
||||
COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \
|
||||
$( compgen -d -- "$cur" ) )
|
||||
} &&
|
||||
complete -F _bzip2 bzip2 pbzip2
|
||||
|
||||
# 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
|
|
@ -1,24 +0,0 @@
|
|||
# Linux cardctl(8) completion
|
||||
|
||||
have cardctl || have pccardctl &&
|
||||
_cardctl()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [ $COMP_CWORD -eq 1 ]; then
|
||||
COMPREPLY=( $( compgen -W 'status config ident suspend \
|
||||
resume reset eject insert scheme' -- "$cur" ) )
|
||||
fi
|
||||
} &&
|
||||
complete -F _cardctl cardctl pccardctl
|
||||
|
||||
# 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
|
|
@ -1,88 +0,0 @@
|
|||
# bash completion for cfengine
|
||||
|
||||
have cfagent && {
|
||||
_cfagent_options()
|
||||
{
|
||||
COMPREPLY=( $( compgen -W '--sysadm --force-net-copy --no-check-files \
|
||||
--no-check-mounts --debug --define --no-edits --enforce-links --file \
|
||||
--help --no-hard-classes --no-ifconfig --inform --no-copy --no-lock \
|
||||
--traverse-links --delete-stale-links --no-mount --no-modules \
|
||||
--dry-run --negate --parse-only --no-processes --no-splay \
|
||||
--no-commands --silent --no-tidy --use-env --underscore-classes \
|
||||
--verbose --version --no-preconf --no-links --quiet' -- "$cur" ) )
|
||||
}
|
||||
|
||||
_cfagent()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-f|--file)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
_cfagent_options
|
||||
fi
|
||||
}
|
||||
complete -F _cfagent cfagent
|
||||
|
||||
_cfrun()
|
||||
{
|
||||
local i section cfinputs cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
section=1
|
||||
for (( i=1; i < COMP_CWORD; i++ )); do
|
||||
if [[ "${COMP_WORDS[i]}" == -- ]]; then
|
||||
section=$((section + 1))
|
||||
fi
|
||||
done
|
||||
|
||||
case $section in
|
||||
1)
|
||||
case $prev in
|
||||
-f)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-f -h -d -S -T -v' -- $cur ) )
|
||||
else
|
||||
hostfile=${CFINPUTS:-/var/lib/cfengine/inputs}/cfrun.hosts
|
||||
for (( i=1; i < COMP_CWORD; i++ )); do
|
||||
if [[ "${COMP_WORDS[i]}" == -f ]]; then
|
||||
hostfile=${COMP_WORDS[i+1]}
|
||||
break
|
||||
fi
|
||||
done
|
||||
[ ! -f $hostfile ] && return 0
|
||||
|
||||
COMPREPLY=( $(compgen -W "$( command grep -v \
|
||||
-E '(=|^$|^#)' $hostfile )" -- "$cur" ) )
|
||||
fi
|
||||
;;
|
||||
2)
|
||||
_cfagent_options
|
||||
;;
|
||||
esac
|
||||
}
|
||||
complete -F _cfrun cfrun
|
||||
}
|
||||
|
||||
# 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
|
|
@ -1,44 +0,0 @@
|
|||
# chkconfig(8) completion
|
||||
|
||||
have chkconfig &&
|
||||
_chkconfig()
|
||||
{
|
||||
local cur prev split=false
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
case $prev in
|
||||
--level=[1-6]|[1-6]|--list|--add|--del|--override)
|
||||
_services
|
||||
return 0
|
||||
;;
|
||||
--level)
|
||||
COMPREPLY=( $( compgen -W '1 2 3 4 5 6' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
$split && return 0
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--list --add --del --override --level' -- "$cur" ) )
|
||||
else
|
||||
if [[ $COMP_CWORD -eq 2 || $COMP_CWORD -eq 4 ]]; then
|
||||
COMPREPLY=( $( compgen -W 'on off reset resetpriorities' -- "$cur" ) )
|
||||
else
|
||||
_services
|
||||
fi
|
||||
fi
|
||||
} &&
|
||||
complete -F _chkconfig chkconfig
|
||||
|
||||
# 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
|
|
@ -1,37 +0,0 @@
|
|||
# chsh(1) completion
|
||||
|
||||
_chsh()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
--list-shells|--help|-v|--version)
|
||||
return 0
|
||||
;;
|
||||
-s|--shell)
|
||||
_shells
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* && "$( uname -s )" == @(Linux|GNU|GNU/*) ]]; then
|
||||
COMPREPLY=( $( compgen -W '--shell --list-shells --help --version' \
|
||||
-- "$cur" ) )
|
||||
else
|
||||
COMPREPLY=( $( compgen -u -- "$cur" ) )
|
||||
fi
|
||||
|
||||
return 0
|
||||
}
|
||||
complete -F _chsh chsh
|
||||
|
||||
# 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
|
|
@ -1,38 +0,0 @@
|
|||
# cksfv completion by Chris <xris@forevermore.net>
|
||||
|
||||
have cksfv &&
|
||||
_cksfv()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
if [ $COMP_CWORD -eq 1 ]; then
|
||||
COMPREPLY=( $( compgen -W '-C -f -i -q -v' -- "$cur" ) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
case "$prev" in
|
||||
-C)
|
||||
_filedir -d
|
||||
return 0
|
||||
;;
|
||||
-f)
|
||||
_filedir 'sfv'
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
_filedir
|
||||
return 0
|
||||
} &&
|
||||
complete -F _cksfv cksfv
|
||||
|
||||
# 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
|
|
@ -1,31 +0,0 @@
|
|||
# bash brogrammable completion for various Common Lisp implementations by
|
||||
# Nikodemus Siivola <nikodemus@random-state.net>
|
||||
|
||||
have clisp &&
|
||||
_clisp()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
# completing an option (may or may not be separated by a space)
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-h --help --version --license -B -K \
|
||||
-M -m -L -N -E -q --quiet --silent -w -I -ansi \
|
||||
-traditional -p -C -norc -i -c -l -o -x ' -- "$cur" ) )
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
|
||||
return 0
|
||||
} &&
|
||||
complete -F _clisp -o default clisp
|
||||
|
||||
# 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
|
|
@ -1,44 +0,0 @@
|
|||
# bash completion for configure
|
||||
|
||||
_configure()
|
||||
{
|
||||
local cur prev split=false
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
case $prev in
|
||||
--*prefix|--*dir)
|
||||
_filedir -d
|
||||
;;
|
||||
esac
|
||||
|
||||
$split && return 0
|
||||
|
||||
# if $COMP_CONFIGURE_HINTS is not null, then completions of the form
|
||||
# --option=SETTING will include 'SETTING' as a contextual hint
|
||||
[[ "$cur" != -* ]] && return 0
|
||||
|
||||
if [ -n "$COMP_CONFIGURE_HINTS" ]; then
|
||||
COMPREPLY=( $( compgen -W "$( $1 --help 2>&1 | \
|
||||
awk '/^ --[A-Za-z]/ { print $1; \
|
||||
if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,].*//g' )" \
|
||||
-- "$cur" ) )
|
||||
else
|
||||
COMPREPLY=( $( compgen -W "$( $1 --help 2>&1 | \
|
||||
awk '/^ --[A-Za-z]/ { print $1; \
|
||||
if ($2 ~ /--[A-Za-z]/) print $2 }' | sed -e 's/[[,=].*//g' )" \
|
||||
-- "$cur" ) )
|
||||
fi
|
||||
}
|
||||
complete -F _configure configure
|
||||
|
||||
# Local variables:
|
||||
# mode: shell-script
|
||||
# sh-basic-offset: 4
|
||||
# sh-indent-comment: t
|
||||
# indent-tabs-mode: nil
|
||||
# End:
|
||||
# ex: ts=4 sw=4 et filetype=sh
|
|
@ -1,149 +0,0 @@
|
|||
# Completions for various core utilities
|
||||
|
||||
# chown(1) completion
|
||||
#
|
||||
have chown &&
|
||||
_chown()
|
||||
{
|
||||
local cur prev split=false
|
||||
|
||||
# Get cur and prev words; but don't treat user:group as separate words.
|
||||
_get_comp_words_by_ref -n : cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
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 "${COMP_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 == 1 ]]; then
|
||||
_usergroup -u
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
fi
|
||||
} &&
|
||||
complete -F _chown chown
|
||||
|
||||
|
||||
# chgrp(1) completion
|
||||
#
|
||||
have chgrp &&
|
||||
_chgrp()
|
||||
{
|
||||
local cur prev split=false
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
cur=${cur//\\\\/}
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
if [[ "$prev" == --reference ]]; then
|
||||
_filedir
|
||||
return 0
|
||||
fi
|
||||
|
||||
$split && return 0
|
||||
|
||||
# options completion
|
||||
if [[ "$cur" == -* ]]; then
|
||||
local w opts
|
||||
for w in "${COMP_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 [[ $COMP_CWORD -eq 1 && "$cur" != -* || "$prev" == -* ]]; then
|
||||
_allowed_groups
|
||||
else
|
||||
_filedir || return 0
|
||||
fi
|
||||
|
||||
return 0
|
||||
} &&
|
||||
complete -F _chgrp chgrp
|
||||
|
||||
# id(1) completion
|
||||
#
|
||||
have id &&
|
||||
_id()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-a -g --group -G --groups -n --name\
|
||||
-r --real -u --user --help --version' -- "$cur" ) )
|
||||
else
|
||||
COMPREPLY=( $( compgen -u "$cur" ) )
|
||||
fi
|
||||
} &&
|
||||
complete -F _id id
|
||||
|
||||
# mktemp(1) completion
|
||||
#
|
||||
have mktemp &&
|
||||
_mktemp()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur prev split=false
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
case "$prev" in
|
||||
--help|--version|--suffix)
|
||||
return 0
|
||||
;;
|
||||
--tmpdir|-p)
|
||||
_filedir -d
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
$split && return 0
|
||||
|
||||
[[ "$cur" == -* ]] && \
|
||||
COMPREPLY=( $( compgen -W '-d -u -q -p -t' -- "$cur" ) )
|
||||
} &&
|
||||
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
|
|
@ -1,31 +0,0 @@
|
|||
# bash completion for cowsay
|
||||
|
||||
have cowsay &&
|
||||
_cowsay()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-f)
|
||||
COMPREPLY=( $( compgen -W '$( cowsay -l | tail -n +2)' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
# relevant options completion
|
||||
COMPREPLY=( $( compgen -W '-b -d -g -p -s -t -w -y -e -f -h -l -n -T -W' \
|
||||
-- "$cur" ) )
|
||||
|
||||
} &&
|
||||
complete -F _cowsay -o default cowsay cowthink
|
||||
|
||||
# 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
|
|
@ -1,52 +0,0 @@
|
|||
# bash completion for cpan2dist
|
||||
|
||||
have cpan2dist &&
|
||||
_cpan2dist()
|
||||
{
|
||||
local cur prev packagelist cpandirs
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
--format)
|
||||
# should remove ":" from COMP_WORDBREAKS, but doesn't work (?)
|
||||
COMPREPLY=( $( compgen -W '$(perl -MCPANPLUS::Dist -e \
|
||||
"print map { \"\$_\n\" } CPANPLUS::Dist->dist_types")' \
|
||||
-- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
--banlist|--ignorelist|--modulelist|--logfile)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--help --skiptest --force --install \
|
||||
--verbose --keepsource --makefile --buildprereq \
|
||||
--archive --flushcache --defaults --edit-metafile \
|
||||
--format --ban --banlist --ignore --ignorelist \
|
||||
--modulelist --logfile --timeout --set-config \
|
||||
--set-program --dist-opts --default-banlist \
|
||||
--default-ignorelist' -- $cur ) )
|
||||
else
|
||||
cpandirs=( "$HOME/.cpanplus/" "$HOME/.cpan/source/modules/" )
|
||||
for dir in ${cpandirs[@]}; do
|
||||
[[ -d "$dir" && -r "$dir/02packages.details.txt.gz" ]] && \
|
||||
packagelist="$dir/02packages.details.txt.gz"
|
||||
done
|
||||
COMPREPLY=( $( zgrep "^${cur//-/::}" \
|
||||
$packagelist 2>/dev/null \
|
||||
| awk '{print $1}' | sed -e 's/::/-/g' ) )
|
||||
fi
|
||||
} &&
|
||||
complete -F _cpan2dist -o default cpan2dist
|
||||
|
||||
# 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
|
|
@ -1,103 +0,0 @@
|
|||
# bash completion for cpio
|
||||
|
||||
have cpio && {
|
||||
_cpio_format()
|
||||
{
|
||||
COMPREPLY=( $( compgen -W 'bin odc newc crc tar ustar hpbin hpodc' -- "$cur" ) )
|
||||
}
|
||||
|
||||
_cpio()
|
||||
{
|
||||
local cur prev split=false
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref -n : cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
# --name value style option
|
||||
case $prev in
|
||||
-H|--format)
|
||||
_cpio_format
|
||||
return 0
|
||||
;;
|
||||
-E|-F|-I|--file|--pattern-file)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-R|--owner)
|
||||
_usergroup
|
||||
return 0
|
||||
;;
|
||||
--rsh-command)
|
||||
_compopt_o_filenames
|
||||
COMPREPLY=( $( compgen -c -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
$split && return 0
|
||||
|
||||
if [ $COMP_CWORD -eq 1 ]; then
|
||||
COMPREPLY=( $( compgen -W '-o --create -i --extract -p --pass-through \
|
||||
-? --help --license --usage --version' -- "$cur" ) )
|
||||
else
|
||||
case ${COMP_WORDS[1]} in
|
||||
-o|--create)
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-0 -a -c -v -A -B\
|
||||
-L -V -C -H -M -O -F --file --format\
|
||||
--message --null --reset-access-time\
|
||||
--verbose --dot --append --block-size\
|
||||
--dereference --io-size --quiet\
|
||||
--force-local --rsh-command --help\
|
||||
--version' -- "$cur" ) )
|
||||
fi
|
||||
;;
|
||||
-i|--extract)
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-b -c -d -f -m -n -r\
|
||||
-t -s -u -v -B -S -V -C -E -H -M -R -I\
|
||||
-F --file --make-directories\
|
||||
--nonmatching\
|
||||
--preserve-modification-time\
|
||||
--numeric-uid-gid --rename -t --list\
|
||||
--swap-bytes --swap --dot\
|
||||
--unconditional --verbose --block-size\
|
||||
--swap-halfwords --io-size\
|
||||
--pattern-file --format --owner\
|
||||
--no-preserve-owner --message\
|
||||
--force-local --no-absolute-filenames\
|
||||
--sparse --only-verify-crc --quiet\
|
||||
--rsh-command --help\
|
||||
--to-stdout \
|
||||
--version' -- "$cur" ) )
|
||||
fi
|
||||
;;
|
||||
-p|--pass-through)
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-0 -a -d -l -m -u -v\
|
||||
-L -V -R --null --reset-access-time\
|
||||
--make-directories --link --quiet\
|
||||
--preserve-modification-time\
|
||||
--unconditional --verbose --dot\
|
||||
--dereference --owner\
|
||||
--no-preserve-owner --sparse --help\
|
||||
--version' -- "$cur" ) )
|
||||
else
|
||||
_filedir -d
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
complete -F _cpio cpio
|
||||
}
|
||||
|
||||
# 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
|
|
@ -1,60 +0,0 @@
|
|||
# crontab(1) completion
|
||||
|
||||
have crontab &&
|
||||
_crontab()
|
||||
{
|
||||
local cur prev
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-u)
|
||||
_allowed_users
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
local i opts=" -u -l -r -e" # leading space at start is significant...
|
||||
[ "$(uname -s)" = Linux ] && opts="$opts -i"
|
||||
[ -e /etc/selinux ] && opts="$opts -s"
|
||||
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
|
||||
case "${COMP_WORDS[i]}" in
|
||||
-l)
|
||||
opts=${opts// -l -r -e/}
|
||||
opts=${opts// -i/}
|
||||
opts=${opts// -s/}
|
||||
;;
|
||||
-e)
|
||||
opts=${opts// -l -r -e/}
|
||||
opts=${opts// -i/}
|
||||
;;
|
||||
-r)
|
||||
opts=${opts// -l -r -e/}
|
||||
;;
|
||||
-u)
|
||||
opts=${opts// -u/}
|
||||
opts=${opts// -i/}
|
||||
;;
|
||||
-i|-s)
|
||||
opts=${opts// ${COMP_WORDS[i]}/}
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '$opts' -- "$cur" ) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
# do filenames only if we did not have -l, -r, or -e
|
||||
[[ "${COMP_LINE}" == *\ -@(l|r|e)* ]] || _filedir
|
||||
} &&
|
||||
complete -F _crontab crontab
|
||||
|
||||
# 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
|
|
@ -1,113 +0,0 @@
|
|||
# bash completion for cryptsetup
|
||||
|
||||
_cryptsetup_name()
|
||||
{
|
||||
COMPREPLY=( $( compgen -X control -W '$( command ls /dev/mapper )' \
|
||||
-- "$cur" ) )
|
||||
}
|
||||
|
||||
_cryptsetup_device()
|
||||
{
|
||||
cur=${cur:=/dev/}
|
||||
_filedir
|
||||
}
|
||||
|
||||
have cryptsetup &&
|
||||
_cryptsetup()
|
||||
{
|
||||
local cur prev arg
|
||||
COMPREPLY=()
|
||||
cur=`_get_cword`
|
||||
prev=`_get_pword`
|
||||
|
||||
case $prev in
|
||||
--key-file|--master-key-file|--header-backup-file|-d)
|
||||
_filedir
|
||||
return 0;
|
||||
;;
|
||||
esac
|
||||
|
||||
_get_first_arg
|
||||
if [ -z $arg ]; then
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--hash --cipher --verify-passphrase \
|
||||
--key-file --master-key-file --key-slot --key-size --size \
|
||||
--offset --skip --readonly --iter-time --batch-mode --timeout \
|
||||
--tries --align-payload --version' -- "$cur" ) )
|
||||
else
|
||||
COMPREPLY=( $( compgen -W 'create remove status resize luksFormat \
|
||||
luksOpen luksClose luksSuspend luksResume luksAddKey \
|
||||
luksRemoveKey luksKillSlot luksDelKey luksUUID isLuks \
|
||||
luksDump luksHeaderBackup luksHeaderRestore' -- "$cur" ) )
|
||||
fi
|
||||
else
|
||||
_count_args
|
||||
case $arg in
|
||||
create)
|
||||
case $args in
|
||||
2)
|
||||
_cryptsetup_name
|
||||
;;
|
||||
3)
|
||||
_cryptsetup_device
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
remove|status|resize|luksClose|luksSuspend|luksResume)
|
||||
case $args in
|
||||
2)
|
||||
_cryptsetup_name
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
luksFormat|luksAddKey|luksRemoveKey)
|
||||
case $args in
|
||||
2)
|
||||
_cryptsetup_device
|
||||
;;
|
||||
3)
|
||||
_filedir
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
luksOpen)
|
||||
case $args in
|
||||
2)
|
||||
_cryptsetup_device
|
||||
;;
|
||||
3)
|
||||
_cryptsetup_name
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
luksKillSlot|luksDelKey|luksUUID|isLuks|luksDump)
|
||||
case $args in
|
||||
2)
|
||||
_cryptsetup_device
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
luksHeaderBackup|luksHeaderRestore)
|
||||
case $args in
|
||||
2)
|
||||
_cryptsetup_device
|
||||
;;
|
||||
3)
|
||||
COMPREPLY=( '--header-backup-file' )
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
return 0
|
||||
} &&
|
||||
complete -F _cryptsetup cryptsetup
|
||||
|
||||
# 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
|
|
@ -1,21 +0,0 @@
|
|||
# bash completion for cups
|
||||
|
||||
have cancel &&
|
||||
_cancel()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
COMPREPLY=( $( compgen -W "$( lpstat | 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
|
|
@ -1,392 +0,0 @@
|
|||
# cvs(1) completion
|
||||
|
||||
have cvs && {
|
||||
set_prefix()
|
||||
{
|
||||
[ -z ${prefix:-} ] || prefix=${cur%/*}/
|
||||
[ -r ${prefix:-}CVS/Entries ] || prefix=""
|
||||
}
|
||||
|
||||
get_entries()
|
||||
{
|
||||
local IFS=$'\n'
|
||||
[ -r ${prefix:-}CVS/Entries ] && \
|
||||
entries=$(cut -d/ -f2 -s ${prefix:-}CVS/Entries)
|
||||
}
|
||||
|
||||
get_modules()
|
||||
{
|
||||
if [ -n "$prefix" ]; then
|
||||
COMPREPLY=( $( command ls -d ${cvsroot}/${prefix}/!(CVSROOT) ) )
|
||||
else
|
||||
COMPREPLY=( $( command ls -d ${cvsroot}/!(CVSROOT) ) )
|
||||
fi
|
||||
}
|
||||
|
||||
_cvs_commands()
|
||||
{
|
||||
cvs --help-commands 2>&1 | awk '/^( *|\t)/ { print $1 }'
|
||||
}
|
||||
|
||||
_cvs_options()
|
||||
{
|
||||
cvs --help-options 2>&1 | awk '/^( *|\t)-/ { print $1 }'
|
||||
}
|
||||
|
||||
_cvs_command_options()
|
||||
{
|
||||
cvs --help $1 2>&1 | sed -ne 's/^[[:space:]]*\(-[^[:space:]=[]*\).*/\1/p'
|
||||
}
|
||||
|
||||
_cvs_kflags()
|
||||
{
|
||||
COMPREPLY=( $( compgen -W 'kv kvl k o b v' -- "$cur" ) )
|
||||
}
|
||||
|
||||
_cvs_roots()
|
||||
{
|
||||
local -a cvsroots
|
||||
cvsroots=( $CVSROOT )
|
||||
[ -r ~/.cvspass ] && \
|
||||
cvsroots=( "${cvsroots[@]}" $( awk '{ print $2 }' ~/.cvspass ) )
|
||||
[ -r CVS/Root ] && cvsroots=( "${cvsroots[@]}" $(cat CVS/Root) )
|
||||
COMPREPLY=( $( compgen -W '${cvsroots[@]}' -- "$cur" ) )
|
||||
__ltrim_colon_completions "$cur"
|
||||
}
|
||||
|
||||
_cvs()
|
||||
{
|
||||
local cur prev count mode i cvsroot cvsroots pwd
|
||||
local -a flags miss files entries changed newremoved
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref -n : cur prev
|
||||
|
||||
count=0
|
||||
for i in "${COMP_WORDS[@]}"; do
|
||||
[ $count -eq $COMP_CWORD ] && break
|
||||
# Last parameter was the CVSROOT, now go back to mode selection
|
||||
if [[ "${COMP_WORDS[((count))]}" == "$cvsroot" && "$mode" == cvsroot ]]; then
|
||||
mode=""
|
||||
fi
|
||||
if [ -z "$mode" ]; then
|
||||
case $i in
|
||||
-H|--help)
|
||||
COMPREPLY=( $( compgen -W "$( _cvs_commands )" -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-d)
|
||||
mode=cvsroot
|
||||
cvsroot=${COMP_WORDS[((count+1))]}
|
||||
;;
|
||||
ad|add|new)
|
||||
mode=add
|
||||
;;
|
||||
adm|admin|rcs)
|
||||
mode=admin
|
||||
;;
|
||||
ann|annotate)
|
||||
mode=annotate
|
||||
;;
|
||||
checkout|co|get)
|
||||
mode=checkout
|
||||
;;
|
||||
com|commit|ci)
|
||||
mode=commit
|
||||
;;
|
||||
di|dif|diff)
|
||||
mode=diff
|
||||
;;
|
||||
ex|exp|export)
|
||||
mode=export
|
||||
;;
|
||||
edit|unedit)
|
||||
mode=$i
|
||||
;;
|
||||
hi|his|history)
|
||||
mode=history
|
||||
;;
|
||||
im|imp|import)
|
||||
mode=import
|
||||
;;
|
||||
re|rel|release)
|
||||
mode=release
|
||||
;;
|
||||
log|rlog)
|
||||
mode=log
|
||||
;;
|
||||
rdiff|patch)
|
||||
mode=rdiff
|
||||
;;
|
||||
remove|rm|delete)
|
||||
mode=remove
|
||||
;;
|
||||
rtag|rfreeze)
|
||||
mode=rtag
|
||||
;;
|
||||
st|stat|status)
|
||||
mode=status
|
||||
;;
|
||||
tag|freeze)
|
||||
mode=tag
|
||||
;;
|
||||
up|upd|update)
|
||||
mode=update
|
||||
;;
|
||||
esac
|
||||
elif [[ "$i" = -* ]]; then
|
||||
flags=( "${flags[@]}" $i )
|
||||
fi
|
||||
count=$((++count))
|
||||
done
|
||||
|
||||
case $mode in
|
||||
add)
|
||||
case $prev in
|
||||
-m)
|
||||
return 0
|
||||
;;
|
||||
-k)
|
||||
_cvs_kflags
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" != -* ]]; then
|
||||
set_prefix
|
||||
if [[ $COMP_CWORD -gt 1 && -r ${prefix:-}CVS/Entries ]]; then
|
||||
get_entries
|
||||
[ -z "$cur" ] && \
|
||||
files=$( command ls -Ad !(CVS) ) || \
|
||||
files=$( command ls -d ${cur}* 2>/dev/null )
|
||||
for i in "${entries[@]}"; do
|
||||
files=( ${files[@]/#$i//} )
|
||||
done
|
||||
COMPREPLY=( $( compgen -X '*~' -W '${files[@]}' -- $cur ) )
|
||||
fi
|
||||
else
|
||||
COMPREPLY=( $( compgen -W "$( _cvs_command_options $mode )" \
|
||||
-- "$cur" ) )
|
||||
fi
|
||||
;;
|
||||
admin)
|
||||
case $prev in
|
||||
-a|-A|-b|-c|-e|-l|-m|-n|-N|-o|-s|-t-|-u)
|
||||
return 0
|
||||
;;
|
||||
-t)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-k)
|
||||
_cvs_kflags
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" = -* ]]; then
|
||||
COMPREPLY=( $( compgen -W "$( _cvs_command_options $mode )" \
|
||||
-- "$cur" ) )
|
||||
fi
|
||||
;;
|
||||
annotate)
|
||||
[[ "$prev" == -@(r|D) ]] && return 0
|
||||
|
||||
if [[ "$cur" = -* ]]; then
|
||||
COMPREPLY=( $( compgen -W "$( _cvs_command_options $mode )" \
|
||||
-- "$cur" ) )
|
||||
else
|
||||
get_entries
|
||||
COMPREPLY=( $( compgen -W '${entries[@]}' -- "$cur" ) )
|
||||
fi
|
||||
;;
|
||||
checkout)
|
||||
case $prev in
|
||||
-r|-D|j)
|
||||
return 0
|
||||
;;
|
||||
-d)
|
||||
_filedir -d
|
||||
return 0
|
||||
;;
|
||||
-k)
|
||||
_cvs_kflags
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" != -* ]]; then
|
||||
[ -z "$cvsroot" ] && cvsroot=$CVSROOT
|
||||
COMPREPLY=( $( cvs -d "$cvsroot" co -c 2> /dev/null | \
|
||||
awk '{print $1}' ) )
|
||||
COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) )
|
||||
else
|
||||
COMPREPLY=( $( compgen -W "$( _cvs_command_options $mode )" \
|
||||
-- "$cur" ) )
|
||||
fi
|
||||
;;
|
||||
commit)
|
||||
case $prev in
|
||||
-m|-r)
|
||||
return 0
|
||||
;;
|
||||
-F)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
set_prefix
|
||||
|
||||
if [[ "$cur" != -* && -r ${prefix:-}CVS/Entries ]]; then
|
||||
# if $COMP_CVS_REMOTE is not null, 'cvs commit' will
|
||||
# complete on remotely checked-out files (requires
|
||||
# passwordless access to the remote repository
|
||||
if [ -n "${COMP_CVS_REMOTE:-}" ]; then
|
||||
# this is the least computationally intensive
|
||||
# way found so far, but other changes
|
||||
# (something other than changed/removed/new)
|
||||
# may be missing
|
||||
changed=( $( cvs -q diff --brief 2>&1 | \
|
||||
sed -ne 's/^Files [^ ]* and \([^ ]*\) differ$/\1/p' ) )
|
||||
newremoved=( $( cvs -q diff --brief 2>&1 | \
|
||||
sed -ne 's/^cvs diff: \([^ ]*\) .*, no comparison available$/\1/p' ) )
|
||||
COMPREPLY=( $( compgen -W '${changed[@]:-} \
|
||||
${newremoved[@]:-}' -- "$cur" ) )
|
||||
else
|
||||
COMPREPLY=( $(compgen -o default -- "$cur") )
|
||||
fi
|
||||
else
|
||||
COMPREPLY=( $( compgen -W "$( _cvs_command_options $mode )" \
|
||||
-- "$cur" ) )
|
||||
fi
|
||||
;;
|
||||
cvsroot)
|
||||
# TODO: works poorly because of the colons and -o default,
|
||||
# could we drop -o default? works ok without it in cvsps
|
||||
_cvs_roots
|
||||
;;
|
||||
export)
|
||||
case $prev in
|
||||
-r|-D)
|
||||
return 0
|
||||
;;
|
||||
-d)
|
||||
_filedir -d
|
||||
return 0
|
||||
;;
|
||||
-k)
|
||||
_cvs_kflags
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" != -* ]]; then
|
||||
[ -z "$cvsroot" ] && cvsroot=$CVSROOT
|
||||
COMPREPLY=( $( cvs -d "$cvsroot" co -c | awk '{print $1}' ) )
|
||||
COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) )
|
||||
else
|
||||
COMPREPLY=( $( compgen -W "$( _cvs_command_options $mode )" \
|
||||
-- "$cur" ) )
|
||||
fi
|
||||
;;
|
||||
diff)
|
||||
if [[ "$cur" == -* ]]; then
|
||||
_longopt diff
|
||||
else
|
||||
get_entries
|
||||
COMPREPLY=( $( compgen -W '${entries[@]:-}' -- "$cur" ) )
|
||||
fi
|
||||
;;
|
||||
remove)
|
||||
if [[ "$cur" != -* ]]; then
|
||||
set_prefix
|
||||
if [[ $COMP_CWORD -gt 1 && -r ${prefix:-}CVS/Entries ]]; then
|
||||
get_entries
|
||||
# find out what files are missing
|
||||
for i in "${entries[@]}"; do
|
||||
[ ! -r "$i" ] && miss=( "${miss[@]}" $i )
|
||||
done
|
||||
COMPREPLY=( $(compgen -W '${miss[@]:-}' -- "$cur") )
|
||||
fi
|
||||
else
|
||||
COMPREPLY=( $( compgen -W "$( _cvs_command_options $mode )" \
|
||||
-- "$cur" ) )
|
||||
fi
|
||||
;;
|
||||
import)
|
||||
case $prev in
|
||||
-I|-b|-m|-W)
|
||||
return 0
|
||||
;;
|
||||
-k)
|
||||
_cvs_kflags
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" != -* ]]; then
|
||||
# starts with same algorithm as checkout
|
||||
[ -z "$cvsroot" ] && cvsroot=$CVSROOT
|
||||
prefix=${cur%/*}
|
||||
if [ -r ${cvsroot}/${prefix} ]; then
|
||||
get_modules
|
||||
COMPREPLY=( ${COMPREPLY[@]#$cvsroot} )
|
||||
COMPREPLY=( ${COMPREPLY[@]#\/} )
|
||||
fi
|
||||
pwd=$( pwd )
|
||||
pwd=${pwd##*/}
|
||||
COMPREPLY=( $( compgen -W '${COMPREPLY[@]} $pwd' -- $cur ) )
|
||||
else
|
||||
COMPREPLY=( $( compgen -W "$( _cvs_command_options $mode )" \
|
||||
-- "$cur" ) )
|
||||
fi
|
||||
;;
|
||||
update)
|
||||
case $prev in
|
||||
-r|-D|-j|-I|-W)
|
||||
return 0
|
||||
;;
|
||||
-k)
|
||||
_cvs_kflags
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" = -* ]]; then
|
||||
COMPREPLY=( $( compgen -W "$( _cvs_command_options $mode )" \
|
||||
-- "$cur" ) )
|
||||
fi
|
||||
;;
|
||||
"")
|
||||
case $prev in
|
||||
-T)
|
||||
_filedir -d
|
||||
return 0
|
||||
;;
|
||||
-e|-s)
|
||||
return 0
|
||||
;;
|
||||
-z)
|
||||
COMPREPLY=( $( compgen -W '1 2 3 4 5 6 7 8 9' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
COMPREPLY=( $( compgen -W '$( _cvs_commands ) $( _cvs_options ) \
|
||||
--help --help-commands --help-options --version' -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
|
||||
return 0
|
||||
}
|
||||
complete -F _cvs -o default cvs
|
||||
}
|
||||
|
||||
# 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
|
|
@ -1,69 +0,0 @@
|
|||
# bash completion for cvsps
|
||||
|
||||
have cvsps &&
|
||||
_cvsps()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur prev
|
||||
_get_comp_words_by_ref -n : cur prev
|
||||
|
||||
case $prev in
|
||||
-h|-z|-f|-d|-l|--diff-opts|--debuglvl)
|
||||
return 0
|
||||
;;
|
||||
-s)
|
||||
COMPREPLY=( $( compgen -W "$( cvsps 2>/dev/null |
|
||||
awk '/^PatchSet:?[ \t]/ { print $2 }' )" -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-a)
|
||||
COMPREPLY=( $( compgen -W "$( cvsps 2>/dev/null |
|
||||
awk '/^Author:[ \t]/ { print $2 }' )" -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-b)
|
||||
COMPREPLY=( $( compgen -W "$( cvsps 2>/dev/null |
|
||||
awk '/^Branch:[ \t]/ { print $2 }' )" -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-r)
|
||||
COMPREPLY=( $( compgen -W "$( cvsps 2>/dev/null |
|
||||
awk '/^Tag:[ \t]+[^(]/ { print $2 }' )" -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-p)
|
||||
_filedir -d
|
||||
return 0
|
||||
;;
|
||||
--test-log)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-Z)
|
||||
COMPREPLY=( $( compgen -W '1 2 3 4 5 6 7 8 9' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
--root)
|
||||
type _cvs_roots &>/dev/null && _cvs_roots
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]] ; then
|
||||
COMPREPLY=( $( compgen -W '-h -x -u -z -g -s -a -f -d -b -l -r -p -v \
|
||||
-t --norc --summary-first --test-log --diff-opts --bkcvs --no-rlog \
|
||||
--cvs-direct --no-cvs-direct --debuglvl -Z --root -q -A' \
|
||||
-- "$cur" ) )
|
||||
else
|
||||
type _cvs_roots &>/dev/null && _cvs_roots
|
||||
fi
|
||||
} &&
|
||||
complete -F _cvsps cvsps
|
||||
|
||||
# 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
|
|
@ -1,39 +0,0 @@
|
|||
# bash completion for dd
|
||||
|
||||
have dd &&
|
||||
_dd()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref -n = cur
|
||||
|
||||
case $cur in
|
||||
if=*|of=*)
|
||||
cur=${cur#*=}
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
conv=*)
|
||||
cur=${cur#*=}
|
||||
COMPREPLY=( $( compgen -W 'ascii ebcdic ibm block unblock lcase
|
||||
notrunc ucase swab noerror sync' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
_expand || return 0
|
||||
|
||||
COMPREPLY=( $( compgen -W '--help --version' -- "$cur" ) \
|
||||
$( compgen -W 'bs cbs conv count ibs if obs of seek skip' \
|
||||
-S '=' -- "$cur" ) )
|
||||
} &&
|
||||
complete -F _dd -o nospace dd
|
||||
|
||||
# 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
|
|
@ -1,36 +0,0 @@
|
|||
# bash completion for dhclient
|
||||
|
||||
have dhclient && _dhclient()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-cf|-lf|-pf|-sf)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-s)
|
||||
_known_hosts_real "$cur"
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-p -d -q -1 -r -lf -pf \
|
||||
-cf -sf -s -g -n -nw -w' -- "$cur" ) )
|
||||
else
|
||||
_available_interfaces
|
||||
fi
|
||||
} &&
|
||||
complete -F _dhclient dhclient
|
||||
|
||||
# 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
|
|
@ -1,77 +0,0 @@
|
|||
# dict(1) completion
|
||||
|
||||
{ have dict || have rdict; } && {
|
||||
_dictdata()
|
||||
{
|
||||
dict $host $port $1 2>/dev/null | sed -ne \
|
||||
's/^['$'\t '']['$'\t '']*\([^'$'\t '']*\).*$/\1/p'
|
||||
}
|
||||
|
||||
_dict()
|
||||
{
|
||||
local cur prev host port db dictfile
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
dictfile=/usr/share/dict/words
|
||||
|
||||
for (( i=1; i < COMP_CWORD; i++ )); do
|
||||
case ${COMP_WORDS[i]} in
|
||||
-h|--host)
|
||||
host=${COMP_WORDS[i+1]}
|
||||
[ -n "$host" ] && host="-h $host"
|
||||
i=$((++i))
|
||||
;;
|
||||
-p|--port)
|
||||
port=${COMP_WORDS[i+1]}
|
||||
[ -n "$port" ] && port="-p $port"
|
||||
i=$((++i))
|
||||
;;
|
||||
-d|--database)
|
||||
db=${COMP_WORDS[i+1]}
|
||||
[ -n "$db" ] && host="-d $db"
|
||||
i=$((++i))
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ "$cur" = -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--host --port --database \
|
||||
--match --strategy --config \
|
||||
--nocorrect --dbs --strats \
|
||||
--serverhelp --info --serverinfo \
|
||||
--noauth --user --key --version \
|
||||
--license --help --verbose --raw \
|
||||
--pager --debug --html --pipesize --client' \
|
||||
-- "$cur" ) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
case $prev in
|
||||
-d|--database|-i|-info)
|
||||
COMPREPLY=( $( compgen -W '$( _dictdata -D )' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-s|--strategy)
|
||||
COMPREPLY=( $( compgen -W '$( _dictdata -S )' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
[ -r $dictfile ] && \
|
||||
COMPREPLY=( $( compgen -W '$( cat $dictfile )' -- "$cur" ) )
|
||||
}
|
||||
complete -F _dict -o default dict rdict
|
||||
}
|
||||
|
||||
# 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
|
|
@ -1,244 +0,0 @@
|
|||
# This function is required by _dpkg() and _dpkg-reconfigure()
|
||||
have dpkg && {
|
||||
have grep-status && {
|
||||
_comp_dpkg_installed_packages()
|
||||
{
|
||||
grep-status -P -e "^$1" -a -FStatus 'install ok installed' -n -s Package
|
||||
}
|
||||
} || {
|
||||
_comp_dpkg_installed_packages()
|
||||
{
|
||||
command grep -A 1 "Package: $1" /var/lib/dpkg/status | \
|
||||
command grep -B 1 -Ee "ok installed|half-installed|unpacked| \
|
||||
half-configured|config-files" \
|
||||
-Ee "^Essential: yes" | \
|
||||
command grep "Package: $1" | cut -d\ -f2
|
||||
}
|
||||
}
|
||||
|
||||
# Debian dpkg(8) completion
|
||||
#
|
||||
_dpkg()
|
||||
{
|
||||
local cur prev i
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
i=$COMP_CWORD
|
||||
|
||||
_expand || return 0
|
||||
|
||||
_split_longopt
|
||||
|
||||
# find the last option flag
|
||||
if [[ $cur != -* ]]; then
|
||||
while [[ $prev != -* && $i != 1 ]]; do
|
||||
i=$((i-1))
|
||||
prev=${COMP_WORDS[i-1]}
|
||||
done
|
||||
fi
|
||||
|
||||
case $prev in
|
||||
-c|-i|-A|-I|-f|-e|-x|-X|-W|--install|--unpack|--record-avail| \
|
||||
--contents|--info|--fsys-tarfile|--field|--control|--extract| \
|
||||
--show)
|
||||
_filedir '?(u)deb'
|
||||
return 0
|
||||
;;
|
||||
-b|--build)
|
||||
_filedir -d
|
||||
return 0
|
||||
;;
|
||||
-s|-p|-l|--status|--print-avail|--list)
|
||||
COMPREPLY=( $( apt-cache pkgnames "$cur" 2>/dev/null ) )
|
||||
return 0
|
||||
;;
|
||||
-S|--search)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-r|-L|-P|--remove|--purge|--listfiles)
|
||||
COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=( $( compgen -W '-i --install --unpack -A --record-avail \
|
||||
--configure -r --remove -P --purge --get-selections \
|
||||
--set-selections --update-avail --merge-avail \
|
||||
--clear-avail --command-fd --forget-old-unavail -s \
|
||||
--status -p --print-avail -L --listfiles -l --list \
|
||||
-S --search -C --audit --print-architecture \
|
||||
--print-gnu-build-architecture \
|
||||
--print-installation-architecture \
|
||||
--compare-versions --help --version --force-help \
|
||||
--force-all --force-auto-select --force-downgrade \
|
||||
--force-configure-any --force-hold --force-bad-path \
|
||||
--force-not-root --force-overwrite \
|
||||
--force-overwrite-diverted --force-bad-verify \
|
||||
--force-depends-version --force-depends \
|
||||
--force-confnew --force-confold --force-confdef \
|
||||
--force-confmiss --force-conflicts --force-architecture\
|
||||
--force-overwrite-dir --force-remove-reinstreq \
|
||||
--force-remove-essential -Dh \
|
||||
--debug=help --licence --admindir --root --instdir \
|
||||
-O --selected-only -E --skip-same-version \
|
||||
-G --refuse-downgrade -B --auto-deconfigure \
|
||||
--no-debsig --no-act -D --debug --status-fd \
|
||||
-b --build -I --info -f --field -c --contents \
|
||||
-x --extract -X --vextract --fsys-tarfile -e --control \
|
||||
--ignore-depends --abort-after' -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
}
|
||||
complete -F _dpkg dpkg dpkg-deb
|
||||
}
|
||||
|
||||
# Debian GNU dpkg-reconfigure(8) completion
|
||||
#
|
||||
have dpkg-reconfigure &&
|
||||
_dpkg_reconfigure()
|
||||
{
|
||||
local cur prev opt
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-f|--frontend)
|
||||
opt=( $( printf '%s\n' /usr/share/perl5/Debconf/FrontEnd/* ) )
|
||||
opt=( ${opt[@]##*/} )
|
||||
opt=( ${opt[@]%.pm} )
|
||||
COMPREPLY=( $( compgen -W '${opt[@]}' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-p|--priority)
|
||||
COMPREPLY=( $( compgen -W 'low medium high critical' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $(compgen -W '--frontend --priority --all --unseen-only \
|
||||
--help --showold --force --terse' -- "$cur" ) )
|
||||
else
|
||||
COMPREPLY=( $( _comp_dpkg_installed_packages "$cur" ) )
|
||||
fi
|
||||
} &&
|
||||
complete -F _dpkg_reconfigure -o default dpkg-reconfigure
|
||||
|
||||
# Debian dpkg-source completion
|
||||
#
|
||||
have dpkg-source &&
|
||||
_dpkg_source()
|
||||
{
|
||||
local cur prev 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"
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
action="options"
|
||||
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
|
||||
if [[ ${COMP_WORDS[$i]} == "-x" ]]; then
|
||||
action=unpack
|
||||
elif [[ ${COMP_WORDS[$i]} == "-b" ]]; then
|
||||
action=pack
|
||||
elif [[ ${COMP_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
|
|
@ -1,40 +0,0 @@
|
|||
# Debian Linux dselect(8) completion.
|
||||
|
||||
have dselect &&
|
||||
_dselect()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
--admindir)
|
||||
_filedir -d
|
||||
return 0
|
||||
;;
|
||||
-D|-debug)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--admindir --help --version --licence \
|
||||
--license --expert --debug' -- "$cur" ) )
|
||||
else
|
||||
COMPREPLY=( $( compgen -W 'access update select install config \
|
||||
remove quit' -- "$cur" ) )
|
||||
fi
|
||||
|
||||
return 0
|
||||
} &&
|
||||
complete -F _dselect dselect
|
||||
|
||||
# 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
|
|
@ -1,256 +0,0 @@
|
|||
# dsniff util completion
|
||||
|
||||
have arpspoof &&
|
||||
_arpspoof()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-i)
|
||||
_available_interfaces
|
||||
return 0
|
||||
;;
|
||||
-t)
|
||||
_known_hosts_real "$cur"
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-i -t' -- "$cur" ) )
|
||||
else
|
||||
_known_hosts_real "$cur"
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _arpspoof arpspoof
|
||||
|
||||
have dnsspoof &&
|
||||
_dnsspoof()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-i)
|
||||
_interfaces
|
||||
return 0
|
||||
;;
|
||||
-f)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-i -f' -- "$cur" ) )
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _dnsspoof dnsspoof
|
||||
|
||||
have dsniff &&
|
||||
_dsniff()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-r|-w|-f)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-i)
|
||||
_interfaces
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-c -d -m -n -i -s -f -t -r -w' -- "$cur" ) )
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _dsniff dsniff
|
||||
|
||||
have filesnarf || have mailsnarf || have msgsnarf &&
|
||||
_snarf()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-i)
|
||||
_interfaces
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-i -v' -- "$cur" ) )
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _snarf filesnarf mailsnarf msgsnarf
|
||||
|
||||
have macof &&
|
||||
_macof()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-i)
|
||||
_interfaces
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-i -s -d -e -x -y -n' -- "$cur" ) )
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _macof macof
|
||||
|
||||
have sshmitm &&
|
||||
_sshmitm()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-d -I -p' -- "$cur" ) )
|
||||
else
|
||||
_known_hosts_real "$cur"
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _sshmitm sshmitm
|
||||
|
||||
have sshow &&
|
||||
_sshow()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-i)
|
||||
_interfaces
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-d -i' -- "$cur" ) )
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _sshow sshow
|
||||
|
||||
have tcpkill &&
|
||||
_tcpkill()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
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
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-i)
|
||||
_interfaces
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-A -I -M -i' -- "$cur" ) )
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _tcpnice tcpnice
|
||||
|
||||
have urlsnarf &&
|
||||
_urlsnarf()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-i)
|
||||
_interfaces
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-n -i -v' -- "$cur" ) )
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _urlsnarf urlsnarf
|
||||
|
||||
have webmitm &&
|
||||
_webmitm()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-d' -- "$cur" ) )
|
||||
else
|
||||
_known_hosts_real "$cur"
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _webmitm webmitm
|
||||
|
||||
# Local variables:
|
||||
# mode: shell-script
|
||||
# sh-basic-offset: 4
|
||||
# sh-indent-comment: t
|
||||
# indent-tabs-mode: nil
|
||||
# End:
|
||||
# ex: ts=4 sw=4 et filetype=sh
|
|
@ -1,47 +0,0 @@
|
|||
# dvd+rw-tools completions
|
||||
|
||||
have growisofs &&
|
||||
_growisofs()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur prev
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-version|-speed)
|
||||
return 0
|
||||
;;
|
||||
-Z|-M)
|
||||
compopt -o nospace &>/dev/null
|
||||
_dvd_devices
|
||||
return 0
|
||||
;;
|
||||
/?(r)dev/*)
|
||||
if [[ $cur == =* ]] ; then
|
||||
# e.g. /dev/dvd=foo.iso, /dev/dvdrw=/dev/zero
|
||||
cur="${cur#=}"
|
||||
_filedir
|
||||
return 0
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
# TODO: mkisofs options
|
||||
COMPREPLY=( $( compgen -W '-dvd-compat -overburn -speed= -Z -M' \
|
||||
-- "$cur" ) )
|
||||
[[ ${COMPREPLY[@]} == *= ]] && compopt -o nospace &>/dev/null
|
||||
return 0
|
||||
fi
|
||||
|
||||
_filedir
|
||||
} &&
|
||||
complete -F _growisofs growisofs
|
||||
|
||||
# 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
|
|
@ -1,180 +0,0 @@
|
|||
# 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 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 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 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 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 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 ^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 '-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 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
|
|
@ -1,128 +0,0 @@
|
|||
# bash completion for GNU find. This makes heavy use of ksh style extended
|
||||
# globs and contains Linux specific code for completing the parameter
|
||||
# to the -fstype option.
|
||||
|
||||
have find &&
|
||||
_find()
|
||||
{
|
||||
local cur prev i exprfound onlyonce
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-maxdepth|-mindepth)
|
||||
COMPREPLY=( $( compgen -W '0 1 2 3 4 5 6 7 8 9' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-newer|-anewer|-cnewer|-fls|-fprint|-fprint0|-fprintf|-name|-iname|\
|
||||
-lname|-ilname|-wholename|-iwholename|-samefile)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-fstype)
|
||||
_fstypes
|
||||
if [[ "$( uname -s )" == *BSD ]] ; then
|
||||
COMPREPLY=( "${COMPREPLY[@]}" \
|
||||
$( compgen -W 'local rdonly' -- "$cur" ) )
|
||||
fi
|
||||
return 0
|
||||
;;
|
||||
-gid)
|
||||
_gids
|
||||
return 0
|
||||
;;
|
||||
-group)
|
||||
COMPREPLY=( $( compgen -g -- "$cur" 2>/dev/null) )
|
||||
return 0
|
||||
;;
|
||||
-xtype|-type)
|
||||
COMPREPLY=( $( compgen -W 'b c d p f l s' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-uid)
|
||||
_uids
|
||||
return 0
|
||||
;;
|
||||
-user)
|
||||
COMPREPLY=( $( compgen -u -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-exec|-execdir|-ok|-okdir)
|
||||
COMP_WORDS=(COMP_WORDS[0] "$cur")
|
||||
COMP_CWORD=1
|
||||
_command
|
||||
return 0
|
||||
;;
|
||||
-[acm]min|-[acm]time|-iname|-lname|-wholename|-iwholename|-lwholename|\
|
||||
-ilwholename|-inum|-path|-ipath|-regex|-iregex|-links|-perm|-size|\
|
||||
-used|-printf|-context)
|
||||
# do nothing, just wait for a parameter to be given
|
||||
return 0
|
||||
;;
|
||||
-regextype)
|
||||
COMPREPLY=( $( compgen -W 'emacs posix-awk posix-basic \
|
||||
posix-egrep posix-extended' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
_expand || return 0
|
||||
# set exprfound to 1 if there is already an expression present
|
||||
for i in ${COMP_WORDS[@]}; do
|
||||
[[ "$i" = [-\(\),\!]* ]] && exprfound=1 && break
|
||||
done
|
||||
|
||||
# handle case where first parameter is not a dash option
|
||||
if [[ "$exprfound" != 1 && "$cur" != [-\(\),\!]* ]]; then
|
||||
_filedir -d
|
||||
return 0
|
||||
fi
|
||||
|
||||
# complete using basic options
|
||||
COMPREPLY=( $( compgen -W '-daystart -depth -follow -help \
|
||||
-ignore_readdir_race -maxdepth -mindepth -mindepth -mount \
|
||||
-noignore_readdir_race -noleaf -regextype -version -warn -nowarn \
|
||||
-xdev \
|
||||
-amin -anewer -atime -cmin -cnewer -ctime -empty -executable -false \
|
||||
-fstype -gid -group -ilname -iname -inum -ipath -iregex -iwholename \
|
||||
-links -lname -mmin -mtime -name -newer -nogroup -nouser -path -perm \
|
||||
-readable -regex -samefile -size -true -type -uid -used -user \
|
||||
-wholename -writable -xtype -context \
|
||||
-delete -exec -execdir -fls -fprint -fprint0 -fprintf -ls -ok -okdir \
|
||||
-print -print0 -printf -prune -quit' -- "$cur" ) )
|
||||
|
||||
# this removes any options from the list of completions that have
|
||||
# already been specified somewhere on the command line, as long as
|
||||
# these options can only be used once (in a word, "options", in
|
||||
# opposition to "tests" and "actions", as in the find(1) manpage).
|
||||
onlyonce=' -daystart -depth -follow -help -ignore_readdir_race -maxdepth \
|
||||
-mindepth -mount -noignore_readdir_race -noleaf -nowarn -regextype \
|
||||
-version -warn -xdev '
|
||||
COMPREPLY=( $( \
|
||||
(while read -d ' ' i; do
|
||||
[[ -z "$i" || "${onlyonce/ ${i%% *} / }" == "$onlyonce" ]] &&
|
||||
continue
|
||||
# flatten array with spaces on either side,
|
||||
# otherwise we cannot grep on word boundaries of
|
||||
# first and last word
|
||||
COMPREPLY=" ${COMPREPLY[@]} "
|
||||
# remove word from list of completions
|
||||
COMPREPLY=( ${COMPREPLY/ ${i%% *} / } )
|
||||
done
|
||||
printf '%s ' "${COMPREPLY[@]}") <<<"${COMP_WORDS[@]}"
|
||||
) )
|
||||
|
||||
_filedir
|
||||
|
||||
return 0
|
||||
} &&
|
||||
complete -F _find find
|
||||
|
||||
# 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
|
|
@ -1,65 +0,0 @@
|
|||
# freeciv completions
|
||||
|
||||
have civserver &&
|
||||
_civserver()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-f|-g|-l|-r|--file|--log|--gamelog|--read)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-d -f -g -h -i -l -m -M -p -q -r -v\
|
||||
--debug --file --gamelog --help --info --log --meta \
|
||||
--Metaserver --port --quitidle --read --version' -- "$cur" ) )
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _civserver civserver
|
||||
|
||||
have civclient &&
|
||||
_civclient()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-l|-S|-t|--log|--Sound|--tiles)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-P|--Plugin)
|
||||
COMPREPLY=( $( compgen -W 'none esd sdl' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-s|--server)
|
||||
_known_hosts_real "$cur"
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-a -d -h -l -m -n -p -P -s -S -t -v\
|
||||
--autoconnect --debug --help --log --meta --name --port \
|
||||
--Plugin --server --Sound --tiles --version' -- "$cur" ) )
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _civclient civclient
|
||||
|
||||
# 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
|
|
@ -1,47 +0,0 @@
|
|||
# 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
|
|
@ -1,36 +0,0 @@
|
|||
# bash completion for fuse
|
||||
|
||||
have fusermount &&
|
||||
_fusermount()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur prev
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-h|-V|-o)
|
||||
return 0
|
||||
;;
|
||||
-u)
|
||||
COMPREPLY=( $( compgen -W "$( awk \
|
||||
'{ if ($3 ~ /^fuse\./) print $2 }' /etc/mtab 2>/dev/null )" \
|
||||
-- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]] ; then
|
||||
COMPREPLY=( $( compgen -W '-h -V -o -u -q -z' -- "$cur" ) )
|
||||
else
|
||||
_filedir -d
|
||||
fi
|
||||
} &&
|
||||
complete -F _fusermount fusermount
|
||||
|
||||
# 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
|
|
@ -1,59 +0,0 @@
|
|||
# gcc(1) completion
|
||||
#
|
||||
# The only unusual feature is that we don't parse "gcc --help -v" output
|
||||
# directly, because that would include the options of all the other backend
|
||||
# tools (linker, assembler, preprocessor, etc) without any indication that
|
||||
# you cannot feed such options to the gcc driver directly. (For example, the
|
||||
# linker takes a -z option, but you must type -Wl,-z for gcc.) Instead, we
|
||||
# ask the driver ("g++") for the name of the compiler ("cc1"), and parse the
|
||||
# --help output of the compiler.
|
||||
|
||||
have gcc &&
|
||||
_gcc()
|
||||
{
|
||||
local cur cc backend
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
_expand || return 0
|
||||
|
||||
case $1 in
|
||||
gcj)
|
||||
backend=jc1
|
||||
;;
|
||||
gpc)
|
||||
backend=gpc1
|
||||
;;
|
||||
*77)
|
||||
backend=f771
|
||||
;;
|
||||
*)
|
||||
backend=cc1 # (near-)universal backend
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
cc=$( $1 -print-prog-name=$backend )
|
||||
# sink stderr:
|
||||
# for C/C++/ObjectiveC it's useless
|
||||
# for FORTRAN/Java it's an error
|
||||
COMPREPLY=( $( compgen -W "$( $cc --help 2>/dev/null | \
|
||||
tr '\t' ' ' | \
|
||||
sed -e '/^ *-/!d' -e 's/ *-\([^ ]*\).*/-\1/' | \
|
||||
sort -u )" -- "$cur" ) )
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
} &&
|
||||
complete -F _gcc gcc g++ c++ g77 gcj gpc
|
||||
[ $USERLAND = GNU -o $UNAME = Cygwin ] && \
|
||||
[ -n "${have:-}" ] && complete -F _gcc cc
|
||||
|
||||
# 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
|
|
@ -1,30 +0,0 @@
|
|||
# bash programmable completion for various Common Lisp implementations by
|
||||
# Nikodemus Siivola <nikodemus@random-state.net>
|
||||
|
||||
have gcl &&
|
||||
_gcl()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
# completing an option (may or may not be separated by a space)
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-eval -load -f -batch -dir -libdir \
|
||||
-compile -o-file -c-file -h-file -data-file -system-p '-- "$cur" ) )
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
|
||||
return 0
|
||||
} &&
|
||||
complete -F _gcl -o default gcl
|
||||
|
||||
# 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
|
|
@ -1,44 +0,0 @@
|
|||
# bash completion for gdb
|
||||
|
||||
have gdb &&
|
||||
_gdb()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
if [ $COMP_CWORD -eq 1 ]; then
|
||||
local IFS
|
||||
_compopt_o_filenames
|
||||
if [[ "$cur" == */* ]]; then
|
||||
# compgen -c works as expected if $cur contains any slashes.
|
||||
IFS=$'\n'
|
||||
COMPREPLY=( $( PATH="$PATH:." compgen -d -c -- "$cur" ) )
|
||||
else
|
||||
# otherwise compgen -c contains Bash's built-in commands,
|
||||
# functions and aliases. Thus we need to retrieve the program
|
||||
# names manually.
|
||||
IFS=":"
|
||||
local path_array=( $( \
|
||||
sed -e 's/:\{2,\}/:/g' -e 's/^://' -e 's/:$//' <<<"$PATH" ) )
|
||||
IFS=$'\n'
|
||||
COMPREPLY=( $( compgen -d -W '$(find "${path_array[@]}" . \
|
||||
-mindepth 1 -maxdepth 1 -not -type d -executable \
|
||||
-printf "%f\\n" 2>/dev/null)' -- "$cur" ) )
|
||||
fi
|
||||
elif [ $COMP_CWORD -eq 2 ]; then
|
||||
prev=${prev##*/}
|
||||
COMPREPLY=( $( compgen -fW "$( command ps axo comm,pid | \
|
||||
awk '{if ($1 ~ /^'"$prev"'/) print $2}' )" -- "$cur" ) )
|
||||
fi
|
||||
} &&
|
||||
complete -F _gdb -o default gdb
|
||||
|
||||
# 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
|
|
@ -1,77 +0,0 @@
|
|||
# bash completion for mkisofs/genisoimage
|
||||
|
||||
(have mkisofs || have genisoimage) &&
|
||||
_mkisofs()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-o|-abstract|-biblio|-check-session|-copyright|-log-file| \
|
||||
-root-info|-prep-boot|-*-list)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-*-charset)
|
||||
COMPREPLY=( $( compgen -W '$( mkisofs -input-charset \
|
||||
help 2>&1 | tail -n +3 )' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-uid)
|
||||
_uids
|
||||
return 0
|
||||
;;
|
||||
-gid)
|
||||
_gids
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-abstract -appid -allow-lowercase \
|
||||
-allow-multidot -biblio -cache-inodes -no-cache-inodes \
|
||||
-eltorito-boot -eltorito-alt-boot -sparc-boot -generic-boot \
|
||||
-hard-disk-boot -no-emul-boot -no-boot -boot-load-seg \
|
||||
-boot-load-size -boot-info-table -cdrecord-params \
|
||||
-eltorito-catalog -check-oldname -check-session -copyright \
|
||||
-omit-period -disable-deep-relocation -dir-mode -dvd-video \
|
||||
-follow-links -file-mode -gid -gui -graft-points -hide -hide-list \
|
||||
-hidden -hidden-list -hide-joliet -hide-joliet-list \
|
||||
-hide-joliet-trans-tbl -hide-rr-moved -input-charset \
|
||||
-output-charset -iso-level -joliet -joliet-long -jcharset \
|
||||
-full-iso9660-filenames -allow-leading-dots -log-file -exclude \
|
||||
-exclude-list -max-iso9660-filenames -prev-session \
|
||||
-omit-version-number -new-dir-mode -nobak -no-bak -force-rr -no-rr \
|
||||
-no-split-symlink-components -no-split-symlink-fields -output -pad \
|
||||
-no-pad -path-list -publisher -preparer -print-size -quiet -rock
|
||||
-rational-rock -relaxed-filenames -sort -split-output \
|
||||
-stream-media-size -stream-file-name -sysid -translation-table \
|
||||
-table-name -ucs-level -udf -uid -use-fileversion \
|
||||
-untranslated-filenames -no-iso-translate -volid -volset \
|
||||
-volset-size -volset-seqno -verbose -old-exclude \
|
||||
-transparent-compression -hfs -apple -map -magic -hfs-creator \
|
||||
-hfs-type -probe -no-desktop -mac-name \
|
||||
-boot-hfs-file -part -auto -cluster-size \
|
||||
-hide-hfs -hide-hfs-list -hfs-volid \
|
||||
-icon-position -root-info -prep-boot \
|
||||
-input-hfs-charset -output-hfs-charset \
|
||||
-hfs-unlock -hfs-bless -hfs-parms --cap \
|
||||
--netatalk --double --ethershare --ushare \
|
||||
--exchange --sgi --xinet --macbin --single \
|
||||
--dave --sfm --osx-double --osx-hfs' -- "$cur" ))
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _mkisofs mkisofs genisoimage
|
||||
|
||||
# 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
|
|
@ -1,55 +0,0 @@
|
|||
# bash completion for getent
|
||||
|
||||
have getent &&
|
||||
_getent()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
passwd)
|
||||
COMPREPLY=( $( compgen -u "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
group)
|
||||
COMPREPLY=( $( compgen -g "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
services)
|
||||
COMPREPLY=( $( compgen -s "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
hosts)
|
||||
COMPREPLY=( $( compgen -A hostname "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
protocols|networks|ahosts|ahostsv4|ahostsv6|rpc)
|
||||
COMPREPLY=( $( compgen -W "$( getent "$prev" | \
|
||||
awk '{ print $1 }' )" -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
aliases|shadow)
|
||||
COMPREPLY=( $( compgen -W "$( getent "$prev" | cut -d: -f1 )" \
|
||||
-- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
if [ $COMP_CWORD -eq 1 ]; then
|
||||
COMPREPLY=( $( compgen -W 'passwd group hosts services protocols \
|
||||
networks ahosts ahostsv4 ahostsv6 aliases ethers netgroup rpc \
|
||||
shadow' -- "$cur" ) )
|
||||
fi
|
||||
} &&
|
||||
complete -F _getent getent
|
||||
|
||||
# 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
|
File diff suppressed because it is too large
Load Diff
|
@ -1,54 +0,0 @@
|
|||
# gkrellm(1) completion
|
||||
|
||||
have gkrellm || have gkrellm2 &&
|
||||
_gkrellm()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-t|--theme)
|
||||
_filedir -d
|
||||
return 0
|
||||
;;
|
||||
-p|--plugin)
|
||||
_filedir so
|
||||
return 0
|
||||
;;
|
||||
-s|--server)
|
||||
_known_hosts_real "$cur"
|
||||
return 0
|
||||
;;
|
||||
-l|--logfile)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-g|--geometry|-c|--config|-P|--port|-d|--debug-level)
|
||||
# Argument required but no completions available
|
||||
return 0
|
||||
;;
|
||||
-h|--help|-v|--version)
|
||||
# All other options are noop with these
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--theme --geometry --wm --m2 --nt \
|
||||
--withdrawn --config --force-host-config --server --port --nc \
|
||||
--config-clean --nolock --plugin --demo --logfile --version \
|
||||
--debug-level --help' -- "$cur" ) )
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _gkrellm gkrellm gkrellm2
|
||||
|
||||
# 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
|
|
@ -1,37 +0,0 @@
|
|||
# Gnatmake completion by Ralf_Schroth@t-online.de (Ralf Schroth)
|
||||
|
||||
have gnatmake &&
|
||||
_gnatmake()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
# relevant (and less relevant ;-) )options completion
|
||||
COMPREPLY=( $( compgen -W '-a -c -f -i -j -k -m -M -n -o \
|
||||
-q -s -v -z -aL -A -aO -aI -I -I- -L -nostdinc \
|
||||
-nostdlib -cargs -bargs -largs -fstack-check \
|
||||
-fno-inline -g -O1 -O0 -O2 -O3 -gnata -gnatA \
|
||||
-gnatb -gnatc -gnatd -gnatD -gnate -gnatE \
|
||||
-gnatf -gnatF -gnatg -gnatG -gnath -gnati \
|
||||
-gnatk -gnatl -gnatL -gnatm -gnatn -gnato \
|
||||
-gnatO -gnatp -gnatP -gnatq -gnatR -gnats \
|
||||
-gnatt -gnatT -gnatu -gnatU -gnatv -gnatws \
|
||||
-gnatwe -gnatwl -gnatwu -gnatW -gnatx -gnatX \
|
||||
-gnaty -gnatz -gnatZ -gnat83' -- "$cur" ) )
|
||||
else
|
||||
# source file completion
|
||||
_filedir '@(adb|ads)'
|
||||
fi
|
||||
} &&
|
||||
complete -F _gnatmake gnatmake
|
||||
|
||||
# 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
|
|
@ -1,48 +0,0 @@
|
|||
# bash completion for gpg
|
||||
|
||||
have gpg &&
|
||||
_gpg()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-s|--sign|--clearsign|--decrypt-files|--load-extension)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
--export|--sign-key|--lsignkey|--nrsignkey|--nrlsignkey|--editkey)
|
||||
# return list of public keys
|
||||
COMPREPLY=( $( compgen -W "$( gpg --list-keys 2>/dev/null | \
|
||||
sed -ne 's@^pub.*/\([^ ]*\).*$@\1@p' \
|
||||
-ne 's@^.*\(<\([^>]*\)>\).*$@\2@p' )" -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-r|--recipient)
|
||||
COMPREPLY=( $( compgen -W "$( gpg --list-keys 2>/dev/null | \
|
||||
sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" ))
|
||||
if [ -e ~/.gnupg/gpg.conf ]; then
|
||||
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W "$( sed -ne \
|
||||
's@^[ \t]*group[ \t][ \t]*\([^=]*\).*$@\1@p' \
|
||||
~/.gnupg/gpg.conf )" -- "$cur") )
|
||||
fi
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '$(gpg --dump-options)' -- "$cur" ) )
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _gpg -o default gpg
|
||||
|
||||
# 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
|
|
@ -1,52 +0,0 @@
|
|||
# gpg2(1) completion
|
||||
|
||||
have gpg2 && {
|
||||
_gpg2 ()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
--homedir)
|
||||
_filedir -d
|
||||
return 0
|
||||
;;
|
||||
-s|--sign|--clearsign|--options|--decrypt)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
--export|--sign-key|--lsign-key|--nrsign-key|--nrlsign-key|--edit-key)
|
||||
# return list of public keys
|
||||
COMPREPLY=( $( compgen -W "$( gpg2 --list-keys 2>/dev/null | \
|
||||
sed -ne 's@^pub.*/\([^ ]*\).*$@\1@p' \
|
||||
-ne 's@^.*\(<\([^>]*\)>\).*$@\2@p' )" -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-r|--recipient)
|
||||
COMPREPLY=( $( compgen -W "$( gpg2 --list-keys 2>/dev/null | \
|
||||
sed -ne 's@^.*<\([^>]*\)>.*$@\1@p')" -- "$cur" ))
|
||||
if [ -e ~/.gnupg/gpg.conf ]; then
|
||||
COMPREPLY=( "${COMPREPLY[@]}" $( compgen -W "$( sed -ne \
|
||||
's@^[ \t]*group[ \t][ \t]*\([^=]*\).*$@\1@p' \
|
||||
~/.gnupg/gpg.conf)" -- "$cur"))
|
||||
fi
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '$(gpg2 --dump-options)' -- "$cur" ) )
|
||||
fi
|
||||
} &&
|
||||
complete -F _gpg2 -o default gpg2
|
||||
}
|
||||
|
||||
# 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
|
|
@ -1,55 +0,0 @@
|
|||
# bash completion for gzip
|
||||
|
||||
have gzip || have pigz &&
|
||||
_gzip()
|
||||
{
|
||||
local cur prev xspec helpopts
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
helpopts=`_parse_help ${COMP_WORDS[0]}`
|
||||
|
||||
case $prev in
|
||||
-b|--blocksize|-p|--processes|-S|--suffix|-h|--help|-V|--version)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W "$helpopts -1 -2 -3 -4 -5 -6 -7 -8 -9" \
|
||||
-- "$cur" ) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
local IFS=$'\n'
|
||||
|
||||
xspec="*.@(gz|t[ag]z)"
|
||||
if [[ "$prev" == --* ]]; then
|
||||
[[ "$prev" == --decompress || \
|
||||
"$prev" == --list || \
|
||||
"$prev" == --test ]] && xspec="!"$xspec
|
||||
[[ "$prev" == --force ]] && xspec=
|
||||
elif [[ "$prev" == -* ]]; then
|
||||
[[ "$prev" == -*[dlt]* ]] && xspec="!"$xspec
|
||||
[[ "$prev" == -*f* ]] && xspec=
|
||||
elif [[ "$prev" == '>' || "$prev" == '>>' ]]; then
|
||||
xspec=
|
||||
elif [ "$prev" = '<' ]; then
|
||||
xspec=
|
||||
fi
|
||||
|
||||
_expand || return 0
|
||||
|
||||
_compopt_o_filenames
|
||||
COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \
|
||||
$( compgen -d -- "$cur" ) )
|
||||
} &&
|
||||
complete -F _gzip gzip pigz
|
||||
|
||||
# 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
|
|
@ -1,133 +0,0 @@
|
|||
# bash completion for heimdal
|
||||
|
||||
have ktutil && {
|
||||
_heimdal_principals()
|
||||
{
|
||||
|
||||
COMPREPLY=( $( compgen -W "$( kadmin -l dump 2>/dev/null | \
|
||||
awk '{print $1}' )" -- "$cur" ) )
|
||||
}
|
||||
|
||||
_heimdal_realms()
|
||||
{
|
||||
|
||||
COMPREPLY=( $( compgen -W "( kadmin -l dump 2>/dev/null | \
|
||||
awk '{print $1}' | awk -F@ '{print $2}' )" -- "$cur" ) )
|
||||
}
|
||||
|
||||
_heimdal_encodings()
|
||||
{
|
||||
|
||||
COMPREPLY=( $( compgen -W 'des-cbc-mcrc des-cbc-md4 des-cbc-md5 \
|
||||
des3-cbc-sha1 arcfour-hmac-md5 aes128-cts-hmac-sha1-96 \
|
||||
aes256-cts-hmac-sha1-96' -- "$cur" ) )
|
||||
}
|
||||
|
||||
_ktutil()
|
||||
{
|
||||
local cur prev command options split=false
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
case $prev in
|
||||
-p|--principal)
|
||||
_heimdal_principals
|
||||
return 0
|
||||
;;
|
||||
-e|--enctype)
|
||||
_heimdal_encodings
|
||||
return 0
|
||||
;;
|
||||
-a|--admin-server)
|
||||
_known_hosts_real "$cur"
|
||||
return 0
|
||||
;;
|
||||
-r|--realm)
|
||||
_heimdal_realms
|
||||
return 0
|
||||
;;
|
||||
-s|-k|--srvtab|--keytab)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
$split && return 0
|
||||
|
||||
commands='add change copy get list remove rename purge srvconvert \
|
||||
srv2keytab srvcreate key2srvtab'
|
||||
|
||||
for (( i=1; i < COMP_CWORD; i++ )); do
|
||||
case ${COMP_WORDS[i]} in
|
||||
-k|--keytab)
|
||||
i=$(($i+1))
|
||||
;;
|
||||
-*)
|
||||
;;
|
||||
*)
|
||||
command=${COMP_WORDS[i]}
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
case $command in
|
||||
add)
|
||||
options='-p --principal -V -e --enctype -w --password -r \
|
||||
--random -s --no-salt -h --hex'
|
||||
;;
|
||||
change)
|
||||
options='-r --realm -a --admin-server -s --server-port'
|
||||
;;
|
||||
get)
|
||||
options='-p --principal -e --enctype -r --realm -a \
|
||||
--admin-server -s server --server-port'
|
||||
;;
|
||||
list)
|
||||
options='--keys --timestamp'
|
||||
;;
|
||||
remove)
|
||||
options='-p --principal -V --kvno -e --enctype'
|
||||
;;
|
||||
purge)
|
||||
options='--age'
|
||||
;;
|
||||
srv2keytab|key2srvtab)
|
||||
options='-s --srvtab'
|
||||
;;
|
||||
*)
|
||||
options='-k --keytab -v --verbose --version -v --help'
|
||||
;;
|
||||
esac
|
||||
COMPREPLY=( $( compgen -W "$options" -- "$cur" ) )
|
||||
else
|
||||
case $command in
|
||||
copy)
|
||||
_filedir
|
||||
;;
|
||||
get)
|
||||
_heimdal_principals
|
||||
;;
|
||||
rename)
|
||||
_heimdal_principals
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=( $( compgen -W "$commands" -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
complete -F _ktutil ktutil
|
||||
}
|
||||
|
||||
# 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
|
|
@ -1,88 +0,0 @@
|
|||
#!/usr/bin/env perl
|
||||
use strict;
|
||||
use Config;
|
||||
use File::Spec::Functions;
|
||||
|
||||
my %seen;
|
||||
|
||||
sub print_modules_real {
|
||||
my ($base, $dir, $word) = @_;
|
||||
|
||||
# return immediatly if potential completion doesn't match current word
|
||||
# a double comparaison is used to avoid dealing with string lengths
|
||||
# (the shorter being the pattern to be used as the regexp)
|
||||
# word 'Fi', base 'File' -> match 'File' against 'Fi'
|
||||
# word 'File::Sp', base 'File' -> match 'File::Sp' againt 'File'
|
||||
return if
|
||||
$base &&
|
||||
$word &&
|
||||
$base !~ /^\Q$word/ &&
|
||||
$word !~ /^\Q$base/;
|
||||
|
||||
chdir($dir) or return;
|
||||
|
||||
# print each file
|
||||
foreach my $file (glob('*.pm')) {
|
||||
$file =~ s/\.pm$//;
|
||||
my $module = $base . $file;
|
||||
next if $module !~ /^\Q$word/;
|
||||
next if $seen{$module}++;
|
||||
print $module . "\n";
|
||||
}
|
||||
|
||||
# recurse in each subdirectory
|
||||
foreach my $directory (grep { -d } glob('*')) {
|
||||
my $subdir = $dir . '/' . $directory;
|
||||
if ($directory =~ /^(?:[.\d]+|$Config{archname}|auto)$/) {
|
||||
# exclude subdirectory name from base
|
||||
print_modules_real(undef, $subdir, $word);
|
||||
} else {
|
||||
# add subdirectory name to base
|
||||
print_modules_real($base . $directory . '::', $subdir, $word);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sub print_modules {
|
||||
my ($word) = @_;
|
||||
|
||||
foreach my $directory (@INC) {
|
||||
print_modules_real(undef, $directory, $word);
|
||||
}
|
||||
}
|
||||
|
||||
sub print_functions {
|
||||
my ($word) = @_;
|
||||
|
||||
my $perlfunc;
|
||||
for ( @INC, undef ) {
|
||||
return if not defined;
|
||||
$perlfunc = catfile $_, qw( pod perlfunc.pod );
|
||||
last if -r $perlfunc;
|
||||
}
|
||||
|
||||
open my $fh, '<', $perlfunc or return;
|
||||
|
||||
my $nest_level = -1;
|
||||
while ( <$fh> ) {
|
||||
next if 1 .. /^=head2 Alphabetical Listing of Perl Functions$/;
|
||||
++$nest_level if /^=over/;
|
||||
--$nest_level if /^=back/;
|
||||
next if $nest_level;
|
||||
next unless /^=item (-?\w+)/;
|
||||
my $function = $1;
|
||||
next if $function !~ /^\Q$word/;
|
||||
next if $seen{$function}++;
|
||||
print $function . "\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
my $type = shift;
|
||||
my $word = shift;
|
||||
|
||||
if ($type eq 'functions') {
|
||||
print_functions($word);
|
||||
} elsif ($type eq 'modules') {
|
||||
print_modules($word);
|
||||
}
|
|
@ -1,55 +0,0 @@
|
|||
# bash completion for hping2
|
||||
|
||||
have hping || have hping2 || have hping3 &&
|
||||
_hping2()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
cur=`_get_cword`
|
||||
prev=`_get_pword`
|
||||
|
||||
case $prev in
|
||||
-I|--interface)
|
||||
_available_interfaces
|
||||
return 0
|
||||
;;
|
||||
-a|--spoof)
|
||||
_known_hosts_real "$cur"
|
||||
return 0
|
||||
;;
|
||||
-o|--tos)
|
||||
COMPREPLY=( $( compgen -W '02 04 08 10' ) )
|
||||
return 0
|
||||
;;
|
||||
-E|--file)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--help --version --count --interval --fast \
|
||||
--faster --numeric --quiet --interface --verbose --debug --bind \
|
||||
--unbind --rawip --icmp --upd --scan --listen --spoof \
|
||||
--rand-source --rand-dest --ttl --id --ipproto --winid -rel --frag \
|
||||
--morefrag --dontfrag --fragoff --mtu --tos --rroute --icmptype \
|
||||
--icmpcode --icmp-ipver --icmp-iphlen --icmp-iplen --icmp-ipid \
|
||||
--icmp-ipproto --icmp-cksum --icmp-ts --icmp-addr --baseport \
|
||||
--destport --keep --win --tcpoff --tcpseq --tcpack --seqnum \
|
||||
--badcksum --tcp-timestamp --fin --syn --rst --push --ack --urg \
|
||||
--xmas --ymas --data --file --sign --dump --print --safe --end \
|
||||
--traceroute --tr-keep-ttl --tr-stop --tr-no-rtt' -- "$cur" ) )
|
||||
else
|
||||
_known_hosts_real "$cur"
|
||||
fi
|
||||
} &&
|
||||
complete -F _hping2 hping hping2 hping3
|
||||
|
||||
# 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
|
|
@ -1,46 +0,0 @@
|
|||
# iconv(1) completion
|
||||
|
||||
have iconv &&
|
||||
_iconv()
|
||||
{
|
||||
local cur prev split=false
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
case $prev in
|
||||
-'?'|--help|--usage|-V|--version|--unicode-subst|--byte-subst|\
|
||||
--widechar-subst)
|
||||
return 0
|
||||
;;
|
||||
-f|--from-code|-t|--to-code)
|
||||
COMPREPLY=( $( compgen -W '$( iconv -l | \
|
||||
sed -e "s@/*\$@@" -e "s/[,()]//g" )' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-o|--output)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
$split && return 0
|
||||
|
||||
if [[ "$cur" = -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--from-code --to-code --list -c
|
||||
--unicode-subst --byte-subst --widechar-subst --output --silent
|
||||
--verbose --help --usage --version' -- "$cur" ) )
|
||||
return 0
|
||||
fi
|
||||
} &&
|
||||
complete -F _iconv -o default iconv
|
||||
|
||||
# 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
|
|
@ -1,35 +0,0 @@
|
|||
# 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 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
|
|
@ -1,27 +0,0 @@
|
|||
# Red Hat & Debian GNU/Linux if{up,down} completion
|
||||
#
|
||||
[ $USERLAND = GNU ] && { have ifup || have ifdown; } &&
|
||||
_ifupdown()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [ $COMP_CWORD -eq 1 ]; then
|
||||
_configured_interfaces
|
||||
COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- "$cur") )
|
||||
fi
|
||||
|
||||
return 0
|
||||
} &&
|
||||
complete -F _ifupdown ifup ifdown
|
||||
[ $USERLAND = GNU ] && have ifstatus && complete -F _ifupdown ifstatus
|
||||
|
||||
# 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
|
|
@ -1,532 +0,0 @@
|
|||
# bash completion for ImageMagick
|
||||
|
||||
have convert && {
|
||||
_ImageMagick()
|
||||
{
|
||||
local cur prev
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-channel)
|
||||
COMPREPLY=( $( compgen -W 'Red Green Blue Opacity \
|
||||
Matte Cyan Magenta Yellow Black' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-colormap)
|
||||
COMPREPLY=( $( compgen -W 'shared private' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-colorspace)
|
||||
COMPREPLY=( $( compgen -W 'GRAY OHTA RGB Transparent \
|
||||
XYZ YCbCr YIQ YPbPr YUV CMYK' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-compose)
|
||||
COMPREPLY=( $( compgen -W 'Over In Out Atop Xor Plus \
|
||||
Minus Add Subtract Difference Multiply Bumpmap\
|
||||
Copy CopyRed CopyGreen CopyBlue CopyOpacity' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-compress)
|
||||
COMPREPLY=( $( compgen -W 'None BZip Fax Group4 JPEG \
|
||||
Lossless LZW RLE Zip' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-dispose)
|
||||
COMPREPLY=( $( compgen -W 'Undefined None Background Previous' \
|
||||
-- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-encoding)
|
||||
COMPREPLY=( $( compgen -W 'AdobeCustom AdobeExpert \
|
||||
AdobeStandard AppleRoman BIG5 GB2312 Latin2 \
|
||||
None SJIScode Symbol Unicode Wansung' -- "$cur"))
|
||||
return 0
|
||||
;;
|
||||
-endian)
|
||||
COMPREPLY=( $( compgen -W 'MSB LSB' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-filter)
|
||||
COMPREPLY=( $( compgen -W 'Point Box Triangle Hermite \
|
||||
Hanning Hamming Blackman Gaussian Quadratic \
|
||||
Cubic Catrom Mitchell Lanczos Bessel Sinc' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-format)
|
||||
COMPREPLY=( $( compgen -W "$( convert -list format | \
|
||||
awk '/ [r-][w-][+-] / {print $1}' | \
|
||||
tr -d '*' | tr [:upper:] [:lower:] )" -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-gravity)
|
||||
COMPREPLY=( $( compgen -W 'Northwest North NorthEast \
|
||||
West Center East SouthWest South SouthEast' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-intent)
|
||||
COMPREPLY=( $( compgen -W 'Absolute Perceptual \
|
||||
Relative Saturation' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-interlace)
|
||||
COMPREPLY=( $( compgen -W 'None Line Plane Partition' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-limit)
|
||||
COMPREPLY=( $( compgen -W 'Disk File Map Memory' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-list)
|
||||
COMPREPLY=( $( compgen -W 'Delegate Format Magic Module Resource \
|
||||
Type' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-map)
|
||||
COMPREPLY=( $( compgen -W 'best default gray red green blue' \
|
||||
-- "$cur" ) )
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-noise)
|
||||
COMPREPLY=( $( compgen -W 'Uniform Gaussian Multiplicative \
|
||||
Impulse Laplacian Poisson' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-preview)
|
||||
COMPREPLY=( $( compgen -W 'Rotate Shear Roll Hue \
|
||||
Saturation Brightness Gamma Spiff \
|
||||
Dull Grayscale Quantize Despeckle \
|
||||
ReduceNoise AddNoise Sharpen Blur \
|
||||
Treshold EdgeDetect Spread Shade \
|
||||
Raise Segment Solarize Swirl Implode \
|
||||
Wave OilPaint CharcoalDrawing JPEG' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-mask|-profile|-texture|-tile|-write)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-type)
|
||||
COMPREPLY=( $( compgen -W 'Bilevel Grayscale Palette PaletteMatte \
|
||||
TrueColor TrueColorMatte ColorSeparation ColorSeparationlMatte \
|
||||
Optimize' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-units)
|
||||
COMPREPLY=( $( compgen -W 'Undefined PixelsPerInch \
|
||||
PixelsPerCentimeter' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-virtual-pixel)
|
||||
COMPREPLY=( $( compgen -W 'Constant Edge mirror tile' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-visual)
|
||||
COMPREPLY=( $( compgen -W 'StaticGray GrayScale StaticColor \
|
||||
PseudoColor TrueColor DirectColor defaut visualid' -- "$cur" ))
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_convert()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
_ImageMagick
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-adaptive-blur -adaptive-resize \
|
||||
-adaptive-sharpen -adjoin -affine -alpha -annotate \
|
||||
-antialias -append -attenuate -authenticate \
|
||||
-auto-orient -average -background -bench -bias \
|
||||
-black-point-compensation -black-threshold \
|
||||
-blue-primary -blur -border -bordercolor -caption \
|
||||
-channel -charcoal -chop -clip -clip-mask -clip-path \
|
||||
-clone -clut -coalesce -colorize -colors -colorspace \
|
||||
-combine -comment -compose -composite -compress \
|
||||
-contrast -contrast-stretch -convolve -crop -cycle \
|
||||
-debug -decipher -deconstruct -define -delay -delete \
|
||||
-density -depth -despeckle -display -dispose -distort \
|
||||
-dither -draw -edge -emboss -encipher -encoding \
|
||||
-endian -enhance -equalize -evaluate -extent -extract \
|
||||
-family -fill -filter -flatten -flip -floodfill -flop \
|
||||
-font -format -frame -fuzz -fx -gamma -gaussian-blur \
|
||||
-geometry -gravity -green-primary -help -identify \
|
||||
-implode -insert -intent -interlace -interpolate \
|
||||
-label -lat -layers -level -limit -linear-stretch \
|
||||
-liquid-rescale -list -log -loop -map -mask \
|
||||
-mattecolor -median -modulate -monitor -monochrome \
|
||||
-morph -mosaic -motion-blur -negate -noise -normalize \
|
||||
-opaque -ordered-dither -orient -page -paint -ping \
|
||||
-pointsize -polaroid -posterize -preview -print \
|
||||
-process -profile -quality -quantize -quiet \
|
||||
-radial-blur -raise -random-threshold -recolor \
|
||||
-red-primary -regard-warnings -region -render -repage \
|
||||
-resample -resize -respect-parenthesis -reverse -roll \
|
||||
-rotate -sample -sampling-factor -scale -scene -seed \
|
||||
-segment -separate -sepia-tone -set -shade -shadow \
|
||||
-sharpen -shave -shear -sigmoidal-contrast -size \
|
||||
-sketch -solarize -splice -spread -stretch -strip \
|
||||
-stroke -strokewidth -style -swap -swirl -taint \
|
||||
-texture -threshold -thumbnail -tile -tile-offset \
|
||||
-tint -transform -transparent -transparent-color \
|
||||
-transpose -transverse -treedepth -trim -type \
|
||||
-undercolor -unique-colors -units -unsharp -verbose \
|
||||
-version -view -vignette -virtual-pixel -wave \
|
||||
-weight -white-point -white-threshold \
|
||||
-write' -- "$cur" ) )
|
||||
elif [[ "$cur" == +* ]]; then
|
||||
COMPREPLY=( $( compgen -W '+adjoin +append +compress \
|
||||
+contrast +debug +dither +endian +gamma +label +map \
|
||||
+mask +matte +negate +noise +page +raise +render \
|
||||
+write' -- "$cur" ) )
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
}
|
||||
complete -F _convert convert
|
||||
|
||||
_mogrify()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
_ImageMagick
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-adaptive-blur -adaptive-resize \
|
||||
-adaptive-sharpen -adjoin -affine -alpha -annotate \
|
||||
-antialias -attenuate -authenticate -auto-orient \
|
||||
-background -bias -black-point-compensation \
|
||||
-black-threshold -blue-primary -blur -border \
|
||||
-bordercolor -caption -channel -charcoal -chop -clip \
|
||||
-clip-mask -clip-path -clut -colorize -colors \
|
||||
-colorspace -comment -compose -compress -contrast \
|
||||
-contrast-stretch -convolve -cycle -debug -decipher \
|
||||
-define -delay -density -depth -despeckle -display \
|
||||
-dispose -distort -dither -draw -edge -emboss \
|
||||
-encipher -encoding -endian -enhance -equalize \
|
||||
-evaluate -extent -extract -family -fill -filter \
|
||||
-flip -floodfill -flop -font -format -frame -fuzz \
|
||||
-gamma -gaussian-blur -geometry -gravity \
|
||||
-green-primary -help -identify -implode -intent \
|
||||
-interlace -interpolate -label -lat -layers -level \
|
||||
-limit -linear-stretch -liquid-rescale -list -log \
|
||||
-loop -mask -mattecolor -median -modulate -monitor \
|
||||
-monochrome -motion-blur -negate -noise -normalize \
|
||||
-opaque -ordered-dither -orient -page -paint -path \
|
||||
-ping -pointsize -polaroid -posterize -preview -print \
|
||||
-profile -quality -quantize -quiet -radial-blur \
|
||||
-raise -random-threshold -recolor -red-primary \
|
||||
-regard-warnings -region -render -repage -resample \
|
||||
-resize -roll -rotate -sample -sampling-factor -scale \
|
||||
-scene -seed -segment -sepia-tone -set -shade -shadow \
|
||||
-sharpen -shave -shear -sigmoidal-contrast -size \
|
||||
-sketch -solarize -splice -spread -stretch -strip \
|
||||
-stroke -strokewidth -style -swirl -taint -texture \
|
||||
-threshold -thumbnail -tile -tile-offset -tint \
|
||||
-transform -transparent -transparent-color -transpose \
|
||||
-transverse -treedepth -trim -type -undercolor \
|
||||
-unique-colors -units -unsharp -verbose -version \
|
||||
-view -vignette -virtual-pixel -wave -weight \
|
||||
-white-point -white-threshold' -- "$cur" ) )
|
||||
elif [[ "$cur" == +* ]]; then
|
||||
COMPREPLY=( $( compgen -W '+compress +contrast +debug +dither \
|
||||
+endian +gamma +label +map +mask +matte +negate +page \
|
||||
+raise' -- "$cur" ) )
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
}
|
||||
complete -F _mogrify mogrify
|
||||
|
||||
_display()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
_ImageMagick
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-alpha -antialias -authenticate \
|
||||
-auto-orient -backdrop -background -border \
|
||||
-bordercolor -borderwidth -channel -clip \
|
||||
-clip-path -coalesce -colormap -colors -colorspace \
|
||||
-comment -compress -contrast -crop -debug -decipher \
|
||||
-define -delay -density -depth -despeckle -display \
|
||||
-dispose -dither -edge -endian -enhance -extract \
|
||||
-filter -flatten -flip -flop -font -foreground \
|
||||
-format -frame -gamma -geometry -help -iconGeometry \
|
||||
-iconic -identify -immutable -interlace -interpolate \
|
||||
-label -limit -list -log -loop -map -mattecolor \
|
||||
-monitor -monochrome -name -negate -page -profile \
|
||||
-quality -quantize -quiet -raise -regard-warnings \
|
||||
-remote -repage -resample -resize \
|
||||
-respect-parenthesis -roll -rotate -sample \
|
||||
-sampling-factor -scenes -seed -segment -set \
|
||||
-shared-memory -sharpen -size -strip -texture -title \
|
||||
-transparent-color -treedepth -trim -update \
|
||||
-usePixmap -verbose -version -virtual-pixel -visual \
|
||||
-window -window-group -write' -- "$cur" ) )
|
||||
elif [[ "$cur" == +* ]]; then
|
||||
COMPREPLY=( $( compgen -W '+compress +contrast +debug +dither \
|
||||
+endian +gamma +label +map +matte +negate +page \
|
||||
+raise +write' -- "$cur" ) )
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
}
|
||||
complete -F _display display
|
||||
|
||||
_animate()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
_ImageMagick
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-alpha -authenticate -backdrop \
|
||||
-background -bordercolor -borderwidth -channel \
|
||||
-coalesce -colormap -colors -colorspace -crop -debug \
|
||||
-decipher -define -delay -density -depth -display \
|
||||
-dispose -dither -extract -filter -flatten -font \
|
||||
-foreground -format -gamma -geometry -help \
|
||||
-iconGeometry -iconic -identify -immutable -interlace \
|
||||
-interpolate -limit -list -log -loop -map -mattecolor \
|
||||
-mattecolor -monitor -monochrome -name -page -pause \
|
||||
-quantize -quiet -regard-warnings -remote -repage \
|
||||
-resample -resize -respect-parenthesis -rotate \
|
||||
-sampling-factor -scenes -seed -set -shared-memory \
|
||||
-size -strip -title -transparent-color -treedepth \
|
||||
-trim -verbose -version -virtual-pixel -visual \
|
||||
-window' -- "$cur" ) )
|
||||
elif [[ "$cur" == +* ]]; then
|
||||
COMPREPLY=( $( compgen -W '+debug +dither +gamma +map +matte' \
|
||||
-- "$cur" ) )
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
}
|
||||
complete -F _animate animate
|
||||
|
||||
_identify()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
_ImageMagick
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-alpha -antialias -authenticate \
|
||||
-channel -colorspace -crop -debug -define -density \
|
||||
-depth -extract -format -fuzz -gamma -help -interlace \
|
||||
-interpolate -limit -list -log -monitor -ping -quiet \
|
||||
-regard-warnings -respect-parenthesis \
|
||||
-sampling-factor -seed -set -size -strip -units \
|
||||
-verbose -version -virtual-pixel' -- "$cur" ) )
|
||||
elif [[ "$cur" == +* ]]; then
|
||||
COMPREPLY=( $( compgen -W '+debug' -- "$cur" ) )
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
}
|
||||
complete -F _identify identify
|
||||
|
||||
_montage()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
_ImageMagick
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-adjoin -affine -alpha \
|
||||
-authenticate -background -blue-primary -blur -border \
|
||||
-bordercolor -borderwidth -caption -channel -clone \
|
||||
-coalesce -colors -colorspace -comment -compose \
|
||||
-compress -crop -debug -define -density -depth \
|
||||
-display -dispose -dither -draw -encoding -endian \
|
||||
-extract -fill -filter -flatten -flip -flop -font \
|
||||
-format -frame -gamma -geometry -gravity \
|
||||
-green-primary -help -identify -interlace \
|
||||
-interpolate -label -limit -list -log -mattecolor \
|
||||
-mode -monitor -monochrome -origin -page -pointsize \
|
||||
-polaroid -profile -quality -quantize -quiet \
|
||||
-red-primary -regard-warnings -repage -resize \
|
||||
-respect-parenthesis -rotate -sampling-factor -scenes \
|
||||
-seed -set -shadow -size -strip -stroke -texture \
|
||||
-thumbnail -tile -title -transform -transparent \
|
||||
-transparent-color -treedepth -trim -type -units \
|
||||
-verbose -version -virtual-pixel \
|
||||
-white-point' -- "$cur" ) )
|
||||
elif [[ "$cur" == +* ]]; then
|
||||
COMPREPLY=( $( compgen -W '+adjoin +compress +debug +dither \
|
||||
+endian +gamma +label +matte +page' -- "$cur" ) )
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
}
|
||||
complete -F _montage montage
|
||||
|
||||
_composite()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
_ImageMagick
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-affine -alpha -authenticate \
|
||||
-blend -blue-primary -border -bordercolor -channel \
|
||||
-colors -colorspace -comment -compose -compress \
|
||||
-debug -decipher -define -density -depth -displace \
|
||||
-display -dispose -dissolve -dither -encipher \
|
||||
-encoding -endian -extract -filter -font -format \
|
||||
-geometry -gravity -green-primary -help -identify \
|
||||
-interlace -interpolate -label -limit -list -log \
|
||||
-monitor -monochrome -negate -page -profile -quality \
|
||||
-quantize -quiet -red-primary -regard-warnings \
|
||||
-repage -resize -respect-parenthesis -rotate \
|
||||
-sampling-factor -scene -seed -sharpen -shave -size \
|
||||
-stegano -stereo -strip -swap -thumbnail -tile \
|
||||
-transform -transparent-color -treedepth -type -units \
|
||||
-unsharp -verbose -version -virtual-pixel -watermark \
|
||||
-white-point -write' -- "$cur" ) )
|
||||
elif [[ "$cur" == +* ]]; then
|
||||
COMPREPLY=( $( compgen -W '+compress +debug +dither +endian +label \
|
||||
+matte +negate +page +write' -- "$cur" ) )
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
}
|
||||
complete -F _composite composite
|
||||
|
||||
_compare()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
_ImageMagick
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-alpha -authenticate -channel \
|
||||
-colorspace -compress -debug -decipher -define \
|
||||
-density -depth -encipher -extract -format -fuzz \
|
||||
-help -highlight-color -identify -interlace -limit \
|
||||
-list -log -metric -monitor -passphrase -profile \
|
||||
-quality -quantize -quiet -regard-warnings \
|
||||
-respect-parenthesis -sampling-factor -seed -set \
|
||||
-size -transparent-color -type -verbose -version \
|
||||
-virtual-pixel' -- "$cur" ) )
|
||||
elif [[ "$cur" == +* ]]; then
|
||||
COMPREPLY=( $( compgen -W '+debug' -- "$cur" ) )
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
}
|
||||
complete -F _compare compare
|
||||
|
||||
_conjure()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
_ImageMagick
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-debug -help -list -log -monitor -quiet \
|
||||
-regard-warnings -seed -verbose -version' -- "$cur" ) )
|
||||
elif [[ "$cur" == +* ]]; then
|
||||
COMPREPLY=( $( compgen -W '+debug' -- "$cur" ) )
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
}
|
||||
complete -F _conjure conjure
|
||||
|
||||
_import()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
_ImageMagick
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-adjoin -annotate -border -channel \
|
||||
-colors -colorspace -comment -compress -crop -debug \
|
||||
-define -delay -density -depth -descend -display \
|
||||
-dispose -dither -encipher -encoding -endian -filter \
|
||||
-format -frame -geometry -gravity -help -identify \
|
||||
-interlace -interpolate -label -limit -list -log \
|
||||
-monitor -monochrome -negate -page -pause -pointsize \
|
||||
-quality -quantize -quiet -regard-warnings -repage \
|
||||
-resize -respect-parenthesis -rotate -sampling-factor \
|
||||
-scene -screen -seed -set -silent -snaps -strip \
|
||||
-thumbnail -transparent -transparent-color -treedepth \
|
||||
-trim -type -verbose -version -virtual-pixel \
|
||||
-window' -- "$cur" ) )
|
||||
elif [[ "$cur" == +* ]]; then
|
||||
COMPREPLY=( $( compgen -W '+debug' -- "$cur" ) )
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
}
|
||||
complete -F _import import
|
||||
|
||||
_stream()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
_ImageMagick
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-authenticate -channel -colorspace \
|
||||
-compress -debug -define -density -depth -extract \
|
||||
-help -identify -interlace -interpolate -limit -list \
|
||||
-log -map -monitor -quantize -quiet -regard-warnings \
|
||||
-respect-parenthesis -sampling-factor -seed -set \
|
||||
-size -storage-type -transparent-color -verbose \
|
||||
-version -virtual-pixel' -- "$cur" ) )
|
||||
elif [[ "$cur" == +* ]]; then
|
||||
COMPREPLY=( $( compgen -W '+debug' -- "$cur" ) )
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
}
|
||||
complete -F _stream stream
|
||||
}
|
||||
|
||||
# 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
|
|
@ -1,58 +0,0 @@
|
|||
# bash completion for info
|
||||
|
||||
have info &&
|
||||
_info()
|
||||
{
|
||||
local cur i infopath
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
_expand || return 0
|
||||
|
||||
# default completion if parameter contains /
|
||||
if [[ "$cur" == */* ]]; then
|
||||
_filedir
|
||||
return 0
|
||||
fi
|
||||
|
||||
infopath='/usr/share/info'
|
||||
|
||||
if [ "${INFOPATH: -1:1}" == ':' ]; then
|
||||
infopath=${INFOPATH}${infopath}
|
||||
elif [ ${INFOPATH:+set} ]; then
|
||||
infopath=$INFOPATH
|
||||
fi
|
||||
|
||||
infopath=$infopath:
|
||||
if [ -n "$cur" ]; then
|
||||
infopath="${infopath//://$cur* }"
|
||||
else
|
||||
infopath="${infopath//:// }"
|
||||
fi
|
||||
|
||||
# redirect stderr for when path doesn't exist
|
||||
COMPREPLY=( $( eval command ls "$infopath" 2>/dev/null ) )
|
||||
# weed out directory path names and paths to info pages
|
||||
COMPREPLY=( ${COMPREPLY[@]##*/?(:)} )
|
||||
# weed out info dir file
|
||||
for (( i=0 ; i < ${#COMPREPLY[@]} ; ++i )); do
|
||||
if [ "${COMPREPLY[$i]}" == 'dir' ]; then
|
||||
unset COMPREPLY[$i];
|
||||
fi;
|
||||
done
|
||||
# strip suffix from info pages
|
||||
COMPREPLY=( ${COMPREPLY[@]%.@(gz|bz2|xz|lzma)} )
|
||||
COMPREPLY=( $( compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}" ) )
|
||||
|
||||
return 0
|
||||
} &&
|
||||
complete -F _info info
|
||||
|
||||
# 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
|
|
@ -1,214 +0,0 @@
|
|||
# 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 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
|
|
@ -1,285 +0,0 @@
|
|||
# iproute2 tools completion
|
||||
|
||||
have ip &&
|
||||
_ip()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur prev words cword
|
||||
_get_comp_words_by_ref cur prev words cword
|
||||
|
||||
case $prev in
|
||||
-V|-Version|-rc|-rcvbuf)
|
||||
return 0
|
||||
;;
|
||||
-f|-family)
|
||||
COMPREPLY=( $( compgen -W 'inet inet6 ipx dnet link' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-b|-batch)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-force)
|
||||
COMPREPLY=( $( compgen -W '-batch' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
local subcword cmd subcmd
|
||||
for (( subcword=1; subcword < ${#words[@]}-1; subcword++ )); do
|
||||
[[ ${words[subcword]} == -b?(atch) ]] && return 0
|
||||
[[ -n $cmd ]] && subcmd=${words[subcword]} && break
|
||||
[[ ${words[subcword]} != -* && \
|
||||
${words[subcword-1]} != -@(f?(amily)|rc?(vbuf)) ]] && \
|
||||
cmd=${words[subcword]}
|
||||
done
|
||||
|
||||
if [[ -z $cmd ]]; then
|
||||
case $cur in
|
||||
-*)
|
||||
local c="-Version -statistics -details -resolve -family
|
||||
-oneline -timestamp -batch -rcvbuf"
|
||||
[[ $cword -eq 1 ]] && c="$c -force"
|
||||
COMPREPLY=( $( compgen -W "$c" -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=( $( compgen -W "help $( ip help 2>&1 | \
|
||||
sed -e '/OBJECT := /,/}/!d' \
|
||||
-e 's/.*{//' -e 's/}.*//' -e 's/|//g' )" -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
[[ $subcmd == help ]] && return 0
|
||||
|
||||
case $cmd in
|
||||
link)
|
||||
case $subcmd in
|
||||
add)
|
||||
# TODO
|
||||
;;
|
||||
delete)
|
||||
case $(($cword-$subcword)) in
|
||||
1)
|
||||
_available_interfaces
|
||||
;;
|
||||
2)
|
||||
COMPREPLY=( $( compgen -W 'type' -- "$cur" ) )
|
||||
;;
|
||||
3)
|
||||
[[ $prev == type ]] && \
|
||||
COMPREPLY=( $( compgen -W 'vlan veth vcan dummy
|
||||
ifb macvlan can' -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
set)
|
||||
if [[ $cword-$subcword -eq 1 ]]; then
|
||||
_available_interfaces
|
||||
else
|
||||
case $prev in
|
||||
arp|dynamic|multicast|allmulticast|promisc|\
|
||||
trailers)
|
||||
COMPREPLY=( $( compgen -W 'on off' \
|
||||
-- "$cur" ) )
|
||||
;;
|
||||
txqueuelen|name|address|broadcast|mtu|netns|alias)
|
||||
;;
|
||||
*)
|
||||
local c="arp dynamic multicast allmulticast
|
||||
promisc trailers txqueuelen name address
|
||||
broadcast mtu netns alias"
|
||||
[[ $prev != @(up|down) ]] && c="$c up down"
|
||||
COMPREPLY=( $( compgen -W "$c" -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
show)
|
||||
[[ $cword -eq $subcword+1 ]] && _available_interfaces
|
||||
;;
|
||||
*)
|
||||
[[ $cword -eq $subcword ]] && \
|
||||
COMPREPLY=( $( compgen -W 'help add delete set show' \
|
||||
-- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
addr)
|
||||
case $subcmd in
|
||||
add|change|replace)
|
||||
# TODO
|
||||
;;
|
||||
del)
|
||||
# TODO
|
||||
;;
|
||||
show|flush)
|
||||
# TODO
|
||||
;;
|
||||
*)
|
||||
[[ $cword -eq $subcword ]] && \
|
||||
COMPREPLY=( $( compgen -W 'help add change replace del
|
||||
show flush' -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
addrlabel)
|
||||
case $subcmd in
|
||||
list|add|del|flush)
|
||||
# TODO
|
||||
;;
|
||||
*)
|
||||
[[ $cword -eq $subcword ]] && \
|
||||
COMPREPLY=( $( compgen -W 'help list add del flush' \
|
||||
-- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
route)
|
||||
case $subcmd in
|
||||
list|flush)
|
||||
# TODO
|
||||
;;
|
||||
get)
|
||||
# TODO
|
||||
;;
|
||||
add|del|change|append|replace|monitor)
|
||||
# TODO
|
||||
;;
|
||||
*)
|
||||
[[ $cword -eq $subcword ]] && \
|
||||
COMPREPLY=( $( compgen -W 'help list flush get add del
|
||||
change append replace monitor' -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
rule)
|
||||
case $subcmd in
|
||||
list|add|del|flush)
|
||||
# TODO
|
||||
;;
|
||||
*)
|
||||
[[ $cword -eq $subcword ]] && \
|
||||
COMPREPLY=( $( compgen -W 'help list add del flush' \
|
||||
-- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
neigh)
|
||||
case $subcmd in
|
||||
add|del|change|replace)
|
||||
# TODO
|
||||
;;
|
||||
show|flush)
|
||||
# TODO
|
||||
;;
|
||||
*)
|
||||
[[ $cword -eq $subcword ]] && \
|
||||
COMPREPLY=( $( compgen -W 'help add del change replace
|
||||
show flush' -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
ntable)
|
||||
case $subcmd in
|
||||
change)
|
||||
# TODO
|
||||
;;
|
||||
show)
|
||||
# TODO
|
||||
;;
|
||||
*)
|
||||
[[ $cword -eq $subcword ]] && \
|
||||
COMPREPLY=( $( compgen -W 'help change show' \
|
||||
-- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
tunnel)
|
||||
case $subcmd in
|
||||
add|change|del|show|prl|6rd)
|
||||
# TODO
|
||||
;;
|
||||
*)
|
||||
[[ $cword -eq $subcword ]] && \
|
||||
COMPREPLY=( $( compgen -W 'help add change del show prl
|
||||
6rd' -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
maddr)
|
||||
case $subcmd in
|
||||
add|del)
|
||||
# TODO
|
||||
;;
|
||||
show)
|
||||
if [[ $cword -eq $subcword+1 || $prev == dev ]]; then
|
||||
_available_interfaces
|
||||
[[ $prev != dev ]] && \
|
||||
COMPREPLY=( $( compgen -W '${COMPREPLY[@]} dev' \
|
||||
-- "$cur" ) )
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
[[ $cword -eq $subcword ]] && \
|
||||
COMPREPLY=( $( compgen -W 'help add del show' \
|
||||
-- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
mroute)
|
||||
case $subcmd in
|
||||
show)
|
||||
# TODO
|
||||
;;
|
||||
*)
|
||||
[[ $cword -eq $subcword ]] && \
|
||||
COMPREPLY=( $( compgen -W 'help show' -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
monitor)
|
||||
case $subcmd in
|
||||
all) ;;
|
||||
*)
|
||||
[[ $cword -eq $subcword ]] && \
|
||||
COMPREPLY=( $( compgen -W 'help all' -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
||||
xfrm)
|
||||
case $subcmd in
|
||||
state|policy|monitor)
|
||||
# TODO
|
||||
;;
|
||||
*)
|
||||
[[ $cword -eq $subcword ]] && \
|
||||
COMPREPLY=( $( compgen -W 'state policy monitor' \
|
||||
-- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
} &&
|
||||
complete -F _ip ip
|
||||
|
||||
# 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
|
|
@ -1,51 +0,0 @@
|
|||
# Linux ipsec(8) completion (for FreeS/WAN)
|
||||
#
|
||||
[ $UNAME = Linux ] && have ipsec &&
|
||||
_ipsec()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
|
||||
if [ $COMP_CWORD -eq 1 ]; then
|
||||
COMPREPLY=( $( compgen -W 'auto barf eroute klipsdebug look manual \
|
||||
pluto ranbits rsasigkey setup showdefaults showhostkey spi spigrp \
|
||||
tncfg whack' -- "$cur" ) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
case ${COMP_WORDS[1]} in
|
||||
auto)
|
||||
COMPREPLY=( $( compgen -W '--asynchronous --up --add --delete \
|
||||
--replace --down --route --unroute \
|
||||
--ready --status --rereadsecrets' \
|
||||
-- "$cur" ) )
|
||||
;;
|
||||
manual)
|
||||
COMPREPLY=( $( compgen -W '--up --down --route --unroute \
|
||||
--union' -- "$cur" ) )
|
||||
;;
|
||||
ranbits)
|
||||
COMPREPLY=( $( compgen -W '--quick --continuous --bytes' \
|
||||
-- "$cur" ) )
|
||||
;;
|
||||
setup)
|
||||
COMPREPLY=( $( compgen -W '--start --stop --restart' -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
return 0
|
||||
} &&
|
||||
complete -F _ipsec ipsec
|
||||
|
||||
# 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
|
|
@ -1,70 +0,0 @@
|
|||
# bash completion for iptables
|
||||
|
||||
have iptables &&
|
||||
_iptables()
|
||||
{
|
||||
local cur prev table chain
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
chain='s/^Chain \([^ ]\{1,\}\).*$/\1/p'
|
||||
|
||||
if [[ $COMP_LINE == *-t\ *filter* ]]; then
|
||||
table="-t filter"
|
||||
elif [[ $COMP_LINE == *-t\ *nat* ]]; then
|
||||
table="-t nat"
|
||||
elif [[ $COMP_LINE == *-t\ *mangle* ]]; then
|
||||
table="-t mangle"
|
||||
fi
|
||||
|
||||
_split_longopt
|
||||
|
||||
case $prev in
|
||||
-*[AIDRPFXLZ])
|
||||
COMPREPLY=( $( compgen -W '`iptables $table -nL | \
|
||||
sed -ne "s/^Chain \([^ ]\{1,\}\).*$/\1/p"`' -- "$cur" ) )
|
||||
;;
|
||||
-*t)
|
||||
COMPREPLY=( $( compgen -W 'nat filter mangle' -- "$cur" ) )
|
||||
;;
|
||||
-j)
|
||||
if [[ "$table" == "-t filter" || -z "$table" ]]; then
|
||||
COMPREPLY=( $( compgen -W 'ACCEPT DROP LOG ULOG REJECT \
|
||||
`iptables $table -nL | sed -ne "$chain" \
|
||||
-e "s/INPUT|OUTPUT|FORWARD|PREROUTING|POSTROUTING//"`' -- \
|
||||
"$cur" ) )
|
||||
elif [ "$table" = "-t nat" ]; then
|
||||
COMPREPLY=( $( compgen -W 'ACCEPT DROP LOG ULOG REJECT \
|
||||
MIRROR SNAT DNAT MASQUERADE `iptables $table -nL | \
|
||||
sed -ne "$chain" -e "s/OUTPUT|PREROUTING|POSTROUTING//"`' \
|
||||
-- "$cur" ) )
|
||||
elif [ "$table" = "-t mangle" ]; then
|
||||
COMPREPLY=( $( compgen -W 'ACCEPT DROP LOG ULOG REJECT \
|
||||
MARK TOS `iptables $table -nL | sed -ne "$chain" \
|
||||
-e "s/INPUT|OUTPUT|FORWARD|PREROUTING|POSTROUTING//"`' -- \
|
||||
"$cur" ) )
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--in-interface --out-interface --source \
|
||||
--destination --protocol --fragment --match --append \
|
||||
--delete --insert --replace --list --flush --zero --new \
|
||||
--delete-chain --policy --rename-chain --proto --source \
|
||||
--destination --in-interface --jump --match --numeric \
|
||||
--out-interface --table --verbose --line-numbers --exact \
|
||||
--fragment --modprobe --set-counters --version' -- "$cur") )
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
} &&
|
||||
complete -F _iptables iptables
|
||||
|
||||
# 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
|
|
@ -1,57 +0,0 @@
|
|||
have ipv6calc &&
|
||||
_ipv6calc()
|
||||
{
|
||||
local cur prev split=false
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref -n = cur prev
|
||||
#cur=`_get_cword =`
|
||||
#prev=`_get_pword`
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
case "$prev" in
|
||||
-d|--debug)
|
||||
return 0
|
||||
;;
|
||||
-I|--in|-O|--out|-A|--action)
|
||||
# With ipv6calc < 0.73.0, -m does nothing here, so use sed instead.
|
||||
COMPREPLY=( $( compgen -W "$( ipv6calc "$prev" -h 2>&1 | \
|
||||
sed -ne 's/^[[:space:]]\{1,\}\([^[:space:]:]\{1,\}\)[[:space:]]*:.*/\1/p' )" \
|
||||
-- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
--db-geoip|--db-ip2location-ipv4|--db-ip2location-ipv6)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
--printstart|--printend)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
$split && return 0
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--help --debug --quiet --in \
|
||||
--out --action --examples --showinfo --show_types \
|
||||
--machine_readable --db-geoip --db-geoip-default \
|
||||
--db-ip2location-ipv4 --db-ip2location-ipv6 \
|
||||
--lowercase --uppercase --printprefix --printsuffix \
|
||||
--maskprefix --masksuffix --printstart --printend \
|
||||
--printcompressed --printuncompressed \
|
||||
--printfulluncompressed --printmirrored' -- "$cur" ) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
return 0
|
||||
} &&
|
||||
complete -F _ipv6calc ipv6calc
|
||||
|
||||
# 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
|
|
@ -1,20 +0,0 @@
|
|||
# isql completion by Victor Bogado da Silva Lins <victor@bogado.net>
|
||||
|
||||
have isql &&
|
||||
_isql()
|
||||
{
|
||||
local cur
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
[ -f "$ODBCINI" ] \
|
||||
&& COMPREPLY=( $( command grep \\["$cur" "$ODBCINI" | tr -d \\[\\] ) )
|
||||
} &&
|
||||
complete -F _isql isql
|
||||
|
||||
# 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
|
|
@ -1,36 +0,0 @@
|
|||
# jar(1) completion
|
||||
|
||||
have jar &&
|
||||
_jar()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [ $COMP_CWORD = 1 ]; then
|
||||
COMPREPLY=( $( compgen -W 'c t x u' -- "$cur" ) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
case ${COMP_WORDS[1]} in
|
||||
*c*f)
|
||||
_filedir
|
||||
;;
|
||||
*f)
|
||||
_filedir '@([ejw]ar|zip|apk)'
|
||||
;;
|
||||
*)
|
||||
_filedir
|
||||
;;
|
||||
esac
|
||||
} &&
|
||||
complete -F _jar jar
|
||||
|
||||
# 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
|
|
@ -1,533 +0,0 @@
|
|||
# bash completion for java, javac and javadoc
|
||||
|
||||
# available path elements completion
|
||||
have java || have javac || have javadoc &&
|
||||
_java_path()
|
||||
{
|
||||
cur=${cur##*:}
|
||||
_filedir '@(jar|zip)'
|
||||
}
|
||||
|
||||
have java || have javadoc && {
|
||||
# exact classpath determination
|
||||
_java_find_classpath()
|
||||
{
|
||||
local i
|
||||
|
||||
# search first in current options
|
||||
for (( i=1; i < COMP_CWORD; i++ )); do
|
||||
if [[ "${COMP_WORDS[i]}" == -@(cp|classpath) ]]; then
|
||||
classpath=${COMP_WORDS[i+1]}
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# default to environment
|
||||
[ -z "$classpath" ] && classpath=$CLASSPATH
|
||||
|
||||
# default to current directory
|
||||
[ -z "$classpath" ] && classpath=.
|
||||
}
|
||||
|
||||
# exact sourcepath determination
|
||||
_java_find_sourcepath()
|
||||
{
|
||||
local i
|
||||
|
||||
# search first in current options
|
||||
for (( i=1; i < COMP_CWORD; i++ )); do
|
||||
if [[ "${COMP_WORDS[i]}" == -sourcepath ]]; then
|
||||
sourcepath=${COMP_WORDS[i+1]}
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# default to classpath
|
||||
if [ -z "$sourcepath" ]; then
|
||||
_java_find_classpath
|
||||
sourcepath=$classpath
|
||||
fi
|
||||
}
|
||||
|
||||
# available classes completion
|
||||
_java_classes()
|
||||
{
|
||||
local classpath i
|
||||
|
||||
# find which classpath to use
|
||||
_java_find_classpath
|
||||
|
||||
# convert package syntax to path syntax
|
||||
cur=${cur//.//}
|
||||
# parse each classpath element for classes
|
||||
for i in ${classpath//:/ }; do
|
||||
if [[ "$i" == *.@(jar|zip) && -r $i ]]; then
|
||||
if type zipinfo &>/dev/null; then
|
||||
COMPREPLY=( "${COMPREPLY[@]}" $( zipinfo -1 \
|
||||
"$i" "$cur*" 2>/dev/null | \
|
||||
command grep '^[^$]*\.class$' ) )
|
||||
else
|
||||
COMPREPLY=( "${COMPREPLY[@]}" $( jar tf "$i" \
|
||||
"$cur" | command grep '^[^$]*\.class$' ) )
|
||||
fi
|
||||
|
||||
elif [ -d $i ]; then
|
||||
# Intentionally looking for *.class only in $i (not subdirs),
|
||||
# see Debian bug #496828.
|
||||
COMPREPLY=( "${COMPREPLY[@]}"
|
||||
$( command ls $i/$cur*.class 2>/dev/null | \
|
||||
sed -ne '/\$/d' -e "s|^$i//*||p" ) )
|
||||
|
||||
# FIXME: if we have foo.class and foo/, the completion
|
||||
# returns "foo/"... how to give precedence to files
|
||||
# over directories?
|
||||
fi
|
||||
done
|
||||
|
||||
# remove class extension
|
||||
COMPREPLY=( ${COMPREPLY[@]%.class} )
|
||||
# convert path syntax to package syntax
|
||||
COMPREPLY=( ${COMPREPLY[@]//\//.} )
|
||||
}
|
||||
|
||||
# available packages completion
|
||||
_java_packages()
|
||||
{
|
||||
local sourcepath i
|
||||
|
||||
# find which sourcepath to use
|
||||
_java_find_sourcepath
|
||||
|
||||
# convert package syntax to path syntax
|
||||
cur=${cur//.//}
|
||||
# parse each sourcepath element for packages
|
||||
for i in ${sourcepath//:/ }; do
|
||||
if [ -d $i ]; then
|
||||
COMPREPLY=( "${COMPREPLY[@]}" $( command ls -F -d \
|
||||
$i/$cur* 2>/dev/null | sed -e 's|^'$i'/||' ) )
|
||||
fi
|
||||
done
|
||||
# keep only packages
|
||||
COMPREPLY=( $( tr " " "\n" <<<"${COMPREPLY[@]}" | command grep "/$" ) )
|
||||
# remove packages extension
|
||||
COMPREPLY=( ${COMPREPLY[@]%/} )
|
||||
# convert path syntax to package syntax
|
||||
cur=${COMPREPLY[@]//\//.}
|
||||
}
|
||||
}
|
||||
|
||||
# java completion
|
||||
#
|
||||
have java &&
|
||||
_java()
|
||||
{
|
||||
local cur prev words cword i
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref -n : cur prev words cword
|
||||
|
||||
for ((i=1; i < $cword; i++)); do
|
||||
case ${words[$i]} in
|
||||
-cp|-classpath)
|
||||
((i++)) # skip the classpath string.
|
||||
;;
|
||||
-*)
|
||||
# this is an option, not a class/jarfile name.
|
||||
;;
|
||||
*)
|
||||
# once we've seen a class, just do filename completion
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
case $cur in
|
||||
# standard option completions
|
||||
-verbose:*)
|
||||
COMPREPLY=( $( compgen -W 'class gc jni' -- "${cur#*:}" ) )
|
||||
return 0
|
||||
;;
|
||||
-javaagent:*)
|
||||
cur=${cur#*:}
|
||||
_filedir '@(jar|zip)'
|
||||
return 0
|
||||
;;
|
||||
-agentpath:*)
|
||||
cur=${cur#*:}
|
||||
_filedir so
|
||||
return 0
|
||||
;;
|
||||
# various non-standard option completions
|
||||
-splash:*)
|
||||
cur=${cur#*:}
|
||||
_filedir '@(gif|jp?(e)g|png)'
|
||||
return 0
|
||||
;;
|
||||
-Xbootclasspath*:*)
|
||||
_java_path
|
||||
return 0
|
||||
;;
|
||||
-Xcheck:*)
|
||||
COMPREPLY=( $( compgen -W 'jni' -- "${cur#*:}" ) )
|
||||
return 0
|
||||
;;
|
||||
-Xgc:*)
|
||||
COMPREPLY=( $( compgen -W 'singlecon gencon singlepar genpar' \
|
||||
-- "${cur#*:}" ) )
|
||||
return 0
|
||||
;;
|
||||
-Xgcprio:*)
|
||||
COMPREPLY=( $( compgen -W 'throughput pausetime deterministic' \
|
||||
-- "${cur#*:}" ) )
|
||||
return 0
|
||||
;;
|
||||
-Xloggc:*|-Xverboselog:*)
|
||||
cur=${cur#*:}
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-Xshare:*)
|
||||
COMPREPLY=( $( compgen -W 'auto off on' -- "${cur#*:}" ) )
|
||||
return 0
|
||||
;;
|
||||
-Xverbose:*)
|
||||
COMPREPLY=( $( compgen -W 'memory load jni cpuinfo codegen opt
|
||||
gcpause gcreport' -- "${cur#*:}" ) )
|
||||
return 0
|
||||
;;
|
||||
-Xverify:*)
|
||||
COMPREPLY=( $( compgen -W 'all none remote' -- "${cur#*:}" ) )
|
||||
return 0
|
||||
;;
|
||||
# the rest that we have no completions for
|
||||
-D*|-*:*)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
case $prev in
|
||||
-cp|-classpath)
|
||||
_java_path
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
# standard options
|
||||
COMPREPLY=( $( compgen -W '-client -server -agentlib: -agentpath:
|
||||
-classpath -D -d32 -d64 -enableassertions -disableassertions
|
||||
-enablesystemassertions -disablesystemassertions -jar -javaagent:
|
||||
-verbose -verbose -version -showversion -help -X' -- "$cur" ) )
|
||||
else
|
||||
if [[ "$prev" == -jar ]]; then
|
||||
# jar file completion
|
||||
_filedir jar
|
||||
else
|
||||
# classes completion
|
||||
_java_classes
|
||||
fi
|
||||
fi
|
||||
|
||||
[[ ${#COMPREPLY[@]} -eq 1 && ${COMPREPLY[0]} == -*[:=] ]] && \
|
||||
type compopt &>/dev/null && compopt -o nospace
|
||||
|
||||
__ltrim_colon_completions "$cur"
|
||||
} &&
|
||||
complete -F _java java
|
||||
|
||||
have javadoc &&
|
||||
_javadoc()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur prev classpath
|
||||
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-overview|-helpfile)
|
||||
_filedir '?(x)htm?(l)'
|
||||
return 0
|
||||
;;
|
||||
-stylesheetfile)
|
||||
_filedir css
|
||||
return 0
|
||||
;;
|
||||
-d|-link|-linkoffline)
|
||||
# TODO: -linkoffline takes two arguments
|
||||
_filedir -d
|
||||
return 0
|
||||
;;
|
||||
-classpath|-bootclasspath|-docletpath|-sourcepath|-extdirs)
|
||||
_java_path
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
# relevant options completion
|
||||
COMPREPLY=( $( compgen -W '-overview -public -protected \
|
||||
-package -private -help -doclet -docletpath \
|
||||
-sourcepath -classpath -exclude -subpackages \
|
||||
-breakiterator -bootclasspath -source -extdirs \
|
||||
-verbose -locale -encoding -J -d -use -version \
|
||||
-author -docfilessubdirs -splitindex \
|
||||
-windowtitle -doctitle -header -footer -bottom \
|
||||
-link -linkoffline -excludedocfilessubdir \
|
||||
-group -nocomment -nodeprecated -noqualifier \
|
||||
-nosince -nodeprecatedlist -notree -noindex \
|
||||
-nohelp -nonavbar -quiet -serialwarn -tag \
|
||||
-taglet -tagletpath -charset -helpfile \
|
||||
-linksource -stylesheetfile -docencoding' -- "$cur" ) )
|
||||
else
|
||||
# source files completion
|
||||
_filedir java
|
||||
# packages completion
|
||||
_java_packages
|
||||
fi
|
||||
} &&
|
||||
complete -F _javadoc javadoc
|
||||
|
||||
have javac &&
|
||||
_javac()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur prev
|
||||
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-d)
|
||||
_filedir -d
|
||||
return 0
|
||||
;;
|
||||
-classpath|-bootclasspath|-sourcepath|-extdirs)
|
||||
_java_path
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
# relevant options completion
|
||||
COMPREPLY=( $( compgen -W '-g -g:none -g:lines -g:vars \
|
||||
-g:source -O -nowarn -verbose -deprecation -classpath \
|
||||
-sourcepath -bootclasspath -extdirs -d -encoding -source \
|
||||
-target -help' -- "$cur" ) )
|
||||
else
|
||||
# source files completion
|
||||
_filedir java
|
||||
fi
|
||||
} &&
|
||||
complete -F _javac javac
|
||||
|
||||
have pack200 &&
|
||||
_pack200()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur prev
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-S|--segment-limit|-P|--pass-file|-C|--class-attribute|\
|
||||
-F|--field-attribute|-M|--method-attribute|-D|--code-attribute|\
|
||||
'-?'|-h|--help|-V|--version|-J)
|
||||
return 0
|
||||
;;
|
||||
-E|--effort)
|
||||
COMPREPLY=( $( compgen -W '0 1 2 3 4 5 6 7 8 9' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-H|--deflate-hint)
|
||||
COMPREPLY=( $( compgen -W 'true false keep' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-m|--modification-time)
|
||||
COMPREPLY=( $( compgen -W 'latest keep' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-U|--unknown-attribute)
|
||||
COMPREPLY=( $( compgen -W 'error strip pass' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-f|--config-file)
|
||||
_filedir properties
|
||||
return 0
|
||||
;;
|
||||
-l|--log-file)
|
||||
COMPREPLY=( $( compgen -W '-' -- "$cur" ) )
|
||||
_filedir log
|
||||
return 0
|
||||
;;
|
||||
-r|--repack)
|
||||
_filedir jar
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
# Check if a pack or a jar was already given.
|
||||
local i pack=false jar=false
|
||||
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )) ; do
|
||||
case ${COMP_WORDS[i]} in
|
||||
*.pack|*.pack.gz) pack=true ;;
|
||||
*.jar) jar=true ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if ! $pack ; then
|
||||
if [[ "$cur" == -* ]] ; then
|
||||
COMPREPLY=( $( compgen -W '--no-gzip --gzip --strip-debug \
|
||||
--no-keep-file-order --segment-limit= --effort= \
|
||||
--deflate-hint= --modification-time= --pass-file= \
|
||||
--unknown-attribute= --class-attribute= --field-attribute= \
|
||||
--method-attribute= --code-attribute= --config-file= \
|
||||
--verbose --quiet --log-file= --help --version -J \
|
||||
--repack' -- "$cur" ) )
|
||||
[[ ${#COMPREPLY[@]} -eq 1 && ${COMPREPLY[0]} == *= ]] && \
|
||||
type compopt &>/dev/null && compopt -o nospace
|
||||
else
|
||||
_filedir 'pack?(.gz)'
|
||||
fi
|
||||
elif ! $jar ; then
|
||||
_filedir jar
|
||||
fi
|
||||
} &&
|
||||
complete -F _pack200 pack200
|
||||
|
||||
have unpack200 &&
|
||||
_unpack200()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur prev
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
'-?'|-h|--help|-V|--version|-J)
|
||||
return 0
|
||||
;;
|
||||
-H|--deflate-hint)
|
||||
COMPREPLY=( $( compgen -W 'true false keep' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-l|--log-file)
|
||||
COMPREPLY=( $( compgen -W '-' -- "$cur" ) )
|
||||
_filedir log
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
# Check if a pack or a jar was already given.
|
||||
local i pack=false jar=false
|
||||
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )) ; do
|
||||
case ${COMP_WORDS[i]} in
|
||||
*.pack|*.pack.gz) pack=true ;;
|
||||
*.jar) jar=true ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if ! $pack ; then
|
||||
if [[ "$cur" == -* ]] ; then
|
||||
COMPREPLY=( $( compgen -W '--deflate-hint= --remove-pack-file \
|
||||
--verbose --quiet --log-file= --help --version' -- "$cur" ) )
|
||||
[[ ${#COMPREPLY[@]} -eq 1 && ${COMPREPLY[0]} == *= ]] && \
|
||||
type compopt &>/dev/null && compopt -o nospace
|
||||
else
|
||||
_filedir 'pack?(.gz)'
|
||||
fi
|
||||
elif ! $jar ; then
|
||||
_filedir jar
|
||||
fi
|
||||
} &&
|
||||
complete -F _unpack200 unpack200
|
||||
|
||||
have jarsigner &&
|
||||
_jarsigner()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur prev
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-keystore)
|
||||
COMPREPLY=( $( compgen -W 'NONE' -- "$cur" ) )
|
||||
_filedir '@(jks|ks|p12|pfx)'
|
||||
return 0
|
||||
;;
|
||||
-storepass|-keypass|-sigfile|-digestalg|-sigalg|-tsacert|-altsigner|\
|
||||
-altsignerpath|-providerName|-providerClass|-providerArg)
|
||||
return 0
|
||||
;;
|
||||
-storetype)
|
||||
COMPREPLY=( $( compgen -W 'JKS PKCS11 PKCS12' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-signedjar)
|
||||
_filedir jar
|
||||
return 0
|
||||
;;
|
||||
-tsa)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
# Check if a jar was already given.
|
||||
local i jar=false
|
||||
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )) ; do
|
||||
if [[ "${COMP_WORDS[i]}" == *.jar && \
|
||||
"${COMP_WORDS[i-1]}" != -signedjar ]] ; then
|
||||
jar=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if ! $jar ; then
|
||||
if [[ "$cur" == -* ]] ; then
|
||||
# Documented as "should not be used": -internalsf, -sectionsonly
|
||||
COMPREPLY=( $( compgen -W '-keystore -storepass -storetype \
|
||||
-keypass -sigfile -signedjar -digestalg -sigalg -verify \
|
||||
-verbose -certs -tsa -tsacert -altsigner -altsignerpath \
|
||||
-protected -providerName -providerClass -providerArg' \
|
||||
-- "$cur" ) )
|
||||
fi
|
||||
_filedir jar
|
||||
fi
|
||||
} &&
|
||||
complete -F _jarsigner jarsigner
|
||||
|
||||
have javaws &&
|
||||
_javaws()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur prev
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-help|-license|-about|-viewer|-arg|-param|-property|-update|-umask)
|
||||
return 0
|
||||
;;
|
||||
-basedir|-codebase)
|
||||
_filedir -d
|
||||
return 0
|
||||
;;
|
||||
-uninstall|-import)
|
||||
_filedir jnlp
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ $cur == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W "$( _parse_help "$1" -help ) " -- "$cur" ) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
_filedir jnlp
|
||||
} &&
|
||||
complete -F _javaws javaws
|
||||
|
||||
# Local variables:
|
||||
# mode: shell-script
|
||||
# sh-basic-offset: 4
|
||||
# sh-indent-comment: t
|
||||
# indent-tabs-mode: nil
|
||||
# End:
|
||||
# ex: ts=4 sw=4 et filetype=sh
|
|
@ -1,55 +0,0 @@
|
|||
# bash completion for k3b
|
||||
|
||||
have k3b &&
|
||||
_k3b()
|
||||
{
|
||||
local cur prev
|
||||
_get_comp_words_by_ref cur prev
|
||||
COMPREPLY=()
|
||||
|
||||
case $prev in
|
||||
--help*|--author|-v|--version|--license|--lang)
|
||||
return 0
|
||||
;;
|
||||
--datacd|--audiocd|--videocd|--mixedcd|--emovixcd|--videodvd)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
--copydvd|--formatdvd|--videodvdrip)
|
||||
_dvd_devices
|
||||
return 0
|
||||
;;
|
||||
--copycd|--erasecd|--cddarip|--videocdrip)
|
||||
_cd_devices
|
||||
_dvd_devices
|
||||
return 0
|
||||
;;
|
||||
--cdimage|--image)
|
||||
_filedir @(cue|iso|toc)
|
||||
return 0
|
||||
;;
|
||||
--dvdimage)
|
||||
_filedir iso
|
||||
return 0
|
||||
;;
|
||||
--ao)
|
||||
COMPREPLY=( $( compgen -W 'alsa arts' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]] ; then
|
||||
COMPREPLY=( $( compgen -W "$( _parse_help "$1" )" -- "$cur" ) )
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
} &&
|
||||
complete -F _k3b k3b
|
||||
|
||||
# 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
|
|
@ -1,40 +0,0 @@
|
|||
# bash completion for FreeBSD kernel module commands
|
||||
|
||||
[ $UNAME = FreeBSD ] &&
|
||||
{
|
||||
|
||||
_kldload()
|
||||
{
|
||||
local cur moddir
|
||||
|
||||
moddir=/modules/
|
||||
[ -d $moddir ] || moddir=/boot/kernel/
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
_compopt_o_filenames
|
||||
COMPREPLY=( $( compgen -f "$moddir$cur" ) )
|
||||
COMPREPLY=( ${COMPREPLY[@]#$moddir} )
|
||||
COMPREPLY=( ${COMPREPLY[@]%.ko} )
|
||||
|
||||
return 0
|
||||
}
|
||||
complete -F _kldload kldload
|
||||
|
||||
_kldunload()
|
||||
{
|
||||
local cur
|
||||
_get_comp_words_by_ref cur
|
||||
COMPREPLY=( $( kldstat | \
|
||||
sed -ne "s/^.*[ \t]\{1,\}\($cur[a-z_]\{1,\}\).ko$/\1/p" ) )
|
||||
}
|
||||
complete -F _kldunload kldunload
|
||||
|
||||
}
|
||||
|
||||
# Local variables:
|
||||
# mode: shell-script
|
||||
# sh-basic-offset: 4
|
||||
# sh-indent-comment: t
|
||||
# indent-tabs-mode: nil
|
||||
# End:
|
||||
# ex: ts=4 sw=4 et filetype=sh
|
|
@ -1,48 +0,0 @@
|
|||
# larch(1) completion by Alex Shinn <foof@synthcode.com>
|
||||
|
||||
have larch &&
|
||||
_larch()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
if [[ $COMP_CWORD -eq 1 || "$prev" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W ' \
|
||||
my-id my-default-archive register-archive whereis-archive archives \
|
||||
init-tree tree-root tree-version set-tree-version inventory \
|
||||
tagging-method tree-lint missing-tags add delete \
|
||||
move explicit-default set-manifest manifest check-manifest mkpatch \
|
||||
dopatch patch-report empty-patch make-archive make-category \
|
||||
make-branch make-version categories branches versions revisions \
|
||||
cat-archive-log archive-cache-revision archive-cached-revisions \
|
||||
archive-uncache-revision category-readme branch-readme \
|
||||
version-readme make-log logs add-log log-ls cat-log \
|
||||
log-header-field changelog log-for-merge merge-points \
|
||||
new-on-branch import commit get get-patch lock-branch \
|
||||
lock-revision push-mirror build-config update-config replay-config \
|
||||
record-config show-config config-history update replay delta-patch \
|
||||
star-merge tag prepare-branch finish-branch join-branch \
|
||||
whats-missing what-changed file-diffs pristines lock-pristine \
|
||||
my-revision-library library-find library-add library-remove \
|
||||
library-archives library-categories library-branches \
|
||||
library-versions library-revisions library-log library-file \
|
||||
touched-files-prereqs patch-set-web update-distributions \
|
||||
distribution-name notify my-notifier mail-new-categories \
|
||||
mail-new-branches mail-new-versions mail-new-revisions \
|
||||
notify-library notify-browser push-new-revisions sendmail-mailx' \
|
||||
"$cur" ))
|
||||
fi
|
||||
|
||||
return 0
|
||||
} &&
|
||||
complete -F _larch -o default larch
|
||||
|
||||
# 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
|
|
@ -1,72 +0,0 @@
|
|||
# bash completion for ldapvi
|
||||
|
||||
have ldapvi &&
|
||||
_ldapvi()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-h|--host)
|
||||
_known_hosts_real "$cur"
|
||||
return 0
|
||||
;;
|
||||
-Y|--sasl-mech)
|
||||
COMPREPLY=( $( compgen -W 'EXTERNAL GSSAPI DIGEST-MD5 \
|
||||
CRAM-MD5 PLAIN ANONYMOUS' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
--bind)
|
||||
COMPREPLY=( $( compgen -W 'simple sasl' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
--bind-dialog)
|
||||
COMPREPLY=( $( compgen -W 'never auto always' -- $cur ) )
|
||||
return 0
|
||||
;;
|
||||
--scope)
|
||||
COMPREPLY=( $( compgen -W 'base one sub' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
--deref)
|
||||
COMPREPLY=( $( compgen -W 'never searching finding always' \
|
||||
-- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
--encoding)
|
||||
COMPREPLY=( $( compgen -W 'ASCII UTF-8 binary' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
--tls)
|
||||
COMPREPLY=( $( compgen -W 'never allow try strict' \
|
||||
-- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--discover --out --in --delete \
|
||||
--rename -h --host -D --user -w --password --bind \
|
||||
--bind-dialog -I --sasl-interactive --bind-dialog -O \
|
||||
--sasl-secprops -Q --sasl-quiet -R --sasl-realm -U \
|
||||
--sasl-authcid -X --sasl-authzid -Y --sasl-mech -b \
|
||||
--base -s --scope -S --sort --add -o --class --config \
|
||||
-c --continue --deleteoldrdn -a --deref -d --discover \
|
||||
-A --empty --ncoding -H --help --ldap-conf -m --may -M \
|
||||
--managedsait --noquestions -! --noninteractive -q \
|
||||
--quiet -R --read -Z --starttls --tls -v --verbose \
|
||||
--ldapsearch --ldapmodify --ldapdelete --ldapmoddn' \
|
||||
-- "$cur" ) )
|
||||
fi
|
||||
} &&
|
||||
complete -F _ldapvi ldapvi
|
||||
|
||||
# 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
|
|
@ -1,52 +0,0 @@
|
|||
# bash completion for lftp
|
||||
|
||||
have lftp &&
|
||||
_lftp()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-f)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-c|-h|--help|-v|--version|-e|-u|-p)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]] ; then
|
||||
COMPREPLY=( $( compgen -W '-f -c --help --version -e -u -p' \
|
||||
-- "$cur" ) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
COMPREPLY=( $( compgen -W \
|
||||
'$( cut -f 1 -s ~/.lftp/bookmarks 2>/dev/null )' -- "$cur" ) )
|
||||
_known_hosts_real "$cur"
|
||||
} &&
|
||||
complete -F _lftp lftp
|
||||
|
||||
have lftpget &&
|
||||
_lftpget()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [[ "$cur" == -* ]] ; then
|
||||
COMPREPLY=( $( compgen -W '-c -d -v' -- "$cur" ) )
|
||||
fi
|
||||
} &&
|
||||
complete -F _lftpget lftpget
|
||||
|
||||
# Local variables:
|
||||
# mode: shell-script
|
||||
# sh-basic-offset: 4
|
||||
# sh-indent-comment: t
|
||||
# indent-tabs-mode: nil
|
||||
# End:
|
||||
# ex: ts=4 sw=4 et filetype=sh
|
|
@ -1,60 +0,0 @@
|
|||
# bash completion for lilo(8)
|
||||
|
||||
have lilo && {
|
||||
_lilo_labels()
|
||||
{
|
||||
COMPREPLY=( $( compgen -W "$( awk -F'=' '/label/ {print $2}' \
|
||||
/etc/lilo.conf | sed -e 's/\"//g' )" -- "$cur" ) )
|
||||
}
|
||||
|
||||
_lilo()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-C|-i|-m|-s|-S)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-r)
|
||||
_filedir -d
|
||||
return 0
|
||||
;;
|
||||
-I|-D|-R)
|
||||
# label completion
|
||||
_lilo_labels
|
||||
return 0
|
||||
;;
|
||||
-A|-b|-M|-u|-U)
|
||||
# device completion
|
||||
cur=${cur:=/dev/}
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-T)
|
||||
# topic completion
|
||||
COMPREPLY=( $( compgen -W 'help ChRul EBDA geom geom= \
|
||||
table= video' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
# relevant options completion
|
||||
COMPREPLY=( $( compgen -W '-A -b -c -C -d -f -g -i -I -l -L -m \
|
||||
-M -p -P -q -r -R -s -S -t -T -u -U -v -V -w -x -z' -- "$cur" ) )
|
||||
fi
|
||||
}
|
||||
complete -F _lilo lilo
|
||||
}
|
||||
|
||||
# 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
|
|
@ -1,43 +0,0 @@
|
|||
# bash completion for links
|
||||
|
||||
have links &&
|
||||
_links()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
case $cur in
|
||||
--*)
|
||||
COMPREPLY=( $( compgen -W '--help' -- "$cur" ) )
|
||||
;;
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W '-async-dns -max-connections \
|
||||
-max-connections-to-host -retries -receive-timeout \
|
||||
-unrestartable-receive-timeout -format-cache-size \
|
||||
-memory-cache-size -http-proxy -ftp-proxy -download-dir \
|
||||
-assume-codepage -anonymous -dump -no-connect \
|
||||
-source -version -help' -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
if [ -r ~/.links/links.his ]; then
|
||||
COMPREPLY=( $( compgen -W '$( < ~/.links/links.his )' \
|
||||
-- "$cur" ) )
|
||||
fi
|
||||
_filedir '@(htm|html)'
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
return 0
|
||||
} &&
|
||||
complete -F _links links
|
||||
|
||||
# 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
|
|
@ -1,186 +0,0 @@
|
|||
# -*- mode: shell-script; sh-basic-offset: 8; indent-tabs-mode: t -*-
|
||||
# ex: ts=8 sw=8 noet filetype=sh
|
||||
#
|
||||
# bash completion for lintian(1) and lintian-info(1)
|
||||
|
||||
have lintian && {
|
||||
_lintian_tags() {
|
||||
local match search tags
|
||||
|
||||
tags=$( grep -e ^Tag /usr/share/lintian/checks/*.desc | cut -d\ -f2 )
|
||||
if [[ "$cur" == *, ]]; then
|
||||
search=${cur//,/ }
|
||||
for item in $search; do
|
||||
match=$(grep -nE "^Tag: $item$" /usr/share/lintian/checks/*.desc \
|
||||
| cut -d: -f1 )
|
||||
tags=$( echo $tags | sed -e "s/\<$item\>//g" )
|
||||
done
|
||||
COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$tags") )
|
||||
elif [[ "$cur" == *,* ]]; then
|
||||
COMPREPLY=( ${COMPREPLY[@]} $(compgen -P "${cur%,*}," -W "$tags" -- \
|
||||
"${cur##*,}") )
|
||||
else
|
||||
COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$tags" -- "$cur") )
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
_lintian_checks() {
|
||||
local match search todisable checks
|
||||
|
||||
checks=$(grep -e ^Check-Script -e ^Abbrev \
|
||||
/usr/share/lintian/checks/*.desc | cut -d\ -f2 )
|
||||
if [[ "$cur" == *, ]]; then
|
||||
search=${cur//,/ }
|
||||
for item in $search; do
|
||||
match=$(grep -nE "^(Check-Script|Abbrev): $item$" \
|
||||
/usr/share/lintian/checks/*.desc | cut -d: -f1 )
|
||||
todisable=$(grep -e ^Check-Script -e ^Abbrev $match | \
|
||||
cut -d\ -f2 )
|
||||
for name in $todisable; do
|
||||
checks=$( echo $checks | sed -e "s/\<$name\>//g" )
|
||||
done
|
||||
done
|
||||
COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$checks") )
|
||||
elif [[ "$cur" == *,* ]]; then
|
||||
COMPREPLY=( ${COMPREPLY[@]} $(compgen -P "${cur%,*}," -W "$checks" \
|
||||
-- "${cur##*,}") )
|
||||
else
|
||||
COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$checks" -- "$cur") )
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
_lintian_infos() {
|
||||
local match search infos
|
||||
|
||||
infos=$(grep -e ^Collector /usr/share/lintian/collection/*.desc \
|
||||
| cut -d\ -f2 )
|
||||
if [[ "$cur" == *, ]]; then
|
||||
search=${cur//,/ }
|
||||
for item in $search; do
|
||||
match=$( grep -nE "^Collector: $item$" \
|
||||
/usr/share/lintian/collection/*.desc | cut -d: -f1 )
|
||||
infos=$( echo $infos | sed -e "s/\<$item\>//g" )
|
||||
done
|
||||
COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$infos") )
|
||||
elif [[ "$cur" == *,* ]]; then
|
||||
COMPREPLY=( ${COMPREPLY[@]} $(compgen -P "${cur%,*}," -W "$infos" \
|
||||
-- "${cur##*,}") )
|
||||
else
|
||||
COMPREPLY=( ${COMPREPLY[@]} $(compgen -W "$infos" -- "$cur") )
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
_lintian_arches() {
|
||||
return 0
|
||||
}
|
||||
|
||||
_lintian() {
|
||||
local cur prev action lint_actions general_opts behaviour_opts \
|
||||
configuration_opts selection_opts
|
||||
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
lint_actions="--setup-lab --remove-lab --check --check-part --tags \
|
||||
--tags-from-file --ftp-master-rejects --dont-check-part \
|
||||
--unpack --remove"
|
||||
general_opts="--help --version --print-version --verbose --debug --quiet"
|
||||
behaviour_opts="--info --display-info --display-experimental --pedantic \
|
||||
--display-level --suppress-tags --unpack-level \
|
||||
--suppress-tags-from-file --no-override --show-overrides \
|
||||
--color --unpack-info --md5sums --checksums --allow-root \
|
||||
--fail-on-warnings --keep-lab"
|
||||
configuration_opts="--cfg --lab --archivedir --dist --area --section \
|
||||
--arch --root"
|
||||
selection_opts="--all --binary --source --udeb --packages-file"
|
||||
|
||||
if [[ "$prev" = -* ]]; then
|
||||
case $prev in
|
||||
-C|--check-part|-X|--dont-check-part)
|
||||
_lintian_checks
|
||||
;;
|
||||
-T|--tags|--suppress-tags)
|
||||
_lintian_tags
|
||||
;;
|
||||
--tags-from-file|--suppress-tags-from-file|--cfg|-p|\
|
||||
--packages-file)
|
||||
_filedir
|
||||
;;
|
||||
--lab|--archivedir|--dist|--root)
|
||||
_filedir -d
|
||||
;;
|
||||
-l|--unpack-level)
|
||||
COMPREPLY=($(compgen -W "0 none 1 basic 2 contents" -- \
|
||||
"$cur"))
|
||||
;;
|
||||
--color)
|
||||
COMPREPLY=($(compgen -W "never always auto html" -- "$cur"))
|
||||
;;
|
||||
-U|--unpack-info)
|
||||
_lintian_infos
|
||||
;;
|
||||
--area|--section)
|
||||
COMPREPLY=($(compgen -W "main contrib non-free" -- "$cur"))
|
||||
;;
|
||||
--arch)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
case "$cur" in
|
||||
--*)
|
||||
COMPREPLY=($(compgen -W "$lint_actions $general_opts \
|
||||
$behaviour_opts $configuration_opts" -- "$cur"))
|
||||
;;
|
||||
*,)
|
||||
# If we're here, the user is trying to complete on
|
||||
# --action tag,tag,<TAB>
|
||||
# Only few actions permit that, re-complete them now.
|
||||
echo $prev
|
||||
case "$prev" in
|
||||
-C|--check-part|-X|--dont-check-part)
|
||||
_lintian_checks
|
||||
;;
|
||||
-T|--tags|--suppress-tags)
|
||||
_lintian_tags
|
||||
;;
|
||||
-U|--unpack-info)
|
||||
_lintian_infos
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
_filedir '@(?(u)deb|changes|dsc)'
|
||||
;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
|
||||
_lintian_info() {
|
||||
local cur prev
|
||||
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case "$prev" in
|
||||
-t|--tags)
|
||||
_lintian_tags
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$cur" in
|
||||
--*)
|
||||
COMPREPLY=($(compgen -W "--annotate --help --tags" -- "$cur"))
|
||||
;;
|
||||
*)
|
||||
_filedir
|
||||
;;
|
||||
esac
|
||||
return 0
|
||||
}
|
||||
|
||||
complete -F _lintian lintian
|
||||
complete -F _lintian_info lintian-info
|
||||
}
|
|
@ -1,31 +0,0 @@
|
|||
# bash programmable completion for various Common Lisp implementations by
|
||||
# Nikodemus Siivola <nikodemus@random-state.net>
|
||||
|
||||
have lisp &&
|
||||
_lisp()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
# completing an option (may or may not be separated by a space)
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-core -lib -batch -quit -edit -eval -init \
|
||||
-dynamic-space-size -hinit -noinit -nositeinit -load -slave ' \
|
||||
-- "$cur" ) )
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
|
||||
return 0
|
||||
} &&
|
||||
complete -F _lisp -o default lisp
|
||||
|
||||
# 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
|
|
@ -1,64 +0,0 @@
|
|||
# lrzip(1) completion
|
||||
|
||||
have lrzip &&
|
||||
_lrzip()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur prev
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
if [[ "$cur" == -* && $prev != -N ]]; then
|
||||
COMPREPLY=( $( compgen -W '-w -d -o -O -S -f -D -q -L -n -l -b -g -M \
|
||||
-T -N -v -vv -V -h' -- "$cur" ) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
local xspec="*.lrz"
|
||||
|
||||
case $prev in
|
||||
-w|-S|-V|-h)
|
||||
return 0
|
||||
;;
|
||||
-d)
|
||||
xspec="!"$xspec
|
||||
;;
|
||||
-o)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-O)
|
||||
_filedir -d
|
||||
return 0
|
||||
;;
|
||||
-L)
|
||||
COMPREPLY=( $( compgen -W '1 2 3 4 5 6 7 8 9' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-T)
|
||||
COMPREPLY=( $( compgen -W '1 2 3 4 5 6 7 8 9 10' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-N)
|
||||
COMPREPLY=( $( compgen -W '-20 -19 -18 -17 -16 -15 -14 -13 -12 \
|
||||
-11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 \
|
||||
12 13 14 15 16 17 18 19' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
_expand || return 0
|
||||
|
||||
local IFS=$'\n'
|
||||
_compopt_o_filenames
|
||||
COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \
|
||||
$( compgen -d -- "$cur" ) )
|
||||
} &&
|
||||
complete -F _lrzip lrzip
|
||||
|
||||
# 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
|
|
@ -1,64 +0,0 @@
|
|||
# lsof(8) completion
|
||||
|
||||
have lsof &&
|
||||
_lsof()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur prev
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-'?'|-h|+c|-c|-d|-F|-i|+r|-r|-s|-S|-T)
|
||||
return 0
|
||||
;;
|
||||
-A|-k|-m|+m|-o)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
+d|+D)
|
||||
_filedir -d
|
||||
return 0
|
||||
;;
|
||||
-D)
|
||||
COMPREPLY=( $( compgen -W '? b i r u' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-f)
|
||||
COMPREPLY=( $( compgen -W 'c f g G n' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-g)
|
||||
# TODO: handle ^foo exclusions, comma separated lists
|
||||
_pgids
|
||||
return 0
|
||||
;;
|
||||
-p)
|
||||
# TODO: handle ^foo exclusions, comma separated lists
|
||||
_pids
|
||||
return 0
|
||||
;;
|
||||
-u)
|
||||
# TODO: handle ^foo exclusions, comma separated lists
|
||||
COMPREPLY=( $( compgen -u -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == [-+]* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-h -a -A -b -c +c -C +d -d +D -D +f -f -F -g
|
||||
-i -k -l +L -L +m -m +M -M -n -N -o -O -p -P +r -r -R -s -S -T -t
|
||||
-u -U -v -V +w -w -x -X -z -Z' -- "$cur" ) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
_filedir
|
||||
} &&
|
||||
complete -F _lsof lsof
|
||||
|
||||
# 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
|
File diff suppressed because it is too large
Load Diff
|
@ -1,46 +0,0 @@
|
|||
# lzma(1) completion by Per Øyvind Karlsen <peroyvind@mandriva.org>
|
||||
|
||||
have lzma &&
|
||||
_lzma()
|
||||
{
|
||||
local cur prev xspec
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-1 -2 -3 -4 -5 -6 -7 -8 -9 \
|
||||
--help --decompress --compress --keep --force --suffix \
|
||||
--test --stdout --quiet --verbose --license --list \
|
||||
--version --small --fast --best --text' -- "$cur" ) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
local IFS=$'\n'
|
||||
|
||||
xspec="*.@(lzma|tlz)"
|
||||
if [[ "$prev" == --* ]]; then
|
||||
[[ "$prev" == --decompress || \
|
||||
"$prev" == --list || \
|
||||
"$prev" == --test ]] && xspec="!"$xspec
|
||||
[[ "$prev" == --compress ]] && xspec=
|
||||
elif [[ "$prev" == -* ]]; then
|
||||
[[ "$prev" == -*[dt]* ]] && xspec="!"$xspec
|
||||
[[ "$prev" == -*z* ]] && xspec=
|
||||
fi
|
||||
|
||||
_expand || return 0
|
||||
|
||||
_compopt_o_filenames
|
||||
COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \
|
||||
$( compgen -d -- "$cur" ) )
|
||||
} &&
|
||||
complete -F _lzma lzma
|
||||
|
||||
# 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
|
|
@ -1,69 +0,0 @@
|
|||
# lzop(1) completion
|
||||
|
||||
have lzop &&
|
||||
_lzop()
|
||||
{
|
||||
local cur prev xspec
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-1 -2 -3 -4 -5 -6 -7 -8 -9 -P \
|
||||
--fast --best --decompress --extract --test --list --ls --info \
|
||||
--sysinfo --license --help --version --stdout --output --path \
|
||||
--force --no-checksum --no-name --name --no-mode --no-time \
|
||||
--suffix --keep --delete --crc32 --no-warn --ignore-warn --quiet \
|
||||
--verbose --no-stdin --filter --checksum --no-color --mono \
|
||||
--color' -- "$cur" ) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
case $prev in
|
||||
-o|--output)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
--path)
|
||||
_filedir -d
|
||||
return 0
|
||||
;;
|
||||
-S|--suffix)
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
xspec="*.?(t)lzo"
|
||||
case $prev in
|
||||
--decompress|--uncompress|--extract|--list|--ls|--info|--test)
|
||||
xspec="!"$xspec
|
||||
;;
|
||||
--force)
|
||||
xspec=
|
||||
;;
|
||||
--*)
|
||||
;;
|
||||
-*f*|'<'|'>')
|
||||
xspec=
|
||||
;;
|
||||
-*[dltx]*)
|
||||
xspec="!"$xspec
|
||||
;;
|
||||
esac
|
||||
|
||||
_expand || return 0
|
||||
|
||||
local IFS=$'\n'
|
||||
_compopt_o_filenames
|
||||
COMPREPLY=( $( compgen -f -X "$xspec" -- "$cur" ) \
|
||||
$( compgen -d -- "$cur" ) )
|
||||
} &&
|
||||
complete -F _lzop lzop
|
||||
|
||||
# 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
|
|
@ -1,587 +0,0 @@
|
|||
# mailman completion
|
||||
|
||||
have list_lists && {
|
||||
_mailman_lists()
|
||||
{
|
||||
COMPREPLY=( $( compgen -W '$( list_lists -b )' -- "$cur" ) )
|
||||
}
|
||||
|
||||
_list_lists()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--advertised --virtual-host-overview \
|
||||
--bare --help' -- "$cur" ) )
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _list_lists list_lists
|
||||
}
|
||||
|
||||
have add_members &&
|
||||
_add_members()
|
||||
{
|
||||
local cur prev split=false
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
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
|
||||
_mailman_lists
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _add_members add_members
|
||||
|
||||
have remove_members &&
|
||||
_remove_members()
|
||||
{
|
||||
local cur prev split=false
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
case $prev in
|
||||
-f|--file)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
$split && return 0
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--file --all --fromall --nouserack \
|
||||
--noadminack --help' -- "$cur" ) )
|
||||
else
|
||||
_mailman_lists
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _remove_members remove_members
|
||||
|
||||
have find_member &&
|
||||
_find_member()
|
||||
{
|
||||
local cur prev split=false
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
case $prev in
|
||||
-l|-x|--listname|--exclude)
|
||||
_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
|
||||
|
||||
have clone_member &&
|
||||
_clone_member()
|
||||
{
|
||||
local cur prev split=false
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
case $prev in
|
||||
-l|--listname)
|
||||
_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
|
||||
|
||||
have sync_members &&
|
||||
_sync_members()
|
||||
{
|
||||
local cur prev split=false
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
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 '--no-change --welcome-msg \
|
||||
--goodbye-msg --digest --notifyadmin --file --help' -- "$cur" ) )
|
||||
else
|
||||
_mailman_lists
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _sync_members sync_members
|
||||
|
||||
have unshunt &&
|
||||
_unshunt()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--help' -- "$cur" ) )
|
||||
else
|
||||
_filedir -d
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _unshunt unshunt
|
||||
|
||||
have list_admins &&
|
||||
_list_admins()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--all-vhost --all --help' -- "$cur" ) )
|
||||
else
|
||||
_mailman_lists
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _list_admins list_admins
|
||||
|
||||
have list_owners &&
|
||||
_list_owners()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--with-listnames --moderators \
|
||||
--help' -- "$cur" ) )
|
||||
else
|
||||
_mailman_lists
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _list_owners list_owners
|
||||
|
||||
have list_members &&
|
||||
_list_members()
|
||||
{
|
||||
local cur prev split=false
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
case $prev in
|
||||
-o|--output)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-d|--digest)
|
||||
COMPREPLY=( $( compgen -W 'mime plain' -- "$cur") )
|
||||
return 0
|
||||
;;
|
||||
-n|--nomail)
|
||||
COMPREPLY=( $( compgen -W 'byadmin byuser bybounce unknown' \
|
||||
-- "$cur") )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
$split && return 0
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--output --regular --digest \
|
||||
--nomail --fullnames --preserve --help' -- "$cur" ) )
|
||||
else
|
||||
_mailman_lists
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _list_members list_members
|
||||
|
||||
have change_pw &&
|
||||
_change_pw()
|
||||
{
|
||||
local cur prev split=false
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
case $prev in
|
||||
-l|--listname)
|
||||
_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
|
||||
|
||||
have withlist &&
|
||||
_withlist()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--lock --interactive \
|
||||
--run --all --quiet --help' -- "$cur" ) )
|
||||
else
|
||||
_mailman_lists
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _withlist withlist
|
||||
|
||||
have newlist &&
|
||||
_newlist()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--language --quiet --help' -- "$cur" ) )
|
||||
else
|
||||
_mailman_lists
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _newlist newlist
|
||||
|
||||
have rmlist &&
|
||||
_rmlist()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--archives --help' -- "$cur" ) )
|
||||
else
|
||||
_mailman_lists
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _rmlist rmlist
|
||||
|
||||
have config_list &&
|
||||
_config_list()
|
||||
{
|
||||
local cur prev split=false
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
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
|
||||
_mailman_lists
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _config_list config_list
|
||||
|
||||
# Try to detect whether this is the mailman "arch" to avoid installing
|
||||
# it for the coreutils/util-linux-ng one.
|
||||
have arch && have mailmanctl &&
|
||||
_arch()
|
||||
{
|
||||
local cur prev split=false
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
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
|
||||
args=$COMP_CWORD
|
||||
for (( i=1; i < COMP_CWORD; i++ )); do
|
||||
if [[ "${COMP_WORDS[i]}" == -* ]]; then
|
||||
args=$(($args-1))
|
||||
fi
|
||||
done
|
||||
case $args in
|
||||
1)
|
||||
_mailman_lists
|
||||
;;
|
||||
2)
|
||||
_filedir
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _arch arch
|
||||
|
||||
have cleanarch &&
|
||||
_cleanarch()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--status --dry-run --quiet \
|
||||
--help' -- "$cur" ) )
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _cleanarch cleanarch
|
||||
|
||||
have inject &&
|
||||
_inject()
|
||||
{
|
||||
local cur prev split=false
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
case $prev in
|
||||
-l|--listname)
|
||||
_mailman_lists
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
$split && return 0
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--listname --queue --help' -- "$cur" ) )
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _inject inject
|
||||
|
||||
have dumpdb &&
|
||||
_dumpdb()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--marshal --pickle --noprint \
|
||||
--help' -- "$cur" ) )
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _dumpdb dumpdb
|
||||
|
||||
have check_db &&
|
||||
_check_db()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--all --verbose --help' -- "$cur" ) )
|
||||
else
|
||||
_mailman_lists
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _check_db check_db
|
||||
|
||||
have check_perms &&
|
||||
_check_perms()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-f -v -h' -- "$cur" ) )
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _check_perms check_perms
|
||||
|
||||
have genaliases &&
|
||||
_genaliases()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--quiet --help' -- "$cur" ) )
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _genaliases genaliases
|
||||
|
||||
have mmsitepass &&
|
||||
_mmsitepass()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--listcreator --help' -- "$cur" ) )
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _mmsitepass mmsitepass
|
||||
|
||||
have qrunner &&
|
||||
_qrunner()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && return 0
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--runner --once \
|
||||
--list --verbose --subproc --help' -- "$cur" ) )
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _qrunner qrunner
|
||||
|
||||
have mailmanctl &&
|
||||
_mailmanctl()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--no-restart --run-as-user \
|
||||
--stale-lock-cleanup --quiet --help' -- "$cur" ) )
|
||||
else
|
||||
COMPREPLY=( $( compgen -W 'start stop restart reopen' -- "$cur" ) )
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _mailmanctl mailmanctl
|
||||
|
||||
# Local variables:
|
||||
# mode: shell-script
|
||||
# sh-basic-offset: 4
|
||||
# sh-indent-comment: t
|
||||
# indent-tabs-mode: nil
|
||||
# End:
|
||||
# ex: ts=4 sw=4 et filetype=sh
|
|
@ -1,78 +0,0 @@
|
|||
# bash completion for GNU make
|
||||
|
||||
have make || have gmake || have gnumake || have pmake &&
|
||||
_make()
|
||||
{
|
||||
local file makef makef_dir="." makef_inc cur prev i split=false
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
case $prev in
|
||||
-f|-o|-W|--file|--makefile|--old-file|--new-file|--assume-old|--assume-new|--what-if)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-I|-C|--directory|--include-dir)
|
||||
_filedir -d
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
$split && return 0
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-b -m -B -C -d -e -f -h -i -I\
|
||||
-j -l -k -n -o -p -q -r -R - s -S -t -v -w -W \
|
||||
--always-make --directory --debug \
|
||||
--environment-overrides --file --makefile --help \
|
||||
--ignore-errors --include-dir --jobs --load-average \
|
||||
--max-load --keep-going --just-print --dry-run \
|
||||
--recon --old-file --assume-old --print-data-base \
|
||||
--question --no-builtin-rules --no-builtin-variables \
|
||||
--silent --quiet --no-keep-goind --stop --touch \
|
||||
--version --print-directory --no-print-directory \
|
||||
--what-if --new-file --assume-new \
|
||||
--warn-undefined-variables' -- "$cur" ) )
|
||||
else
|
||||
# before we check for makefiles, see if a path was specified
|
||||
# with -C/--directory
|
||||
for (( i=0; i < ${#COMP_WORDS[@]}; i++ )); do
|
||||
if [[ ${COMP_WORDS[i]} == -@(C|-directory) ]]; then
|
||||
# eval for tilde expansion
|
||||
eval makef_dir=${COMP_WORDS[i+1]}
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# before we scan for targets, see if a Makefile name was
|
||||
# specified with -f/--file/--makefile
|
||||
for (( i=0; i < ${#COMP_WORDS[@]}; i++ )); do
|
||||
if [[ ${COMP_WORDS[i]} == -@(f|-?(make)file) ]]; then
|
||||
# eval for tilde expansion
|
||||
eval makef=${COMP_WORDS[i+1]}
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
[ -n "$makef" ] && makef="-f ${makef}"
|
||||
[ -n "$makef_dir" ] && makef_dir="-C ${makef_dir}"
|
||||
|
||||
COMPREPLY=( $( compgen -W "$( make -qp $makef $makef_dir 2>/dev/null | \
|
||||
awk -F':' '/^[a-zA-Z0-9][^$#\/\t=]*:([^=]|$)/ \
|
||||
{split($1,A,/ /);for(i in A)print A[i]}' )" \
|
||||
-- "$cur" ) )
|
||||
|
||||
fi
|
||||
} &&
|
||||
complete -F _make make gmake gnumake pmake
|
||||
|
||||
# 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
|
|
@ -1,80 +0,0 @@
|
|||
# man(1) completion
|
||||
|
||||
[ $USERLAND = GNU -o $UNAME = Darwin \
|
||||
-o $UNAME = FreeBSD -o $UNAME = SunOS -o $UNAME = Cygwin \
|
||||
-o $UNAME = OpenBSD ] &&
|
||||
_man()
|
||||
{
|
||||
local cur i prev sect manpath manext mansect uname
|
||||
|
||||
manext="@([0-9lnp]|[0-9][px]|man|3pm)?(.@([gx]z|bz2|lzma|Z))"
|
||||
mansect="@([0-9lnp]|[0-9][px]|3pm)"
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref -n : cur prev
|
||||
|
||||
if [[ "$prev" == -l ]]; then
|
||||
_filedir $manext
|
||||
return 0
|
||||
fi
|
||||
|
||||
_expand || return 0
|
||||
|
||||
# file based completion if parameter contains /
|
||||
if [[ "$cur" == */* ]]; then
|
||||
_filedir $manext
|
||||
return 0
|
||||
fi
|
||||
|
||||
uname=$( uname -s )
|
||||
if [[ $uname == @(Linux|GNU|GNU/*|FreeBSD|Cygwin|CYGWIN_*) ]]; then
|
||||
manpath=$( manpath 2>/dev/null || command man --path )
|
||||
else
|
||||
manpath=$MANPATH
|
||||
fi
|
||||
|
||||
if [ -z "$manpath" ]; then
|
||||
COMPREPLY=( $( compgen -c -- "$cur" ) )
|
||||
return 0
|
||||
fi
|
||||
|
||||
# determine manual section to search
|
||||
[[ "$prev" == $mansect ]] && sect=$prev || sect='*'
|
||||
|
||||
manpath=$manpath:
|
||||
if [ -n "$cur" ]; then
|
||||
manpath="${manpath//://*man$sect/$cur* } ${manpath//://*cat$sect/$cur* }"
|
||||
else
|
||||
manpath="${manpath//://*man$sect/ } ${manpath//://*cat$sect/ }"
|
||||
fi
|
||||
|
||||
# redirect stderr for when path doesn't exist
|
||||
COMPREPLY=( $( eval command ls "$manpath" 2>/dev/null ) )
|
||||
# weed out directory path names and paths to man pages
|
||||
COMPREPLY=( ${COMPREPLY[@]##*/?(:)} )
|
||||
# strip suffix from man pages
|
||||
COMPREPLY=( ${COMPREPLY[@]%.@([gx]z|bz2|lzma|Z)} )
|
||||
COMPREPLY=( $( compgen -W '${COMPREPLY[@]%.*}' -- "${cur//\\\\/}" ) )
|
||||
|
||||
if [[ "$prev" != $mansect ]]; then
|
||||
# File based completion for the rest, prepending ./ if needed
|
||||
# (man 1.6f needs that for man pages in current dir)
|
||||
local start=${#COMPREPLY[@]}
|
||||
_filedir $manext
|
||||
for (( i=$start; i < ${#COMPREPLY[@]}; i++ )); do
|
||||
[[ ${COMPREPLY[i]} == */* ]] || COMPREPLY[i]=./${COMPREPLY[i]}
|
||||
done
|
||||
fi
|
||||
|
||||
__ltrim_colon_completions "$cur"
|
||||
return 0
|
||||
} &&
|
||||
complete -F _man man apropos whatis
|
||||
|
||||
# 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
|
|
@ -1,47 +0,0 @@
|
|||
# bash completion for mc
|
||||
|
||||
have mc &&
|
||||
_mc()
|
||||
{
|
||||
local cur prev split=false
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
case $prev in
|
||||
-e|--edit|-v|--view|-l|--ftplog|-P|--printwd)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-C|--colors|-D|--debuglevel)
|
||||
# argument required but no completions available
|
||||
return 0
|
||||
;;
|
||||
-h|--help|-V|--version)
|
||||
# all other arguments are noop with these
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
$split && return 0
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--stickchars --nocolor --color --colors \
|
||||
--nomouse --edit --datadir --resetsoft --ftplog --printwd --slow \
|
||||
--termcap --nosubshell --subshell --view --version --xterm \
|
||||
--debuglevel --help' -- "$cur" ) )
|
||||
else
|
||||
_filedir -d
|
||||
fi
|
||||
} &&
|
||||
complete -F _mc mc
|
||||
|
||||
# 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
|
|
@ -1,84 +0,0 @@
|
|||
# mcrypt(1) completion by Ariel Fermani <the_end@bbs.frc.utn.edu.ar>
|
||||
|
||||
have mcrypt || have mdecrypt &&
|
||||
_mcrypt()
|
||||
{
|
||||
local cur prev i decrypt
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-g|--openpgp-z)
|
||||
COMPREPLY=( $( compgen -W '0 1 2 3 4 5 6 7 8 9' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-o|--keymode)
|
||||
COMPREPLY=( $( compgen -W '$( mcrypt --list-keymodes \
|
||||
2>/dev/null )' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-m|--mode)
|
||||
COMPREPLY=( $( compgen -W "$( mcrypt --list \
|
||||
2>/dev/null | sed -e 's/.*: //' -e 's/ $//' | \
|
||||
sort -u )" -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-a|--algorithm)
|
||||
COMPREPLY=( $( compgen -W "$( mcrypt --list 2>/dev/null | \
|
||||
awk '{print $1}' )" -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-h|--hash)
|
||||
COMPREPLY=( $( compgen -W '$( mcrypt --list-hash 2>/dev/null | \
|
||||
sed -e 1d )' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-k|-s|--key|--keysize)
|
||||
return 0
|
||||
;;
|
||||
-f|-c|--keyfile|--config)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
--algorithms-directory|--modes-directory)
|
||||
_filedir -d
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--openpgp --openpgp-z \
|
||||
--decrypt --keysize --keymode --keyfile \
|
||||
--config --algorithm --algorithms-directory \
|
||||
--mode --modes-directory --hash --key \
|
||||
--noiv --bare --gzip --bzip2 --flush \
|
||||
--doublecheck --unlink --nodelete --time \
|
||||
--force --echo --random --list --list-keymodes \
|
||||
--list-hash --verbose --quiet --help \
|
||||
--version --license' -- "$cur" ) )
|
||||
elif [[ ${COMP_WORDS[0]} == mdecrypt ]]; then
|
||||
_filedir nc
|
||||
else
|
||||
decrypt=0
|
||||
for (( i=1; i < ${#COMP_WORDS[@]}-1; i++ )); do
|
||||
if [[ ${COMP_WORDS[i]} == -@(d|-decrypt) ]]; then
|
||||
_filedir nc
|
||||
decrypt=1
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [[ $decrypt -eq 0 ]]; then
|
||||
_filedir
|
||||
fi
|
||||
fi
|
||||
} &&
|
||||
complete -F _mcrypt mcrypt mdecrypt
|
||||
|
||||
# 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
|
|
@ -1,162 +0,0 @@
|
|||
# bash completion for mdadm
|
||||
|
||||
have mdadm &&
|
||||
{
|
||||
_mdadm_raid_level()
|
||||
{
|
||||
local mode
|
||||
|
||||
for (( i=1; i < COMP_CWORD; i++ )); do
|
||||
case ${COMP_WORDS[i]} in
|
||||
-C|--create)
|
||||
mode=create
|
||||
break
|
||||
;;
|
||||
-B|--build)
|
||||
mode=build
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
case $mode in
|
||||
create)
|
||||
COMPREPLY=( $( compgen -W 'linear raid0 0 stripe raid1 1 mirror \
|
||||
raid4 4 raid5 5 raid6 6 raid10 10 multipath mp faulty' \
|
||||
-- "$cur" ) )
|
||||
;;
|
||||
build)
|
||||
COMPREPLY=( $( compgen -W 'linear stripe raid0 0 raid1 multipath \
|
||||
mp faulty' -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_mdadm_raid_layout()
|
||||
{
|
||||
local level
|
||||
for (( i=1; i < COMP_CWORD; i++ )); do
|
||||
if [[ "${COMP_WORDS[i]}" == -@(l|-level) ]]; then
|
||||
level=${COMP_WORDS[i+1]}
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
case $level in
|
||||
raid5)
|
||||
COMPREPLY=( $( compgen -W 'left-asymmetric left-symmetric \
|
||||
right-asymmetric right-symmetric la ra ls rs' -- "$cur" ) )
|
||||
;;
|
||||
raid10)
|
||||
COMPREPLY=( $( compgen -W 'n o p' -- "$cur" ) )
|
||||
;;
|
||||
faulty)
|
||||
COMPREPLY=( $( compgen -W 'write-transient wt read-transient rt \
|
||||
write-persistent wp read-persistent rp write-all read-fixable \
|
||||
rf clear flush none' -- $cur ) )
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_mdadm_auto_flag()
|
||||
{
|
||||
COMPREPLY=( $( compgen -W 'no yes md mdp part p' -- "$cur" ) )
|
||||
}
|
||||
|
||||
_mdadm_update_flag()
|
||||
{
|
||||
COMPREPLY=( $( compgen -W 'sparc2.2 summaries uuid name homehost resync \
|
||||
byteorder super-minor' -- "$cur" ) )
|
||||
}
|
||||
|
||||
|
||||
_mdadm()
|
||||
{
|
||||
local cur prev mode options split=false
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
case $prev in
|
||||
-c|--config|-b|--bitmap|--backup-file)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-l|--level)
|
||||
_mdadm_raid_level
|
||||
return 0
|
||||
;;
|
||||
-p|--layout|--parity)
|
||||
_mdadm_raid_layout
|
||||
return 0
|
||||
;;
|
||||
-a|--auto)
|
||||
_mdadm_auto_flag
|
||||
return 0
|
||||
;;
|
||||
-U|--update)
|
||||
_mdadm_update_flag
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
$split && return 0
|
||||
|
||||
options='--help --help-options --version --verbose --quiet \
|
||||
--brief --force --config --scan --metadata --homehost'
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
if [[ $COMP_CWORD -eq 1 ]] ; then
|
||||
COMPREPLY=( $( compgen -W "$options --assemble --build \
|
||||
--create --monitor --grow" -- "$cur" ) )
|
||||
else
|
||||
case ${COMP_WORDS[COMP_CWORD-1]} in
|
||||
-A|--assemble)
|
||||
COMPREPLY=( $( compgen -W "$options --uuid \
|
||||
--super-minor --name --force --run \
|
||||
--no-degraded --auto --bitmap --backup-file \
|
||||
--update --auto-update-homehost" -- "$cur" ) )
|
||||
;;
|
||||
-B|-C|-G|--build|--create|--grow)
|
||||
COMPREPLY=( $( compgen -W "$options --raid-devices \
|
||||
--spare-devices --size --chunk --rounding \
|
||||
--level --layout --parity --bitmap \
|
||||
--bitmap-chunk --write-mostly --write-behind \
|
||||
--assume-clean --backup-file --name --run \
|
||||
--force --auto" -- "$cur" ) )
|
||||
;;
|
||||
-F|--follow|--monitor)
|
||||
COMPREPLY=( $( compgen -W "$options --mail --program \
|
||||
--alert --syslog --delay --daemonise \
|
||||
--pid-file --oneshot --test" -- "$cur" ) )
|
||||
|
||||
;;
|
||||
/dev/*|--add|--fail|--remove)
|
||||
COMPREPLY=( $( compgen -W "$options --add --re-add \
|
||||
--remove --fail --set-faulty" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
COMPREPLY=( $( compgen -W "$options --query --detail \
|
||||
--examine --sparc2.2 --examine-bitmap --run \
|
||||
--stop --readonly --readwrite \
|
||||
--zero-superblock --test" -- "$cur" ) )
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
else
|
||||
cur=${cur:=/dev/}
|
||||
_filedir
|
||||
fi
|
||||
}
|
||||
complete -F _mdadm mdadm
|
||||
}
|
||||
|
||||
# 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
|
|
@ -1,41 +0,0 @@
|
|||
# bash completion for medusa
|
||||
|
||||
have medusa &&
|
||||
_medusa()
|
||||
{
|
||||
local cur prev
|
||||
|
||||
COMPREPLY=()
|
||||
cur=`_get_cword`
|
||||
prev=`_get_pword`
|
||||
|
||||
case $prev in
|
||||
-h)
|
||||
_known_hosts_real "$cur"
|
||||
return 0
|
||||
;;
|
||||
-H|-U|-P|-C|-O)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-M)
|
||||
COMPREPLY=( $( compgen -W "$(medusa -d | awk '/^ +\+/ {print $2}' \
|
||||
| sed -e 's/\.mod$//')" ) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-h -H -u -U -p -P -C -O -e -M -m -d -n -s \
|
||||
-g -r -R -t -T -L -f -F -b -q -v -w -V -Z' -- "$cur" ) )
|
||||
fi
|
||||
} &&
|
||||
complete -F _medusa medusa
|
||||
|
||||
# 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
|
|
@ -1,53 +0,0 @@
|
|||
# bash completion for minicom
|
||||
|
||||
have minicom &&
|
||||
_minicom()
|
||||
{
|
||||
local cur prev confdir
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
case $prev in
|
||||
-a|-c)
|
||||
COMPREPLY=( $( compgen -W 'on off' -- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
-S|-C)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
-P)
|
||||
COMPREPLY=( $( printf '%s\n' /dev/tty* ) )
|
||||
COMPREPLY=( $( compgen -W '${COMPREPLY[@]} ${COMPREPLY[@]#/dev/}' \
|
||||
-- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-s -o -m -M -z -l -L -w -a -t \
|
||||
-c -S -d -p -C -T -7 -8' -- "$cur" ) )
|
||||
return 0
|
||||
else
|
||||
[ -n "$( command ls /etc/minirc.* 2>/dev/null)" ] \
|
||||
&& confdir=/etc
|
||||
[ -n "$( command ls /etc/minicom/minirc.* 2>/dev/null)" ] \
|
||||
&& confdir=/etc/minicom
|
||||
if [ -n "$confdir" ]; then
|
||||
COMPREPLY=( $( compgen -W '$( printf "%s\n" $confdir/minirc.* | \
|
||||
sed -e "s|$confdir/minirc.||")' -- "$cur" ) )
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
} &&
|
||||
complete -F _minicom -o default minicom
|
||||
|
||||
# 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
|
|
@ -1,59 +0,0 @@
|
|||
# bash completion for mkinitrd
|
||||
|
||||
have mkinitrd &&
|
||||
_mkinitrd()
|
||||
{
|
||||
local cur prev args split=false
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
case $prev in
|
||||
--preload|--with|--builtin)
|
||||
_modules
|
||||
return 0
|
||||
;;
|
||||
--fstab|--dsdt)
|
||||
_filedir
|
||||
return 0
|
||||
;;
|
||||
--net-dev)
|
||||
_available_interfaces
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
$split && return 0
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '--version --help -v -f --preload \
|
||||
--force-scsi-probe --omit-scsi-modules \
|
||||
--omit-ide-modules --image-version --force-raid-probe \
|
||||
--omit-raid-modules --with --force-lvm-probe \
|
||||
--omit-lvm-modules --builtin --omit-dmraid --net-dev \
|
||||
--fstab --nocompress --dsdt --bootchart' -- "$cur" ) )
|
||||
else
|
||||
_count_args
|
||||
|
||||
case $args in
|
||||
1)
|
||||
_filedir
|
||||
;;
|
||||
2)
|
||||
_kernel_versions
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
} &&
|
||||
complete -F _mkinitrd mkinitrd
|
||||
|
||||
# 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
|
|
@ -1,61 +0,0 @@
|
|||
# bash completion for Linux module-init-tools
|
||||
|
||||
# Linux rmmod(8) completion. This completes on a list of all currently
|
||||
# installed kernel modules.
|
||||
#
|
||||
have rmmod &&
|
||||
_rmmod()
|
||||
{
|
||||
local cur
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
_installed_modules "$cur"
|
||||
return 0
|
||||
} &&
|
||||
complete -F _rmmod rmmod
|
||||
|
||||
# Linux insmod(8), modprobe(8) and modinfo(8) completion. This completes on a
|
||||
# list of all available modules for the version of the kernel currently
|
||||
# running.
|
||||
#
|
||||
have insmod || have modprobe || have modinfo &&
|
||||
_insmod()
|
||||
{
|
||||
local cur prev modpath
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
# behave like lsmod for modprobe -r
|
||||
if [[ ${1##*/} == modprobe && "${COMP_WORDS[1]}" == -r ]]; then
|
||||
_installed_modules "$cur"
|
||||
return 0
|
||||
fi
|
||||
|
||||
# do filename completion if we're giving a path to a module
|
||||
if [[ "$cur" == */* ]]; then
|
||||
_filedir '@(?(k)o?(.gz))'
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ $COMP_CWORD -gt 1 && "${COMP_WORDS[COMP_CWORD-1]}" != -* ]]; then
|
||||
# do module parameter completion
|
||||
COMPREPLY=( $( compgen -W "$( /sbin/modinfo -p ${COMP_WORDS[1]} | \
|
||||
cut -d: -f1 )" -- "$cur" ) )
|
||||
else
|
||||
_modules $(uname -r)
|
||||
fi
|
||||
|
||||
return 0
|
||||
} &&
|
||||
complete -F _insmod insmod modprobe modinfo
|
||||
|
||||
# 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
|
|
@ -1,86 +0,0 @@
|
|||
# Monodevelop completion
|
||||
|
||||
have monodevelop &&
|
||||
_monodevelop()
|
||||
{
|
||||
local cur
|
||||
_get_comp_words_by_ref cur
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-? -help -help2 -ipc-tcp -newwindow -nologo \
|
||||
-usage -V -version' -- "$cur" ) )
|
||||
else
|
||||
_filedir
|
||||
fi
|
||||
return 0
|
||||
} &&
|
||||
complete -F _monodevelop monodevelop
|
||||
|
||||
have mdtool &&
|
||||
_mdtool()
|
||||
{
|
||||
local cur prev command i
|
||||
|
||||
COMPREPLY=()
|
||||
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
|
||||
if [[ ${COMP_WORDS[i]} == @(build|generate-makefiles|setup) ]]; then
|
||||
command=${COMP_WORDS[i]}
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -n "$command" ]]; then
|
||||
case $command in
|
||||
"build")
|
||||
COMPREPLY=( $( compgen -W '--f --buildfile --p --project' \
|
||||
-S":" -- "$cur" ) )
|
||||
# TODO: This does not work :(
|
||||
#if [[ "$prev" == *: ]]; then
|
||||
# case $prev in
|
||||
# @(--p:|--project:))
|
||||
# COMPREPLY=( $( compgen -f -G "*.mdp" -- "$cur" ) )
|
||||
# ;;
|
||||
# @(--f:|--buildfile:))
|
||||
# COMPREPLY=( $( compgen -f -G "*.mdp" -G "*.mds" -- "$cur" ) )
|
||||
# ;;
|
||||
# esac
|
||||
#fi
|
||||
return 0
|
||||
;;
|
||||
"generate-makefiles")
|
||||
_compopt_o_filenames
|
||||
COMPREPLY=( $( compgen -o filenames -G"*.mds" -- "$cur" ) )
|
||||
if [[ "$prev" == *mds ]]; then
|
||||
COMPREPLY=( $( compgen -W '--simple-makefiles --s --d:' \
|
||||
-- "$cur" ) )
|
||||
fi
|
||||
return 0
|
||||
;;
|
||||
"setup")
|
||||
# TODO: at least return filenames after these options.
|
||||
COMPREPLY=( $( compgen -W 'install i uninstall u check-install \
|
||||
ci update up list l list-av la list-update lu rep-add ra \
|
||||
rep-remove rr rep-update ru rep-list rl reg-update \
|
||||
reg-build rgu info rep-build rb pack p help h dump-file' \
|
||||
-- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
COMPREPLY=( $( compgen -W 'gsetup build dbgen project-export \
|
||||
generate-makefiles gettext-update setup -q' -- "$cur" ) )
|
||||
|
||||
return 0
|
||||
} &&
|
||||
complete -F _mdtool mdtool
|
||||
|
||||
# Local variables:
|
||||
# mode: shell-script
|
||||
# sh-basic-offset: 4
|
||||
# sh-indent-comment: t
|
||||
# indent-tabs-mode: nil
|
||||
# End:
|
||||
# ex: ts=4 sw=4 et filetype=sh
|
|
@ -1,165 +0,0 @@
|
|||
# mount(8) completion. This will pull a list of possible mounts out of
|
||||
# /etc/{,v}fstab, unless the word being completed contains a ':', which
|
||||
# would indicate the specification of an NFS server. In that case, we
|
||||
# query the server for a list of all available exports and complete on
|
||||
# that instead.
|
||||
#
|
||||
have mount &&
|
||||
{
|
||||
|
||||
# Just like COMPREPLY=(`compgen -W "${COMPREPLY[*]}" -- "$cur"`), only better!
|
||||
#
|
||||
# This will correctly escape special characters in COMPREPLY.
|
||||
_reply_compgen_array()
|
||||
{
|
||||
# Create the argument for compgen -W by escaping twice.
|
||||
#
|
||||
# One round of escape is because we want to reply with escaped arguments. A
|
||||
# second round is required because compgen -W will helpfully expand it's
|
||||
# argument.
|
||||
local i wlist
|
||||
for i in ${!COMPREPLY[*]}; do
|
||||
local q=$(quote "$(printf %q "${COMPREPLY[$i]}")")
|
||||
wlist+=$q$'\n'
|
||||
done
|
||||
|
||||
# We also have to add another round of escaping to $cur.
|
||||
local ecur="$cur"
|
||||
ecur="${ecur//\\/\\\\}"
|
||||
ecur="${ecur//\'/\'}"
|
||||
|
||||
# Actually generate completions.
|
||||
local oldifs=$IFS
|
||||
IFS=$'\n' eval 'COMPREPLY=(`compgen -W "$wlist" -- "${ecur}"`)'
|
||||
IFS=$oldifs
|
||||
}
|
||||
|
||||
# Unescape strings in the linux fstab(5) format (with octal escapes).
|
||||
__linux_fstab_unescape() {
|
||||
eval $1="'${!1//\'/\047}'"
|
||||
eval $1="'${!1/%\\/\\\\}'"
|
||||
eval "$1=$'${!1}'"
|
||||
}
|
||||
|
||||
# Complete linux fstab entries.
|
||||
#
|
||||
# Reads a file from stdin in the linux fstab(5) format; as used by /etc/fstab
|
||||
# and /proc/mounts.
|
||||
_linux_fstab()
|
||||
{
|
||||
COMPREPLY=()
|
||||
|
||||
# Read and unescape values into COMPREPLY
|
||||
local fs_spec fs_file fs_other
|
||||
local oldifs="$IFS"
|
||||
while read -r fs_spec fs_file fs_other; do
|
||||
if [[ $fs_spec = [#]* ]]; then continue; fi
|
||||
if [[ $1 == -L ]]; then
|
||||
local fs_label=${fs_spec/#LABEL=}
|
||||
if [[ $fs_label != "$fs_spec" ]]; then
|
||||
__linux_fstab_unescape fs_label
|
||||
IFS=$'\0'
|
||||
COMPREPLY+=("$fs_label")
|
||||
IFS=$oldifs
|
||||
fi
|
||||
else
|
||||
__linux_fstab_unescape fs_spec
|
||||
__linux_fstab_unescape fs_file
|
||||
IFS=$'\0'
|
||||
[[ $fs_spec = */* ]] && COMPREPLY+=("$fs_spec")
|
||||
[[ $fs_file = */* ]] && COMPREPLY+=("$fs_file")
|
||||
IFS=$oldifs
|
||||
fi
|
||||
done
|
||||
|
||||
_reply_compgen_array
|
||||
}
|
||||
|
||||
_mount()
|
||||
{
|
||||
local cur sm host prev
|
||||
|
||||
COMPREPLY=()
|
||||
_get_comp_words_by_ref -n : cur prev
|
||||
|
||||
case $prev in
|
||||
-t|--types)
|
||||
_fstypes
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
[[ "$cur" == \\ ]] && cur="/"
|
||||
|
||||
if [[ "$cur" == *:* ]]; then
|
||||
for sm in "$(type -P showmount)" {,/usr}/{,s}bin/showmount; do
|
||||
[ -x "$sm" ] || continue
|
||||
COMPREPLY=( $( compgen -W "$( "$sm" -e ${cur%%:*} | \
|
||||
awk 'NR>1 {print $1}' )" -- "${cur#*:}" ) )
|
||||
return 0
|
||||
done
|
||||
fi
|
||||
|
||||
if [[ "$cur" == //* ]]; then
|
||||
host=${cur#//}
|
||||
host=${host%%/*}
|
||||
if [ -n "$host" ]; then
|
||||
COMPREPLY=( $( compgen -P "//$host" -W \
|
||||
"$( smbclient -d 0 -NL $host 2>/dev/null |
|
||||
sed -ne '/^['"$'\t '"']*Sharename/,/^$/p' |
|
||||
sed -ne '3,$s|^[^A-Za-z]*\([^'"$'\t '"']*\).*$|/\1|p' )" \
|
||||
-- "${cur#//$host}" ) )
|
||||
fi
|
||||
elif [ -r /etc/vfstab ]; then
|
||||
# Solaris
|
||||
COMPREPLY=( $( compgen -W "$( awk '! /^[ \t]*#/ {if ($3 ~ /\//) print $3}' /etc/vfstab )" -- "$cur" ) )
|
||||
elif [ ! -e /etc/fstab ]; then
|
||||
# probably Cygwin
|
||||
COMPREPLY=( $( compgen -W "$( mount | awk '! /^[ \t]*#/ {if ($3 ~ /\//) print $3}' )" -- "$cur" ) )
|
||||
else
|
||||
# probably Linux
|
||||
if [ "$prev" = -L ]; then
|
||||
_linux_fstab -L < /etc/fstab
|
||||
elif [ "$prev" = -U ]; then
|
||||
COMPREPLY=( $( compgen -W '$(sed -ne "s/^[[:space:]]*UUID=\([^[:space:]]*\).*/\1/p" /etc/fstab )' -- "$cur" ) )
|
||||
else
|
||||
_linux_fstab < /etc/fstab
|
||||
fi
|
||||
fi
|
||||
|
||||
return 0
|
||||
} &&
|
||||
complete -F _mount -o default -o dirnames mount
|
||||
|
||||
# umount(8) completion. This relies on the mount point being the third
|
||||
# space-delimited field in the output of mount(8)
|
||||
#
|
||||
have umount &&
|
||||
_umount()
|
||||
{
|
||||
local cur
|
||||
_get_comp_words_by_ref cur
|
||||
COMPREPLY=()
|
||||
|
||||
if [[ $(uname -s) = Linux && -r /proc/mounts ]]; then
|
||||
# Linux /proc/mounts is properly quoted. This is important when
|
||||
# unmounting usb devices with pretty names.
|
||||
_linux_fstab < /proc/mounts
|
||||
else
|
||||
local IFS=$'\n'
|
||||
COMPREPLY=( $( compgen -W '$( mount | cut -d" " -f 3 )' -- "$cur" ) )
|
||||
fi
|
||||
|
||||
return 0
|
||||
} &&
|
||||
complete -F _umount -o dirnames umount
|
||||
|
||||
}
|
||||
|
||||
# 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
Loading…
Reference in New Issue