Commit 26798b91 authored by Clint Adams's avatar Clint Adams

Imported Upstream version 4.3.9

parent 5286edd8
This diff is collapsed.
DISTFILES_SRC='
.distfiles
_bsd_pkg _cvsup _kld _chflags
_csup _portlint _portsnap
_bsd_pkg
_chflags
_csup
_cvsup
_fetch
_freebsd-update
_kld
_portaudit
_portlint
_portsnap
_powerd
'
......@@ -29,6 +29,8 @@ if [[ $OSTYPE = (freebsd|dragonfly|darwin)* ]]; then
flags=( $flags[@]
'(nouunlnk)uunlnk[set the user undeletable flag]'
'(uunlnk)nouunlnk[unset the user undeletable flag]'
'(nohidden)hidden[set the hidden flag]'
'(hidden)nohidden[unset the hidden flag]'
)
(( EUID )) || flags=( $flags[@]
'(nosunlnk)sunlnk[set the system undeletable flag]'
......
......@@ -4,17 +4,17 @@ _arguments -s \
'-1[disable automatic retries]' \
'-4[Force usage of IPv4 addresses]' \
'-6[Force usage of IPv6 addresses]' \
'-A:local address:_hosts' \
'-b:base directory:_files -/' \
'-c:collections directory:_files -/' \
'-d:maximum number of deleted files:' \
'-h:server host:_hosts' \
'-i:file pattern:' \
'-A[Local address to bind to when connecting to the server]:local address:_hosts' \
'-b[Base directory]:base directory:_files -/' \
'-c[Subdirectory of base for information about collections]:collections directory:_files -/' \
'-d[maximum number of deleted files]:maximum number of deleted files:' \
'-h[Server host]:server host:_hosts' \
'-i[Include only files and directories matching]:file pattern:' \
'-k[keep temporary copies of failed updates]' \
'-l:lock file:_files' \
'-L:verbosity level:(0 1 2)' \
'-p:port:_ports' \
'-r:maximum number of retries:' \
'-l[Lock file]:lock file:_files' \
'-L[Verbosity level]:verbosity level:(0 1 2)' \
'-p[Server port]:port:_ports' \
'-r[maximum number of retries]:maximum number of retries:' \
'-s[suppress status checks]' \
'-v[print version information]' \
'(-Z)-z[enable compression]' \
......
#compdef fetch
# Deprecated arguments are removed from the completion
_arguments -s \
'-1[Stop and return exit code 0 at the first successfully retrieved file]' \
'-4[Forces fetch to use IPv4 addresses only]' \
'-6[Forces fetch to use IPv6 addresses only]' \
'-A[Do not automatically follow "temporary" (302) redirects]' \
'-a[Automatically retry the transfer upon soft failures]' \
'-B[Specify the read buffer size in bytes]:bytes:' \
'-d[Use a direct connection even if a proxy is configured]' \
'-F[In combination with the -r flag, forces a restart]' \
'-l[If the target is a file-scheme URL, make a symbolic link to the target]' \
'-M' \
'-m[Mirror mode]' \
'-N[Use file instead of ~/.netrc to look up login names and pass- words for FTP sites]' \
'-n[Do not preserve the modification time]' \
'-o[Set the output file name]:file:_files' \
'-P' \
'-p[Use passive FTP]' \
'-q[Quiet mode]' \
'-R[Do not delete the output file in any circumstances]' \
'-r[Restart a previously interrupted transfer]' \
'-S[Require the file size reported by the server to match the specified value]' \
'-s[Print the size in bytes, without fetching it]' \
'-T[Set timeout value]:seconds:' \
'-U[When using passive FTP, allocate the port for the data connection from the low port range]' \
'-v[Increase verbosity level]' \
'-w[wait successive retries]:seconds:' \
'*:URL to fetch:_urls'
#compdef freebsd-update
local flags
flags=(
'(cron)fetch[Fetch a compressed snapshot or update existing one]'
'(fetch)cron[Sleep rand(3600) seconds, and then fetch updates]'
'(install rollback)upgrade[Fetch files necessary for upgrading to a new release]'
'(upgrade rollback)install[Install the most recently fetched updates or upgrade]'
'(upgrade install)rollback[Uninstall the most recently installed updates]'
)
_arguments -s \
'-b[Operate on a system mounted at basedir]:basedir:_files -/' \
'-d[Store working files in workdir]:workdir:_files -/' \
'-f[Read configuration options from conffile]:conf file:_files' \
'-k[Trust an RSA key with SHA256 of KEY]:RSA key:' \
'-r[Specify the new release]:new release:' \
'-s[Fetch files from the specified server or server pool]:server:_hosts' \
'-f[Mail output of cron command, if any, to address]:address:' \
':command:_values -S " " -w "commands" $flags[@]'
#compdef portaudit
_arguments -s \
'-a[Vulnerability report for all installed packages]' \
'-C[Vulnerability report for the port in the current working directory]'\
'-d[Print creation date of the database]' \
'-f[Check the packages listed in file]:file:_files' \
'-F[Fetch the current database]' \
'-q[Quiet mode]' \
'-V[Show portaudit version number]'\
'-v[Verbose mode]' \
'-r[Restrict listed vulnerabilities with eregex pattern]:eregex:' \
'-X[Download a fresh database]:days:'\
':pkg-name:_files'
......@@ -12,6 +12,6 @@ _arguments -s \
'-t[nit pick about use of spaces]' \
'-N[writing a new port]' \
'-V[print the version and exit]' \
'-M:set make variables to ENV (ex. PORTSDIR=/usr/ports.work):_guard ".#" "environment vars"' \
'-B:allow # contiguous blank lines:_guard "[0-9]#" "numeric value"' \
'-M[set make variables to ENV (ex. PORTSDIR=/usr/ports.work)]: :_guard ".#" "environment vars"' \
'-B[allow # contiguous blank lines]: :_guard "[0-9]#" "numeric value"' \
':port directory:_files -/'
......@@ -11,13 +11,13 @@ flags=(
)
_arguments -C -s \
'-d:Store working files in workdir:_files -/' \
'-f:Read configuration options from conffile:_files' \
'-d[Store working files in workdir]:workdir:_files -/' \
'-f[Read configuration options from conffile]:conf file:_files' \
'-I[Update INDEX only. (update command only)]' \
'-k:Trust an RSA key with SHA256 hash of KEY:_files' \
'-l:Merge the specified local describes file into the INDEX:_files' \
'-p:Location of uncompressed ports tree:_files -/' \
'-s:Server from which to fetch updates:_hosts' \
'-k[Trust an RSA key with SHA256 hash of KEY]:RSA key:_files' \
'-l[Merge the specified local describes file into the INDEX]:file:_files' \
'-p[Location of uncompressed ports tree]:uncompressed ports tree:_files -/' \
'-s[Server from which to fetch updates]:server:_hosts' \
'*:principal:->principal' && ret=0
if [[ $state == principal ]]; then
......
#compdef powerd
local powerd_mode
powerd_mode=(minimum maximum adaptative)
_arguments -s \
"-a[Mode to use while on AC power]:mode:($powerd_mode)" \
"-b[Mode to use while on battery power]:mode:($powerd_mode)" \
'-i[CPU idle percent level when begin to degrade performance]:percent:' \
"-n[mode to use normally when the AC line state is unknown]:mode:($powerd_mode)" \
'-p[polling interval (in milliseconds) for AC line state and system idle levels]:interval:' \
'-P[Alternative pidfile]:pidfile:_files' \
'-r[CPU idle percent level where to increase performance]:percent:' \
'-v[Verbose mode]'
......@@ -144,7 +144,7 @@ while true; do
SUFFIX="$suf"
fi
matches=( "${(@M)matches:#(${(j:|:)~tmp1})*}" )
matches=( "${(@M)matches:#(${(j:|:)~${(q)tmp1}})*}" )
if ! zstyle -t ":completion:${curcontext}:" expand suffix ||
[[ -n "$menu" || -z "$compstate[insert]" ]]; then
......
......@@ -13,7 +13,11 @@ if zstyle -t ":completion:${curcontext}:" use-cache; then
if [[ -e "$_cache_dir" ]]; then
_message "cache-dir style points to a non-directory\!"
else
(zmodload zsh/files 2>/dev/null; mkdir -p "$_cache_dir" )
# if module load fails, we *should* be okay using normal mkdir so
# we load feature b:mkdir instead of b:zf_mkdir; note that modules
# loaded in a sub-shell don't affect the parent.
( zmodload -F zsh/files b:mkdir; mkdir -m 0700 -p "$_cache_dir"
) 2>/dev/null
if [[ ! -d "$_cache_dir" ]]; then
_message "couldn't create cache-dir $_cache_dir"
return 1
......@@ -27,7 +31,9 @@ if zstyle -t ":completion:${curcontext}:" use-cache; then
if [[ -e "$_cache_ident_dir" ]]; then
_message "cache ident dir points to a non-directory:$_cache_ident_dir"
else
(zmodload zsh/files 2>/dev/null; mkdir -p "$_cache_ident_dir")
# See also rationale in zmodload above
( zmodload -F zsh/files b:mkdir; mkdir -m 0700 -p "$_cache_ident_dir"
) 2>/dev/null
if [[ ! -d "$_cache_ident_dir" ]]; then
_message "couldn't create cache-ident_dir $_cache_ident_dir"
return 1
......
......@@ -55,6 +55,7 @@ _fink_get_packages(){
}
_finkpkgs_caching_policy(){
local -a oldp
oldp=( "$1"(Nmw+1) )
(( $#oldp )) ||
[[ /sw/var/cache/apt/pkgcache.bin -nt "$1" ]] ||
......
......@@ -4,9 +4,10 @@
# Used by _mac_applications and _mac_files_for_application.
_mac_apps_caching_policy () {
# Rebuild if cache is more than a day old
oldp=( "$1"(Nmw+1) )
(( $#oldp ))
# Rebuild if cache is more than a day old
local -a oldp
oldp=( "$1"(Nmw+1) )
(( $#oldp ))
}
......@@ -47,7 +48,7 @@ _mac_apps_old_retrieve () {
# Get single file applications
if ! zstyle -t ":completion:${curcontext}:commands" ignore-single; then
autoload -U zargs
autoload -Uz zargs
local app_cand nargs envvars
app_cand=( ${^app_dir}^*.[a-z]#/..namedfork/rsrc(.UrN,.RN^U) )
envvars="$(builtin typeset -x)"
......
......@@ -15,5 +15,5 @@ _mergechanges _module-assistant _piuparts
_reprepro _schroot _svn-buildpackage
_toolchain-source _update-alternatives _update-rc.d
_uscan _wajig _wanna-build
_vim-addons
_vim-addons _grep-excuses
'
......@@ -571,14 +571,14 @@ _apt_releases () {
_tags apt-releases && compadd -a _apt_releases
}
_apt_caching_policy () {
# rebuild if cache is more than a week old
oldp=( "$1"(mw+1) )
(( $#oldp )) && return 0
_apt_caching_policy () {
local -a oldp
[[ /var/cache/apt/pkgcache.bin -nt "$1" ||
/var/lib/dpkg/available -nt "$1" ]]
}
oldp=( "$1"(mw+1) )
(( $#oldp )) && return 0
[[ /var/cache/apt/pkgcache.bin -nt "$1" ||
/var/lib/dpkg/available -nt "$1" ]]
}
_apt "$@"
......@@ -9,4 +9,5 @@ _arguments \
'(--allversions -a)'{--allversions,-a}'[print all available versions]' \
'(--brief -b)'{--brief,-b}'[brief output]' \
'(--verbose -v)'{--verbose,-v}'[verbose output]' \
'(--help -h)'{--help,-h}'[display help information]'
'(--help -h)'{--help,-h}'[display help information]' \
':package:_deb_packages avail'
......@@ -25,7 +25,8 @@ if [[ CURRENT -eq 1 ]]; then
_wanted cmd expl 'bts command' compadd show bugs close reopen retitle \
reassign merge unmerge tag tags severity forwarded notforwarded help \
clone submitter found notfound block unblock user usertag usertags \
package owner noowner reportspam cache cleancache
package owner noowner reportspam cache cleancache claim unclaim \
subscribe unsubscribe
return
fi
......@@ -125,7 +126,7 @@ case "$words[1]" in
_wanted sep expl 'separator' compadd -S ' ' , .
fi
;;
(submitter|owner)
(submitter)
if [[ CURRENT -eq 2 ]]; then
_message -e bugnum 'bug number'
else
......@@ -135,6 +136,17 @@ case "$words[1]" in
'bang:bang:compadd \!'
fi
;;
(owner|subscribe|unsubscribe)
if [[ CURRENT -eq 2 ]]; then
_message -e bugnum 'bug number'
elif [[ CURRENT -eq 3 ]]; then
_alternative \
'email:email address:_email_addresses -c' \
'bang:bang:compadd \!'
else
_wanted sep expl 'separator' compadd -S ' ' , .
fi
;;
(found|notfound)
if [[ CURRENT -eq 2 ]]; then
_message -e bugnum 'bug number'
......@@ -193,6 +205,17 @@ case "$words[1]" in
'email:email address:_email_addresses -c' \
'all:all:compadd ALL'
;;
(claim|unclaim)
if [[ CURRENT -eq 2 ]]; then
_message -e bugnum 'bug number'
elif [[ CURRENT -eq 3 ]]; then
_alternative \
'email:email address:_email_addresses -c' \
'separator:separator:compadd -S " " , .'
else
_wanted sep expl 'separator' compadd -S ' ' , .
fi
;;
help)
;&
*) _wanted sep expl 'separator' compadd -S ' ' , .
......
#compdef grep-excuses
_arguments \
'(--no-conf --noconf)'{--no-conf,--noconf}'[do not read any config files]' \
'(--wipnity -w)'{--wipnity,-w}'[get information from release.debian.org]' \
'--version[display version information]' \
'--help[display help information]' \
':package:_deb_packages avail'
#compdef lintian
#compdef lintian lintian-info
_arguments -s \
'(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-S,--setup-lab}'[setup or update the laboratory]' \
'(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-R,--remove-lab}'[remove the laboratory directory]' \
'(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-c,--check}'[run all checks over the specified packages]' \
'(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-C,--check-part}'[run only the specified checks]:checks:_values -s , "lintian checks" binaries bin changelog-file chg conffiles cnf control-file dctrl control-files ctl copyright-file cpy cruft deb deb-format dfmt debconf dc debdiff dif debian-readme drm debhelper dh description des etcfiles etc fields fld files fil huge-usr-share hus infofiles info init.d ini manpages man md5sums md5 menus men menu-format mnf perl prl po-debconf pd scripts scr shared-libs shl spelling splr standards-version std' \
'(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-X,--dont-check-part}'[run only the specified checks]:checks:_values -s , "lintian checks" binaries bin changelog-file chg conffiles cnf control-file dctrl control-files ctl copyright-file cpy cruft deb deb-format dfmt debconf dc debdiff dif debian-readme drm debhelper dh description des etcfiles etc fields fld files fil huge-usr-share hus infofiles info init.d ini manpages man md5sums md5 menus men menu-format mnf perl prl po-debconf pd scripts scr shared-libs shl spelling splr standards-version std' \
'(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-u,--unpack}'[unpack up to unpack level]' \
'(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-r,--remove}'[clean packages up to current unpack level]' \
'(-h --help)'{-h,--help}'[help]' \
'(-v --verbose)'{-v,--verbose}'[verbose]' \
'(-V --version)'{-V,--version}'[version]' \
'(-d --debug)'{-d,--debug}'[debug]' \
'--print-version[print unadorned version number]' \
'(-i --info)'{-i,--info}'[print info about violations]' \
'(-I --display-info)'{-I,--display-info}'[also display informational tags]' \
'(-l --unpack-level)'{-l,--unpack-level}'[unpack level]:default unpack level:(0 1 2 none basic contents)' \
'(-o --no-override)'{-o,--no-override}'[do not use the overrides file]' \
'--show-overrides[output tags that have been overridden]' \
'(-U --unpack-info)'{-U,--unpack-info}'[collect informations]:infos:_values -s , "collectibles" changelog-file copyright-file debfiles debian-readme diffstat doc-base-files file-info init.d md5sums menu-files objdump-info override-file scripts source-control-file' \
'(-m --md5sums)'{-m,--md5sums}'[check md5sums when processing a .changes file]' \
'--allow-root[override warning when run with superuser privileges]' \
'--cfg:config file:_files' \
'--lab:laboratory dir:_files -/' \
'--archivedir:archive directory:_files -/' \
'--dist:distribution:(woody sarge sid)' \
'--section:release:(main contrib non-free)' \
'--arch:architecture:(alpha arm hppa hurd-i386 i386 ia64 m68k mips mipsel powerpc s390 sparc)' \
'--root:root directory:_files -/' \
'(-a --all)'{-a,--all}'[check all packages in the distribution]' \
'(-b --binary)'{-b,--binary}'[the following packages are binary]' \
'(-s --source)'{-s,--source}'[the following packages are source]' \
'--udeb[the following packages are udebs]' \
'(-p --packages-file)'{-p,--packages-file}'[process packages listed in file]:list:_files' \
':package:_files -g "*.(changes|deb|dsc)"'
local line cmds ret=1
case "$service" in
(lintian)
_arguments -s \
'(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-S,--setup-lab}'[setup or update the laboratory]' \
'(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-R,--remove-lab}'[remove the laboratory directory]' \
'(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-c,--check}'[run all checks over the specified packages]' \
'(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-C,--check-part}'[run only the specified checks]:checks:_values -s , "lintian checks" binaries bin changelog-file chg conffiles cnf control-file dctrl control-files ctl copyright-file cpy cruft deb deb-format dfmt debconf dc debdiff dif debian-readme drm debhelper dh description des etcfiles etc fields fld files fil huge-usr-share hus infofiles info init.d ini manpages man md5sums md5 menus men menu-format mnf perl prl po-debconf pd scripts scr shared-libs shl spelling splr standards-version std' \
'(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-X,--dont-check-part}'[run only the specified checks]:checks:_values -s , "lintian checks" binaries bin changelog-file chg conffiles cnf control-file dctrl control-files ctl copyright-file cpy cruft deb deb-format dfmt debconf dc debdiff dif debian-readme drm debhelper dh description des etcfiles etc fields fld files fil huge-usr-share hus infofiles info init.d ini manpages man md5sums md5 menus men menu-format mnf perl prl po-debconf pd scripts scr shared-libs shl spelling splr standards-version std' \
'(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-u,--unpack}'[unpack up to unpack level]' \
'(-c -r -u -C -R -S -X --check --check-part --dont-check-part --remove --remove-lab --setup-lab --unpack)'{-r,--remove}'[clean packages up to current unpack level]' \
'(-h --help)'{-h,--help}'[help]' \
'(-v --verbose)'{-v,--verbose}'[verbose]' \
'(-V --version)'{-V,--version}'[version]' \
'(-d --debug)'{-d,--debug}'[debug]' \
'--print-version[print unadorned version number]' \
'(-i --info)'{-i,--info}'[print info about violations]' \
'(-I --display-info)'{-I,--display-info}'[also display informational tags]' \
'(-l --unpack-level)'{-l,--unpack-level}'[unpack level]:default unpack level:(0 1 2 none basic contents)' \
'(-o --no-override)'{-o,--no-override}'[do not use the overrides file]' \
'--show-overrides[output tags that have been overridden]' \
'--color:when:(never always auto)' \
'(-U --unpack-info)'{-U,--unpack-info}'[collect informations]:infos:_values -s , "collectibles" changelog-file copyright-file debfiles debian-readme diffstat doc-base-files file-info init.d md5sums menu-files objdump-info override-file scripts source-control-file' \
'(-m --md5sums)'{-m,--md5sums}'[check md5sums when processing a .changes file]' \
'--allow-root[override warning when run with superuser privileges]' \
'--cfg:config file:_files' \
'--lab:laboratory dir:_files -/' \
'--archivedir:archive directory:_files -/' \
'--dist:distribution:(woody sarge sid)' \
'--section:release:(main contrib non-free)' \
'--arch:architecture:(alpha arm hppa hurd-i386 i386 ia64 m68k mips mipsel powerpc s390 sparc)' \
'--root:root directory:_files -/' \
'(-a --all)'{-a,--all}'[check all packages in the distribution]' \
'(-b --binary)'{-b,--binary}'[the following packages are binary]' \
'(-s --source)'{-s,--source}'[the following packages are source]' \
'--udeb[the following packages are udebs]' \
'(-p --packages-file)'{-p,--packages-file}'[process packages listed in file]:list:_files' \
':package:_files -g "*.(changes|deb|dsc)"' && return 0
;;
(lintian-info)
_arguments -C '1: :->cmds' '*: :->args' && ret=0
case $state in
(cmds)
cmds=(
{-t,--tags}':print long description of arguments'
{-a,--annotate}':annotate override entries from stdin'
)
_describe -t commands 'lintian-info command' cmds && ret=0
;;
(args)
case $line[1] in
-t|--tags)
_wanted tag expl 'tag' compadd $(command awk '/^Tag:/ { print $2 }' /usr/share/lintian/checks/*.desc) && ret=0
;;
esac
;;
esac
;;
esac
return ret
......@@ -108,13 +108,14 @@ _deb_packages () {
_tags packages && compadd "$expl[@]" - "${(@P)cachevar}"
}
_debs_caching_policy () {
# rebuild if cache is more than a week old
oldp=( "$1"(mw+1) )
(( $#oldp )) && return 0
[[ /var/cache/apt/pkgcache.bin -nt "$1" ||
/var/lib/dpkg/available -nt "$1" ]]
}
_debs_caching_policy () {
# rebuild if cache is more than a week old
local -a oldp
oldp=( "$1"(mw+1) )
(( $#oldp )) && return 0
[[ /var/cache/apt/pkgcache.bin -nt "$1" ||
/var/lib/dpkg/available -nt "$1" ]]
}
_deb_packages "$@"
DISTFILES_SRC='
.distfiles
_acpi _analyseplugin
_acpitool
_brctl _fusermount _iptables _iwconfig _losetup
_mii-tool _modutils _mondo _pkgtool _sshfs _tpb
_tpconfig _tune2fs _uml _valgrind _vserver
_lsusb
_yast
_acpi _acpitool _analyseplugin _brctl _chrt
_ethtool _fusermount _ionice _ipset _iptables
_iwconfig _losetup _lsusb _mii-tool _modutils
_mondo _pkgtool _sshfs _strace _tpb
_tpconfig _tune2fs _uml _valgrind _vserver
_yast
'
#compdef chrt
local context state line
typeset -A opt_args
_arguments \
'(* -)'{-h,--help}'[display usage information]' \
'(* -)'{-V,--version}'[output version information]' \
{-v,--verbose}'[display status information]' \
{-p,--pid}'[interpret args as process ID]' \
'(-b --batch -f --fifo -o --other -r --rr)'{-b,--batch}'[set scheduling policy to SCHED_BATCH]' \
'(-b --batch -f --fifo -o --other -r --rr)'{-f,--fifo}'[set scheduling policy to SCHED_FIFO]' \
'(-b --batch -f --fifo -o --other -r --rr)'{-o,--other}'[set policy scheduling policy to SCHED_OTHER]' \
'(-b --batch -f --fifo -o --other -r --rr)'{-r,--rr}'[set scheduling policy to SCHED_RR]' \
'(* -)'{-m,--max}'[show minimum and maximum valid priorities, then exit]' \
'*::command or priority:->cmd_or_prio' \
&& return 0
_chrt_priority()
{
local ty
if (( $+opt_args[-b] || $+opt_args[--batch] ))
then
ty=BATCH
elif (( $+opt_args[-f] || $+opt_args[--fifo] ))
then
ty=FIFO
elif (( $+opt_args[-o] || $+opt_args[--other] ))
then
ty=OTHER
else
ty=RR
fi
local range
range=${${"$(_call_program priorities chrt --max)"#*SCHED_$ty*: }%$'\n'*}
if [[ $range = 0/0 ]]
then
compadd 0
else
_message -e priority "priority in the range $range"
fi
}
if (( $+opt_args[-p] || $+opt_args[--pid] ))
then
if [[ $CURRENT -eq 1 ]]
then
_alternative \
'priority:priority:_chrt_priority' \
'processes:process IDs:_pids'
else
_pids
fi
elif [[ $CURRENT -eq 1 ]]
then
_chrt_priority
else
shift words
(( CURRENT-- ))
_normal
fi
#compdef ethtool
local -a cmds
if [[ $CURRENT -ge 4 ]]; then
case $words[CURRENT-1]; in
rx|tx)
if [[ $words[2] = '-G' ]] && _message -e n 'number of ring entries' || _wanted -x onoff expl 'enabled' compadd off on
;;
autoneg|adaptive-rx|adaptive-tx|raw|sg|tso)
_wanted -x onoff expl 'enabled' compadd off on
;;
rx-usecs|rx-frames|rx-usecs-irq|rx-frames-irq|tx-usecs|tx-frames|tx-usecs-irq|tx-frames-irq|stats-block-usecs|pkt-rate-low|rx-usecs-low|rx-frames-low|tx-usecs-low|tx-frames-low|pkt-rate-high|rx-usecs-high|rx-frames-high|tx-usecs-high|tx-frames-high|sample-interval|rx-mini|rx-jumbo|offset|length|magic|value|phyad|msglvl)
_message -e n 'number'
;;
speed)
_wanted -x speed expl 'speed' compadd 10 100 1000
;;
duplex)
_wanted -x duplex expl 'duplex mode' compadd half full
;;
port)
_wanted -x port expl 'device port' compadd tp aui bnc mii
;;
xcvr)
_wanted -x xcvr expl 'transceiver type' compadd internal external
;;
wol)
_values -s '' 'Wake-on-LAN options' \
'(d)p[Wake on phy activity]' \
'(d)u[Wake on unicast messages]' \
'(d)m[Wake on multicast messages]' \
'(d)b[Wake on broadcast messages]' \
'(d)a[Wake on ARP]' \
'(d)g[Wake on MagicPacket(tm)]' \
'(d)s[Enable SecureOn(tm) password for MagicPacket(tm)]' \
'(p u m b a g s)d[Disable (wake on nothing)]'
;;
sopass)
_message -e secureon 'password - 6 bytes in ethernet MAC hex format (xx:yy:zz:aa:bb:cc)'
;;
*)
case $words[2]; in
-A)
_values -S ' ' -w 'pause options' \
'autoneg[Specify if pause autonegotiation is enabled]' \
'rx[Specify if RX pause is enabled]' \
'tx[Specify if TX pause is enabled]'
;;
-C)
_values -S ' ' -w 'coalescing settings' \
'adaptive-rx' 'adaptive-tx' \
'rx-usecs' 'rx-frames' 'rx-usecs-irq' 'rx-frames-irq' \
'tx-usecs' 'tx-frames' 'tx-usecs-irq' 'tx-frames-irq' \
'stats-block-usecs' \
'pkt-rate-low' \
'rx-usecs-low' 'rx-frames-low' \
'tx-usecs-low' 'tx-frames-low' \
'pkt-rate-high' \
'rx-usecs-high' 'rx-frames-high' \
'tx-usecs-high' 'tx-frames-high' \