Commit ffd13e3d authored by Clint Adams's avatar Clint Adams

Imported Upstream version 4.3.11

parent d086725a
This diff is collapsed.
......@@ -6,9 +6,13 @@ _csup
_cvsup
_fetch
_freebsd-update
_fstat
_kld
_pfctl
_portaudit
_portlint
_portmaster
_portsnap
_powerd
_procstat
'
......@@ -2,18 +2,21 @@
_arguments -s \
'-1[disable automatic retries]' \
'-4[Force usage of IPv4 addresses]' \
'-6[Force usage of IPv6 addresses]' \
'-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 -/' \
'-4[force usage of IPv4 addresses]' \
'-6[force usage of IPv6 addresses]' \
'-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:' \
'-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]:lock file:_files' \
'-L[Verbosity level]:verbosity level:(0 1 2)' \
'-p[Server port]:port:_ports' \
'-l[lock file]:lock file:_files' \
'-L[verbosity level]:verbosity level:(0 1 2)' \
'-L0[verbosity level 0]' \
'-L1[verbosity level 1]' \
'-L2[verbosity level 2]' \
'-p[server port]:port:_ports' \
'-r[maximum number of retries]:maximum number of retries:' \
'-s[suppress status checks]' \
'-v[print version information]' \
......
......@@ -2,29 +2,29 @@
# 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]' \
'-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' \
'-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]' \
'-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'
......@@ -2,19 +2,19 @@
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]'
'(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:' \
'-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 fstat
local pids
pids=(${${${(f)"$(/usr/bin/procstat -ah)"}/[[:space:]]#/}/[[:space:]]*[[:space:]](ELF[[:digit:]]#[[:space:]]|-[[:space:]]#)/:})
_arguments -s \
'-f[restrict examination to files open in the same file systems as the named file arguments]' \
'-M[extract values associated with the name list from the specified core]:core:_files' \
'-N[extract the name list from the specified system]:system:' \
'-m[include memory-mapped files in the listing]' \
'-n[numerical format]' \
'-p[report all files open by the specified process]:process id:(($pids))' \
'-u[report all files open by the specified user]:user:_users' \
'-v[verbose mode]' \
'*:files:_files'
#compdef pfctl
local pfctl_flush_modifiers pfctl_optimizer_level pfctl_show_modifiers pfctl_tables_command pfctl_debug_level
pfctl_flush_modifiers=(
'all:flush all'
'info:flush the filter information'
'nat:flush the NAT rules'
'osfp:flush the passive operating system fingerprints'
'queue:flush the queue rules'
'rules:flush the filter rules'
'state:flush the stable table'
'Sources:flush the source tracking table'
'Tables:flush the tables'
)
pfctl_show_modifiers=(
'nat:show the currently loaded NAT rules'
'queue:show the currently loaded queue rules'
'rules:show the currently loaded filter rules'
'Anchors:show the currently loaded anchors directly attached to the main ruleset'
'state:show the contents of the state table'
'Sources:show the contents of the source tracking table'
'info:show filter information'
'labels:show per-rule statistics of filter rules with labels'
'timeouts:show the current global timeouts'
'memory:show the current pool memory hard limits'
'Tables:show the list of tables'
'osfp:show the list of operating system fingerprints'
'Interfaces:show the list of interfaces and interface drivers available to PF'
'all:show all except for the lists of interfaces and operating system fingerprints'
)
pfctl_optimizer_level=(
'none:disable the ruleset optimizer'
'basic:enable basic ruleset optimizations'
'profile:enable basic ruleset optimizations with profiling'
)
pfctl_tables_command=(
'kill:kill a table'
'flush:flush all addresses of a table'
'add:add one or more addresses in a table'
'delete:delete one or more addresses from a table'
'expire:delete addresses which had their statistics cleared more than number seconds ago'
'replace:replace the addresses of the table'
'show:show the content (addresses) of a table'
'test:test if the given addresses match a table'
'zero:clear all the statistics of a table'
'load:load only the table definitions from pf.conf(5)'
)
pfctl_debug_level=(
"none:don\'t generate debug messages"
'urgent:generate debug messages only for serious errors'
'misc:generate debug messages for various errors'
'loud:generate debug messages for common conditions'
)
_iface() {
local pfctl_iface
pfctl_iface=($(pfctl -s Interfaces))
compadd $pfctl_iface
}
_tables() {
local pfctl_tables
pfctl_tables=($(pfctl -s Tables))
compadd $pfctl_tables
}
# TODO:
# Missing -a
#
_arguments -s \
'-F[flush the filter parameters specified by modifier]:modifier:(($pfctl_flush_modifiers))' \
'-A[load only the queue rules present in the rule file]' \
'-D[define macro to be set to value]:macro:' \
'-d[disable the packet filter]' \
'-e[enable the packet filter]' \
'-f[load the rules contained in a file]:configuration file:_files' \
'-g[include output helpful for debugging]' \
'-h[help]' \
'-i[restrict the operation to the given interface]:interface:_iface' \
'-K[kill all of the source tracking entries originating from the specified host or network]:host or network:_hosts' \
'-k[kill all of the state entries originating from the specified host or network]:host or network:_hosts' \
'-m[merge in explicitly given options]' \
'-N[load only the NAT rules present in the rule file]' \
'-n[do not actually load rules, just parse them]' \
'-O[load only the options present in the rule file]' \
'-o[control the ruleset optimizer]:level:(($pfctl_optimizer_level))' \
'-p[use the device file device instead of the default /dev/pf]:device:_files' \
'-q[only print errors and warnings]' \
'-R[load only the filter rules present in the rule file]' \
'-r[perform reverse DNS lookups on states when displaying them]' \
'-s[show the filter parameters specified by modifier]:modifier:(($pfctl_show_modifiers ))' \
'-T[specify the command to apply to the table]:command:(($pfctl_tables_command))' \
'-t[specify the name of the table]:table:_tables' \
'-v[produce more verbose output]' \
'-x[set the debug level]:debug level:(($pfctl_debug_level))' \
'-z[clear per-rule statistics]'
#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'
'-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[fetch the current database]' \
'-q[quiet mode]' \
'-V[show portaudit version number]'\
'-v[verbose mode]' \
'-X[download a fresh database from least days old]:days:' \
'-f[check the packages listed in file]:file:_files' \
'-r[restrict listed vulnerabilities with eregex pattern]:eregex:' \
':pkg-name:'
#compdef portmaster
_portmaster_pkgs() {
compadd "$@" - ${PKG_DBDIR:-/var/db/pkg}/*(/:t)
}
_portmaster_ports() {
local ret=1 _fbsd_ports _fbsd_cat
_fbsd_cat=(${PORTSDIR:-/usr/ports}/[a-z]*(/:t))
if [[ $PREFIX != */* ]] ; then
_wanted cat_packages expl 'category/ports' compadd -S '/' $_fbsd_cat
else
compset -P '*/'
_fbsd_ports=(${PORTSDIR:-/usr/ports}/$IPREFIX/*(/:t))
_wanted cat_packages expl 'category/ports' compadd $_fbsd_ports
fi
return ret
}
_portmaster_pkgs_and_ports() {
local ret=1
_portmaster_pkgs && ret=0
_portmaster_ports && ret=0
return ret
}
_portmaster() {
local specific_args common_args expunge_args standalone_args kid
standalone_args=(
'--clean-distfiles[delete distfiles not associated with an installed ports: interactive]'
'--clean-distfiles-all[delete distfiles not associated with an installed ports]'
'--check-depends[cross-check and update dependency information for all ports]'
'--check-port-dbdir[check for stale entries in /var/db/ports]'
'--list-origins[list directories from /usr/ports for root and leaf ports]'
'-l[list all installed ports by category]'
'-L[list all installed ports by category, and search for updates]'
{'(-help)-h','(-h)--help'}'[display help message]:'
'--version[display the version only]:'
)
specific_args=(
'(-s -r -o)-e[expunge port using pkg_delete, and remove all distfiles]:name of port:_portmaster_pkgs'
'(-e -r -o)-s[clean out stale ports that used to be depended on]'
'(-e -s -o)-r[rebuild the specified port, and all ports that depend on it]:name/glob of port:_portmaster_pkgs'
'(-e -s -r)-o[replace the installed port with a port from a different origin]:new port dir:_portmaster_ports'
)
expunge_args=(
'(-b)-B[prevents creation of the backup package for the installed port]'
'(-d)-D[no cleaning of distfiles]'
'(-D)-d[always clean distfiles]'
)
common_args=(
"(-G)--force-config[run 'make config' for all ports]"
"-C[prevents 'make clean' from being run before building]"
'-H[hide details of the port build and install in a log file]'
"-K[prevents 'make clean' from being run after building]"
'(-B)-b[create and keep a backup package of an installed port]'
'-g[create a package of the new port]'
'-n[run through configure, but do not make or install any ports]'
'-t[recurse dependencies thoroughly, using all-depends-list]'
'-v[verbose output]'
'-w[save old shared libraries before deinstall]'
'-u[unattended mode]'
'(-i)-f[always rebuild ports]'
'(-f)-i[interactive update mode]'
'-m[any arguments to supply to make]:arguments for make:'
'-x[avoid building or updating ports that match this pattern]:glob pattern to exclude from building:'
'-p[specify the full path to a port directory]:a port directory:'
'--show-work[show what dependent ports are, and are not installed]'
'-R[restart an update, skipping ports already up to date]'
'-a[check all ports, update as necessary]'
'-F[fetch distfiles only]'
$expunge_args
$specific_args
)
if (( CURRENT == 2 ));then
_arguments -s \
$standalone_args \
$common_args \
'*:packages and ports:_portmaster_pkgs_and_ports'
else
case "$words[2]" in
--clean-distfiles|--clean-distfiles-all|--check-depends|--check-port-dbdir|--version|-help|-h)
return 0
;;
*)
if (( $words[(I)-(e|r)] ));then
_arguments -s \
'*:packages:_portmaster_pkgs'
elif (( kid=$words[(I)-o] ));then
if (( CURRENT == $kid + 1 ));then
_arguments -s \
'*:ports replacing:_portmaster_ports'
elif (( CURRENT == $kid + 2 )); then
_arguments -s \
'*:package to replace:_portmaster_pkgs'
else
return 0
fi
elif (( $words[(I)-s] ));then
return 0
else
_arguments -s \
$common_args \
'*:packages and ports:_portmaster_pkgs_and_ports'
fi
;;
esac
fi
}
_portmaster "$@"
......@@ -4,20 +4,20 @@ local context state line
typeset -A opt_args
flags=(
'(cron)fetch[Fetch a compressed snapshot or update existing one]'
'(fetch)cron[Sleep rand(3600) seconds, and then fetch updates]'
'(update)extract[Extract snapshot, replacing existing files and dirs]'
'(extract)update[Update ports tree to match current snapshot]'
'(cron)fetch[fetch a compressed snapshot or update existing one]'
'(fetch)cron[sleep rand(3600) seconds, and then fetch updates]'
'(update)extract[extract snapshot, replacing existing files and dirs]'
'(extract)update[update ports tree to match current snapshot]'
)
_arguments -C -s \
'-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]: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' \
'-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]: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
......
......@@ -3,11 +3,11 @@
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)" \
"-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' \
'-P[alternative pidfile]:pidfile:_files' \
'-r[CPU idle percent level where to increase performance]:percent:' \
'-v[Verbose mode]'
'-v[verbose mode]'
#compdef procstat
local pids
#get list of pids and associated process name as comment
pids=(${${${(f)"$(/usr/bin/procstat -ah)"}/[[:space:]]#/}/[[:space:]]*[[:space:]](ELF[[:digit:]]#[[:space:]]|-[[:space:]]#)/:})
_arguments -s \
'-b[display binary information for the process]' \
'-c[display command line arguments for the process]' \
'-f[display file descriptor information for the process]' \
'-k[display the stacks of kernel threads in the process]' \
'-s[display security credential information for the process]' \
'-t[display thread information for the process]' \
'-v[display virtual memory mappings for the process]' \
'-h[suppress table headers]' \
'-a[all processes]' \
':process id:(($pids))'
......@@ -58,7 +58,7 @@ if [[ -n $tmp ]]; then
tmp="\\$tmp"
fi
fi
$pre _wanted aliases expl alias compadd -UQ ${tmp%%[[:blank:]]##}
$pre _wanted aliases expl alias compadd -UQ -- ${tmp%%[[:blank:]]##}
elif (( $#pre )) && zstyle -t ":completion:${curcontext}:" complete; then
$pre _aliases -s "$sel" -S ''
else
......
......@@ -49,13 +49,14 @@ if [[ -z "$_comp_no_ignore" ]]; then
zstyle -s ":completion:${curcontext}:$1" ignore-line hidden &&
case "$hidden" in
true|yes|on|1) _comp_ignore=( "$_comp_ignore[@]" "$words[@]" );;
current) _comp_ignore=( "$_comp_ignore[@]" "$words[CURRENT]" );;
current-shown) [[ "$compstate[old_list]" = *shown* ]] &&
_comp_ignore=( "$_comp_ignore[@]" "$words[CURRENT]" );;
true|yes|on|1) _comp_ignore=( "$_comp_ignore[@]" ${(q)"${words[@]}"} );;
current) _comp_ignore=( "$_comp_ignore[@]" "${(q)words[CURRENT]}" );;
current-shown)
[[ "$compstate[old_list]" = *shown* ]] &&
_comp_ignore=( "$_comp_ignore[@]" "${(q)words[CURRENT]}" );;
other) _comp_ignore=( "$_comp_ignore[@]"
"${(@)words[1,CURRENT-1]}"
"${(@)words[CURRENT+1,-1]}" );;
"${(@q)words[1,CURRENT-1]}"
"${(@q)words[CURRENT+1,-1]}" );;
esac
# Ensure the ignore option is first so we can override it
......
......@@ -2,6 +2,7 @@
local comp pat val name i ret=1 _compskip="$_compskip"
local curcontext="$curcontext" service str noskip
local -a match mbegin mend
# If we get the option `-s', we don't reset `_compskip'.
......@@ -24,6 +25,10 @@ if [[ "$_compskip" != (all|*patterns*) ]]; then
[[ -n "$str" ]] || continue
service="${_services[$str]:-$str}"
for i in "${(@)_patcomps[(K)$str]}"; do
if [[ $i = (#b)"="([^=]#)"="(*) ]]; then
service=$match[1]
i=$match[2]
fi
eval "$i" && ret=0
if [[ "$_compskip" = *patterns* ]]; then
break
......
......@@ -30,7 +30,8 @@ local func funcs ret=1 tmp _compskip format nm call match min max i num\
_saved_lastprompt="${compstate[last_prompt]}" \
_saved_list="${compstate[list]}" \
_saved_insert="${compstate[insert]}" \
_saved_colors="$ZLS_COLORS"
_saved_colors="$ZLS_COLORS" \
_saved_colors_set=${+ZLS_COLORS}
# _precommand sets this to indicate we are following a precommand modifier
local -a precommands
......@@ -325,7 +326,11 @@ fi
compstate[list]="${compstate[list]//messages} force"
if [[ "$compstate[old_list]" = keep ]]; then
ZLS_COLORS="$_saved_colors"
if [[ $_saved_colors_set = 1 ]]; then
ZLS_COLORS="$_saved_colors"
else
unset ZLS_COLORS
fi
elif (( $#_comp_colors )); then
ZLS_COLORS="${(j.:.)_comp_colors}"
else
......
......@@ -8,7 +8,7 @@
#
# Example: telnet
#
# Assume an user sets the style `users-hosts-ports' as for the my-accounts
# Assume a user sets the style `users-hosts-ports' as for the my-accounts
# tag:
#
# zstyle ':completion:*:*:telnet:*:my-accounts' users-hosts-ports \
......
......@@ -127,7 +127,8 @@ while true; do
return
fi
elif (( $#tmp1 )); then
local ret=1
local ret=1 tt
local -a mm
# More than one match. First we get all strings that match the
# rest from the line.
......@@ -144,7 +145,11 @@ while true; do
SUFFIX="$suf"
fi
matches=( "${(@M)matches:#(${(j:|:)~${(q)tmp1}})*}" )
for tt in $tmp1
do
mm+=( "${(@M)matches:#$tt*}" )
done
matches=( $mm )
if ! zstyle -t ":completion:${curcontext}:" expand suffix ||
[[ -n "$menu" || -z "$compstate[insert]" ]]; then
......
......@@ -59,7 +59,7 @@ if compvalues -i "$@"; then
_describe "$descr" \
noargs "$sep[@]" -M 'r:|[_-]=* r:|=*' -- \
args -S "${argsep}" -M 'r:|[_-]=* r:|=*' -- \
opts -qS "${argsep}" -M 'r:|[_-]=* r:|=*'
opts -qS "${argsep}" -r "${argsep}${sep} \\t\\n\\-" -M 'r:|[_-]=* r:|=*'
curcontext="$oldcontext"
......
......@@ -13,7 +13,7 @@ _open() {
_arguments -C \
'-a[specify application]: :->open_mac_applications' \
'-e[open with TextEdit]' \
'-f[Reads input from standard input and opens with TextEdit]' \
'-f[reads input from standard input and opens with TextEdit]' \
'*: :->open_files'
case "$state" in
......
......@@ -36,7 +36,7 @@ _softwareupdate() {
_arguments -R \
'(-h --help -l --list)-q[quiet mode]' \
{-l,--list}'[List all available updates]:*:' \
{-l,--list}'[list all available updates]:*:' \
{-d,--download}'[download to directory set in InternetConfig]:*:' \
{-i,--install}'[install (requires root)]:*: :->install' \
'--ignored[show or manage ignored updates list (per-user)]:*:: :->ignored' \
......
DISTFILES_SRC='
.distfiles
_a2utils _apt _apt-file