mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-02 22:11:54 +02:00
32998: completion function updates
This commit is contained in:
parent
469ee6daef
commit
2be0d8bdef
6 changed files with 136 additions and 37 deletions
|
@ -1,5 +1,9 @@
|
||||||
2014-08-14 Oliver Kiddle <opk@zsh.org>
|
2014-08-14 Oliver Kiddle <opk@zsh.org>
|
||||||
|
|
||||||
|
* 32998: Completion/Unix/Command/_dsh, Completion/Unix/Command/_nm,
|
||||||
|
Completion/Unix/Command/_mosh, Completion/Unix/Command/_rsync,
|
||||||
|
Completion/Unix/Command/_wget: completion function updates
|
||||||
|
|
||||||
* 32997: Completion/Base/Utility/_sequence, Doc/Zsh/compsys.yo,
|
* 32997: Completion/Base/Utility/_sequence, Doc/Zsh/compsys.yo,
|
||||||
Completion/Unix/Command/_mount, Completion/Unix/Command/_nmap,
|
Completion/Unix/Command/_mount, Completion/Unix/Command/_nmap,
|
||||||
Completion/Unix/Command/_pgrep, Completion/Unix/Command/_zip:
|
Completion/Unix/Command/_pgrep, Completion/Unix/Command/_zip:
|
||||||
|
|
33
Completion/Unix/Command/_dsh
Normal file
33
Completion/Unix/Command/_dsh
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
#compdef dsh
|
||||||
|
|
||||||
|
local curcontext="$curcontext" state line expl
|
||||||
|
typeset -A opt_args
|
||||||
|
|
||||||
|
_arguments -s -C -S \
|
||||||
|
'(-v --verbose -q --quiet)'{-v,--verbose}'[verbose output]' \
|
||||||
|
'(-q --quiet -v --verbose)'{-q,--quiet}'[quieter output]' \
|
||||||
|
'(-M --show-machine-names)'{-M,--show-machine-names}'[prepend the host name on output]' \
|
||||||
|
'(-i --duplicate-input)'{-i,--duplicate-input}'[duplicate input given to dsh]' \
|
||||||
|
'(-b --bufsize)'{-b,--bufsize}'[change buffer size used in input duplication]:buffer size for -i (bytes)' \
|
||||||
|
'(-m --machine)'{-m,--machine}'[execute on machine]:machine:{_hosts || _user_at_host}' \
|
||||||
|
'(-n --num-topology)'{-n,--num-topology}'[how to divide the machines]:number' \
|
||||||
|
'(-a --all)'{-a,--all}'[execute on all machines]' \
|
||||||
|
'(-g --group)'{-g,--group}'[execute on group member]:groupname:->groups' \
|
||||||
|
'(-f --file)'{-f,--file}'[use the file as list of machines]:file:_files' \
|
||||||
|
'(-r --remoteshell)'{-r,--remoteshell}'[execute using shell]:remote shell:(rsh ssh)' \
|
||||||
|
'(-o --remoteshellopt)'{-o,--remoteshellopt}'[option to give to remote shell ]:option' \
|
||||||
|
'(-)'{-h,--help}'[display help information]' \
|
||||||
|
'(-w --wait-shell -c --concurrent-shell)'{-w,--wait-shell}'[sequentially execute shell]' \
|
||||||
|
'(-c --concurrent-shell -w --wait-shell)'{-c,--concurrent-shell}'[execute shell concurrently]' \
|
||||||
|
'(-F --forklimit)'{-F,--forklimit}'[concurrent with limit on number]:fork limit' \
|
||||||
|
'(-)'{-V,--version}'[display version information]' \
|
||||||
|
'*::args: _normal' && return
|
||||||
|
|
||||||
|
if [[ $state = groups ]]; then
|
||||||
|
if ! zstyle -s ":completion:$curcontext:dsh-groups" dsh-groups grp; then
|
||||||
|
[[ -e ~/.dsh/group ]] && grp="~/.dsh/group" || return 1
|
||||||
|
fi
|
||||||
|
_path_files -W ~/.dsh/group && return
|
||||||
|
fi
|
||||||
|
|
||||||
|
return 1
|
|
@ -1,12 +1,26 @@
|
||||||
#compdef mosh
|
#compdef mosh
|
||||||
|
|
||||||
|
local curcontext="$curcontext" state line
|
||||||
|
local -a suf
|
||||||
|
|
||||||
_arguments \
|
_arguments \
|
||||||
'--client=:client helper:_command_names -e' \
|
'(-)--help[display help information]' \
|
||||||
'--server=:server helper:_files' \
|
'(-)--version[display version information]' \
|
||||||
'--ssh=:ssh command to run:_files' \
|
"--no-init[don't set terminal init string]" \
|
||||||
'(-a -n)--predict=:when:(adaptive always never)' \
|
'--ssh=[specify ssh command to setup session]:ssh command:_normal' \
|
||||||
'(--predict -n)-a[predict always]' \
|
'--port=[specify server-side port range]:port:_sequence -n 2 -s \: _ports' \
|
||||||
'(--predict -a)-n[predict never]' \
|
'(-a -n)--predict=[control speculative local echo]:mode:(adaptive always never)' \
|
||||||
{-p,--port=}':port:_ports' \
|
'(--predict -n)-a[synonym for --predict=always]' \
|
||||||
':remote:_hosts' \
|
'(--predict -a)-n[synonym for --predict=never]' \
|
||||||
':remote command:_command_names -e'
|
'--server[specify command to run server helper]:remote file:_files' \
|
||||||
|
'--client[specify command to run client helper]:_command_names -e' \
|
||||||
|
'1:remote host name:->userhost' \
|
||||||
|
'*:::args:_normal' && return
|
||||||
|
|
||||||
|
case $state in
|
||||||
|
userhost)
|
||||||
|
_hosts || _user_at_host && return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
return 1
|
||||||
|
|
|
@ -1,30 +1,62 @@
|
||||||
#compdef nm
|
#compdef nm
|
||||||
|
|
||||||
# This is a stub. It's main reason for existence is to offer
|
local args files
|
||||||
# object files with nm. Feel free to extend it. If you do, remove
|
|
||||||
# this comment.
|
|
||||||
|
|
||||||
local state context line expl
|
_nm_object_file() {
|
||||||
local -A opt_args
|
[[ -x $REPLY || $REPLY = *.([ao]|so) ]]
|
||||||
local -a args
|
}
|
||||||
integer ret=1
|
|
||||||
|
|
||||||
if _pick_variant gnu='Free Soft' unix --version; then
|
files="*:object file:_path_files -g '*(-.e:_nm_object_file:)'"
|
||||||
args+=(-s --)
|
args=(
|
||||||
|
'(-A -o --print-file-name)'{-A,-o,--print-file-name}'[print name of input file on each line]'
|
||||||
|
'(--demangle)-C[decode symbol names]'
|
||||||
|
'(-D --dynamic)'{-D,--dynamic}'[display dynamic symbols instead of normal ones]'
|
||||||
|
'(-g --extern-only)'{-g,--extern-only}'[display only global symbols]'
|
||||||
|
'(-t --radix -o -x)'{-t,--radix}'[specify radix for numeric values]:radix:((d\:decimal o\:octal x\:hexadecimal))'
|
||||||
|
)
|
||||||
|
|
||||||
|
if _pick_variant gnu=GNU unix -V; then
|
||||||
|
compset -P '@' && files='*:options file:_files'
|
||||||
|
args+=(
|
||||||
|
'(- *)--help[display help information]'
|
||||||
|
'(- *)--version[display version information]'
|
||||||
|
'(-f --format -P --portability)-B[same as --format=bsd]'
|
||||||
|
'(-C --no-demangle)--demangle=-[decode symbol names]::style:(auto gnu lucid arm hp edg gnu-v3 java gnat)'
|
||||||
|
"(-C --demangle)--no-demangle[don't decode symbol names]"
|
||||||
|
'(-u --undefined-only)--defined-only[display only defined symbols]'
|
||||||
|
'(-f --format -P)'{-f+,--format=}'[specify output format]:format:(bsd sysv posix)'
|
||||||
|
'(-l --line-numbers)'{-l,--line-numbers}'[display source file and line numbers from debug information]'
|
||||||
|
'(-n --numeric-sort -p --no-sort --size-sort)'{-n,--numeric-sort}'[sort symbols numerically by address]'
|
||||||
|
'(-p --no-sort -n --numeric-sort -r -P --reverse-sort --size-sort)'{-p,--no-sort}'[do not sort symbols]'
|
||||||
|
'(-P --portability -B -f --format)'{-P,--portability}'[same as --format=posix]'
|
||||||
|
'(-r --reverse-sort -p --no-sort --size-sort)'{-r,--reverse-sort}'[reverse sort order]'
|
||||||
|
'--plugin[load specified plugin]:plugin'
|
||||||
|
'(-u --undefined-only --defined-only)'{-u,--undefined-only}'[display only undefined symbols]'
|
||||||
|
"--target=[target object format]:targets:(${${(@M)${(f)$(_call_program targets nm --help)}:#*supported targets:*}##*: })"
|
||||||
|
'(-a --debug-syms)'{-a,--debug-syms}'[display debugger-only symbols]'
|
||||||
|
'(-S --print-size)'{-S,--print-size}'[print size of defined symbols]'
|
||||||
|
'(-s --print-armap)'{-s,--print-armap}'[include index for symbols from archive members]'
|
||||||
|
'(-p --no-sort -n --numeric-sort -r)--size-sort[sort symbols by size]'
|
||||||
|
'--special-syms[include special symbols in the output]'
|
||||||
|
'--synthetic[display synthetic symbols as well]'
|
||||||
|
)
|
||||||
|
else
|
||||||
|
# following flags are accurate for Solaris
|
||||||
|
args=( ${args:#(|*\)(\*|))-[o-]*}
|
||||||
|
"-h[don't display column headers]"
|
||||||
|
'-l[distinguish WEAK symbols with * character]'
|
||||||
|
'(-t -x)-o[print values in octal]'
|
||||||
|
'(-v)-n[sort symbols by name]'
|
||||||
|
'(-P)-p[produce parsable output]'
|
||||||
|
'(-p)-P[portable output format]'
|
||||||
|
'(-r)-R[print archive name, object file and symbol name]'
|
||||||
|
'-r[prepend name of input file to each symbol name]'
|
||||||
|
'-s[print section name instead of index]'
|
||||||
|
'-u[print undefined symbols only]'
|
||||||
|
'(-n)-v[sort external symbols by value]'
|
||||||
|
'-V[display version of the nm command]'
|
||||||
|
'(-o -t)-x[print values in hexadecimal]'
|
||||||
|
)
|
||||||
fi
|
fi
|
||||||
args+=('*:file:->file')
|
|
||||||
|
|
||||||
_arguments "$args[@]" && ret=0
|
_arguments -s "$args[@]" $files
|
||||||
|
|
||||||
case $state in
|
|
||||||
(file)
|
|
||||||
_alternative \
|
|
||||||
"object-files:object file:_path_files -g '*.o'" \
|
|
||||||
"executable-files:executable file:_path_files -g '*(*)'" \
|
|
||||||
"dynamic-libraries:dynamic library:_path_files -g '*.so(.*)#'" \
|
|
||||||
"static-libraries:static library:_path_files -g '*.a'" \
|
|
||||||
"directories:directory:_path_files -g '*(/)'" && ret=0
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
return ret
|
|
||||||
|
|
|
@ -74,7 +74,8 @@ _rsync() {
|
||||||
_arguments -s \
|
_arguments -s \
|
||||||
'*'{-v,--verbose}'[increase verbosity]' \
|
'*'{-v,--verbose}'[increase verbosity]' \
|
||||||
{--no-v,--no-verbose}'[turn off --verbose]' \
|
{--no-v,--no-verbose}'[turn off --verbose]' \
|
||||||
'--bwlimit=[limit I/O bandwidth]:KBytes (etc.) per second' \
|
'--bwlimit=[limit I/O bandwidth]:limit (KiB per second)' \
|
||||||
|
'--outbuf=[set output buffering]:buffering:(none line block)' \
|
||||||
'--port=[specify alternate port number]:port:(873)' \
|
'--port=[specify alternate port number]:port:(873)' \
|
||||||
'--address=[bind to the specified address]:bind address:_bind_addresses' \
|
'--address=[bind to the specified address]:bind address:_bind_addresses' \
|
||||||
'(-T --temp-dir)'{-T,--temp-dir=}'[create temporary files in specified directory]:directory:_directories' \
|
'(-T --temp-dir)'{-T,--temp-dir=}'[create temporary files in specified directory]:directory:_directories' \
|
||||||
|
@ -213,6 +214,7 @@ _rsync() {
|
||||||
'--protocol=[force an older protocol version to be used]:number' \
|
'--protocol=[force an older protocol version to be used]:number' \
|
||||||
'--info=[fine-grained informational verbosity]:comma-separated list' \
|
'--info=[fine-grained informational verbosity]:comma-separated list' \
|
||||||
'--debug=[fine-grained debug verbosity]:comma-separated list' \
|
'--debug=[fine-grained debug verbosity]:comma-separated list' \
|
||||||
|
'--msgs2stderr[special output handling for debugging]' \
|
||||||
'--munge-links[munge symlinks to make them safer, but unusable]' \
|
'--munge-links[munge symlinks to make them safer, but unusable]' \
|
||||||
'--ignore-missing-args[ignore missing source args without error]' \
|
'--ignore-missing-args[ignore missing source args without error]' \
|
||||||
'--delete-missing-args[delete missing source args from destination]' \
|
'--delete-missing-args[delete missing source args from destination]' \
|
||||||
|
@ -222,6 +224,7 @@ _rsync() {
|
||||||
'*'{-M=,--remote-option=}'[send option to the remote side only]:option string' \
|
'*'{-M=,--remote-option=}'[send option to the remote side only]:option string' \
|
||||||
'--preallocate[preallocate the full length of new files]' \
|
'--preallocate[preallocate the full length of new files]' \
|
||||||
'--iconv=[request charset conversion of filenames]:number' \
|
'--iconv=[request charset conversion of filenames]:number' \
|
||||||
|
'--checksum-seed=:number' \
|
||||||
'--read-batch=[read a batched update from the specified file]:file:_files'
|
'--read-batch=[read a batched update from the specified file]:file:_files'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ _arguments -C -s \
|
||||||
'(--quiet -q --verbose -v --no-verbose -nv)'{--quiet,-q}'[turn off output]' \
|
'(--quiet -q --verbose -v --no-verbose -nv)'{--quiet,-q}'[turn off output]' \
|
||||||
'(--quiet -q --verbose -v --no-verbose -nv)'{--verbose,-v}'[turn on verbose output]' \
|
'(--quiet -q --verbose -v --no-verbose -nv)'{--verbose,-v}'[turn on verbose output]' \
|
||||||
'*-n+[turn off flags]:flags:->noflags' \
|
'*-n+[turn off flags]:flags:->noflags' \
|
||||||
|
'--report-speed=:type:(bits)' \
|
||||||
'(--input-file -i)'{--input-file=,-i+}'[specify input file]:file containing URLs:_files' \
|
'(--input-file -i)'{--input-file=,-i+}'[specify input file]:file containing URLs:_files' \
|
||||||
'(--force-html -F)'{--force-html,-F}'[treat input file as html]' \
|
'(--force-html -F)'{--force-html,-F}'[treat input file as html]' \
|
||||||
'(--base -B)'{--base=,-B+}'[prepend URL to relative links]:base URL:_urls' \
|
'(--base -B)'{--base=,-B+}'[prepend URL to relative links]:base URL:_urls' \
|
||||||
|
@ -47,6 +48,7 @@ _arguments -C -s \
|
||||||
'--prefer-family[connect first to addresses of specified family]:address family:(IPv6 IPv4 none)' \
|
'--prefer-family[connect first to addresses of specified family]:address family:(IPv6 IPv4 none)' \
|
||||||
'(--http-user --ftp-user)--user[set both ftp and http user]:user' \
|
'(--http-user --ftp-user)--user[set both ftp and http user]:user' \
|
||||||
'(--http-password --ftp-password)--password[set both ftp and http password]:password' \
|
'(--http-password --ftp-password)--password[set both ftp and http password]:password' \
|
||||||
|
'(--password --http-password --ftp-password)--ask-password:[prompt for passwords]' \
|
||||||
'--no-iri[turn off IRI support]' \
|
'--no-iri[turn off IRI support]' \
|
||||||
'--local-encoding=[specify local encoding for IRIs]:encoding' \
|
'--local-encoding=[specify local encoding for IRIs]:encoding' \
|
||||||
'--remote-encoding=[specify default remote encoding]:encoding' \
|
'--remote-encoding=[specify default remote encoding]:encoding' \
|
||||||
|
@ -56,12 +58,13 @@ _arguments -C -s \
|
||||||
'(--directory-prefix -P)'{--directory-prefix=,-P+}'[specify prefix to save files to]:prefix:_files -/' \
|
'(--directory-prefix -P)'{--directory-prefix=,-P+}'[specify prefix to save files to]:prefix:_files -/' \
|
||||||
'--cut-dirs=:number:' \
|
'--cut-dirs=:number:' \
|
||||||
'(--user)--http-user=:user' \
|
'(--user)--http-user=:user' \
|
||||||
'(--password)--http-password=:password' \
|
'(--password --ask-password)--http-password=:password' \
|
||||||
'--no-cache[disallow server-cached data]' \
|
'--no-cache[disallow server-cached data]' \
|
||||||
'--default-page=[specify default page name, normally index.html]' \
|
'--default-page=[specify default page name, normally index.html]' \
|
||||||
'(--adjust-extension -E)'{--adjust-extension,-E}'[save all HTML/CSS documents with proper extensions]' \
|
'(--adjust-extension -E)'{--adjust-extension,-E}'[save all HTML/CSS documents with proper extensions]' \
|
||||||
"--ignore-length[ignore \`Content-Length' header field]" \
|
"--ignore-length[ignore \`Content-Length' header field]" \
|
||||||
'*--header=:string' \
|
'*--header=:string' \
|
||||||
|
'--max-redirect=:number' \
|
||||||
'--proxy-user=:user' \
|
'--proxy-user=:user' \
|
||||||
'--proxy-password=:password' \
|
'--proxy-password=:password' \
|
||||||
'--referer=:URL:_urls' \
|
'--referer=:URL:_urls' \
|
||||||
|
@ -74,9 +77,14 @@ _arguments -C -s \
|
||||||
'--keep-session-cookies[load and save session cookies]' \
|
'--keep-session-cookies[load and save session cookies]' \
|
||||||
'--post-data=[use the POST method with specified data]:data to send' \
|
'--post-data=[use the POST method with specified data]:data to send' \
|
||||||
'--post-file=[use the POST method; sending contents of a file]:file:_files' \
|
'--post-file=[use the POST method; sending contents of a file]:file:_files' \
|
||||||
|
'--method=[use specified HTTP method]:method:(GET POST HEAD DELETE)' \
|
||||||
|
'(--body-file)--body-data=[send string as data]:string' \
|
||||||
|
'(--body-data)--body-file=[send contents of file]:file:_files' \
|
||||||
'--content-disposition[honor the Content-Disposition header when choosing local file names]' \
|
'--content-disposition[honor the Content-Disposition header when choosing local file names]' \
|
||||||
|
'--content-on-error[output received content on server errors]' \
|
||||||
"--auth-no-challenge[send basic HTTP authentication without first waiting for server's challenge]" \
|
"--auth-no-challenge[send basic HTTP authentication without first waiting for server's challenge]" \
|
||||||
'--secure-protocol=[choose secure protocol]:protocol:(SSLv2 SSLv3 TLSv1)' \
|
'--secure-protocol=[choose secure protocol]:protocol:(SSLv2 SSLv3 TLSv1)' \
|
||||||
|
--https-only \
|
||||||
"--no-check-certificate=[don't check the server certificate]" \
|
"--no-check-certificate=[don't check the server certificate]" \
|
||||||
'--certificate=[specify client certificate]:client certificate file:_files' \
|
'--certificate=[specify client certificate]:client certificate file:_files' \
|
||||||
'--certificate-type=[specify client certificate type]:certificate type:(PEM DER)' \
|
'--certificate-type=[specify client certificate type]:certificate type:(PEM DER)' \
|
||||||
|
@ -87,22 +95,27 @@ _arguments -C -s \
|
||||||
'--random-file[specify file with random data for seeding generator]:file:_files' \
|
'--random-file[specify file with random data for seeding generator]:file:_files' \
|
||||||
'--egd-file=[specify filename of EGD socket]:file:_files' \
|
'--egd-file=[specify filename of EGD socket]:file:_files' \
|
||||||
'(--user)--ftp-user=:user' \
|
'(--user)--ftp-user=:user' \
|
||||||
'(--password)--ftp-password=:password' \
|
'(--password --ask-password)--ftp-password=:password' \
|
||||||
"--no-remove-listing[don't remove \`.listing' files]" \
|
"--no-remove-listing[don't remove \`.listing' files]" \
|
||||||
'--no-glob[turn off FTP file name globbing]' \
|
'--no-glob[turn off FTP file name globbing]' \
|
||||||
'--no-passive-ftp' \
|
'--no-passive-ftp' \
|
||||||
'--retr-symlinks' \
|
|
||||||
'--preserve-permissions[preserve remote file permissions with ftp]' \
|
'--preserve-permissions[preserve remote file permissions with ftp]' \
|
||||||
|
'--retr-symlinks' \
|
||||||
|
'--warc-file=:file:_files' --warc-header=:string --warc-max-size=:number \
|
||||||
|
--warc-cdx --warc-dedup=:file:_files --no-warc-compression --no-warc-digests \
|
||||||
|
--no-warc-keep-log --warc-tempdir=:directory:_directories \
|
||||||
'(--recursive -r)'{--recursive,-r}'[recurse subdirectories]' \
|
'(--recursive -r)'{--recursive,-r}'[recurse subdirectories]' \
|
||||||
'(--level -l)'{--level=,-l+}'[specify maximum recursion depth]:level' \
|
'(--level -l)'{--level=,-l+}'[specify maximum recursion depth]:level' \
|
||||||
'--delete-after' \
|
'--delete-after' \
|
||||||
'(--convert-links -k)'{--convert-links,-k}'[convert links to be relative]' \
|
'(--convert-links -k)'{--convert-links,-k}'[convert links to be relative]' \
|
||||||
|
'--backups=:max backups' \
|
||||||
'(--backup-converted -K)'{--backup-converted,-K}'[backup files before conversion]' \
|
'(--backup-converted -K)'{--backup-converted,-K}'[backup files before conversion]' \
|
||||||
'(--mirror -m -r -N -l)'{--mirror,-m}'[mirror (-r -N -l inf --no-remove-listing)]' \
|
'(--mirror -m -r -N -l)'{--mirror,-m}'[mirror (-r -N -l inf --no-remove-listing)]' \
|
||||||
'(--page-requisites -p)'{--page-requisites,-p}'[get all images needed to display page]' \
|
'(--page-requisites -p)'{--page-requisites,-p}'[get all images needed to display page]' \
|
||||||
'--strict-comments[turn on strict (SGML) handling of HTML comments]' \
|
'--strict-comments[turn on strict (SGML) handling of HTML comments]' \
|
||||||
'(--accept -A)'{--accept=,-A+}'[specify accepted extensions]:extensions' \
|
'(--accept -A)'{--accept=,-A+}'[specify accepted extensions]:extensions' \
|
||||||
'(--reject -R)'{--reject=,-R+}'[specify rejected extensions]:extensions' \
|
'(--reject -R)'{--reject=,-R+}'[specify rejected extensions]:extensions' \
|
||||||
|
--{accept,reject}-regex=:regex '--regex-type=:regex type:(posix pcre)' \
|
||||||
'(--domains -D)'{--domains=,-D+}'[specify accepted domains]:domains:_domains' \
|
'(--domains -D)'{--domains=,-D+}'[specify accepted domains]:domains:_domains' \
|
||||||
'--exclude-domains=:rejected domains:_domains' \
|
'--exclude-domains=:rejected domains:_domains' \
|
||||||
'--follow-ftp' \
|
'--follow-ftp' \
|
||||||
|
|
Loading…
Reference in a new issue