From 2270746356368eb20676bbfb26c82c2a06e694ec Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Fri, 22 Aug 2003 16:30:28 +0000 Subject: tidy up of many completions (updates, fixes, improvements and plain aesthetics) --- ChangeLog | 30 + Completion/Base/Utility/_nothing | 3 + Completion/Debian/Command/_bug | 230 +++---- Completion/Debian/Command/_debchange | 19 +- Completion/Debian/Command/_debfoster | 149 ++--- Completion/Debian/Command/_dpkg | 93 +-- Completion/Debian/Command/_dpkg_source | 28 + Completion/Debian/Command/_dput | 37 +- Completion/Debian/Command/_dupload | 35 +- Completion/Debian/Command/_update-alternatives | 59 ++ Completion/Redhat/Command/_rpm | 315 +++++---- Completion/Unix/Command/.distfiles | 2 +- Completion/Unix/Command/_apm | 41 ++ Completion/Unix/Command/_arping | 36 +- Completion/Unix/Command/_cvs | 372 +++++------ Completion/Unix/Command/_fakeroot | 10 + Completion/Unix/Command/_fsh | 38 +- Completion/Unix/Command/_global | 68 +- Completion/Unix/Command/_global_tags | 9 - Completion/Unix/Command/_imagemagick | 490 ++++++++------ Completion/Unix/Command/_irssi | 59 +- Completion/Unix/Command/_mysql_utils | 213 ++++++ Completion/Unix/Command/_pbm | 891 +++++++++++++++++++++++++ Completion/Unix/Command/_rsync | 193 +++--- Completion/Unix/Command/_slrn | 25 + Completion/Unix/Command/_user_admin | 8 +- Completion/Unix/Type/.distfiles | 2 +- Completion/Unix/Type/_global_tags | 4 + Completion/X/Type/_x_color | 34 + 29 files changed, 2385 insertions(+), 1108 deletions(-) create mode 100644 Completion/Base/Utility/_nothing create mode 100644 Completion/Debian/Command/_dpkg_source create mode 100644 Completion/Debian/Command/_update-alternatives create mode 100644 Completion/Unix/Command/_apm create mode 100644 Completion/Unix/Command/_fakeroot delete mode 100644 Completion/Unix/Command/_global_tags create mode 100644 Completion/Unix/Command/_mysql_utils create mode 100644 Completion/Unix/Command/_pbm create mode 100644 Completion/Unix/Command/_slrn create mode 100644 Completion/Unix/Type/_global_tags create mode 100644 Completion/X/Type/_x_color diff --git a/ChangeLog b/ChangeLog index 8cf2a1835..0e1475b48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,10 @@ * 18947: Completion/Unix/Command/_chown: also complete options using _arguments +2003-08-19 Adam Spiers + + * unposted: Completion/Unix/Command/_irssi: fix quoting bug. + 2003-08-16 Doug Kearns * 18944: Completion/Unix/Command/_ruby: update ruby completion for @@ -30,6 +34,8 @@ * 18928: Completion/Unix/Command/_cdrecord: new cdrecord completion + * 18927: Completion/Unix/Command/_cvs: fix recent mistake with quoting + 2003-08-01 Peter Stephenson * 18920: Src/utils.c, Completion/Core/Base/_main_complete: update @@ -45,6 +51,30 @@ * 18916: Src/utils.c: Unsetting IFS could cause segmentation fault (any time IFS was used to join an array). +2003-07-31 Oliver Kiddle + + * 18914: Completion/Base/Utility/_nothing, + Completion/Debian/Command/_auto-apt, Completion/Debian/Command/_bug, + Completion/Debian/Command/_debchange, + Completion/Debian/Command/_debfoster, + Completion/Debian/Command/_debsign, Completion/Debian/Command/_dpkg, + Completion/Debian/Command/_dpkg_source, + Completion/Debian/Command/_dput, Completion/Debian/Command/_dupload, + Completion/Debian/Command/_update-alternatives, + Completion/Linux/Command/_iptables, + Completion/Linux/Command/_pkgtool, Completion/Redhat/Command/_rpm, + Completion/Unix/Command/_apm, Completion/Unix/Command/_arping, + Completion/Unix/Command/_cvs, Completion/Unix/Command/_fakeroot, + Completion/Unix/Command/_fsh, Completion/Unix/Command/_global, + Completion/Unix/Type/_global_tags, Completion/Unix/Command/_vorbis, + Completion/Unix/Command/_imagemagick, Completion/Unix/Command/_irssi, + Completion/Unix/Command/_mysql_utils, Completion/Unix/Command/_pbm, + Completion/Unix/Command/_rar, Completion/Unix/Command/_rsync, + Completion/Unix/Command/_slrn, Completion/Unix/Command/_user_admin, + Completion/X/Command/_acroread, Completion/X/Type/_x_color: + tidy up a number of completion functions (includes fixes, updates, + improvements and simple aesthetic changes) + 2003-07-24 Oliver Kiddle * 18901: baptiste daroussin (and Nikolai Weibull, 18894): diff --git a/Completion/Base/Utility/_nothing b/Completion/Base/Utility/_nothing new file mode 100644 index 000000000..1f69155ae --- /dev/null +++ b/Completion/Base/Utility/_nothing @@ -0,0 +1,3 @@ +#compdef true false log times clear logname whoami sync + +_message 'no argument or option' diff --git a/Completion/Debian/Command/_bug b/Completion/Debian/Command/_bug index 8b87867c7..9bd2cb569 100644 --- a/Completion/Debian/Command/_bug +++ b/Completion/Debian/Command/_bug @@ -2,140 +2,104 @@ local _bug_commonargs _rb_commonargs -_bug_commonargs=('-d[debug: send mail to postmaster@localhost]' \ - '-m[maintainer-only]' \ - '-p[print to stdout instead of mail]' \ - '-h[help]' \ - '*:package:_deb_packages installed') +_bug_commonargs=( + '-d[debug: send mail to postmaster@localhost]' + '-m[maintainer-only]' + '-p[print to stdout instead of mail]' + '-h[help]' + '*:package:_deb_packages installed' +) - -_rb_commonargs=('(--bts)-B[use alternate BTS]:system:(debian gnome kde tdyc kde-debian)' \ - '(-B)--bts=:system:(debian gnome kde tdyc kde-debian)' \ - '(--ldap)-l[enable LDAP support]' \ - '(-l)--ldap' \ - '--no-ldap[disable LDAP support]' \ - '(--http_proxy)--proxy=:proxyhost:_hosts' \ - '(--proxy)--http_proxy=:proxyhost:_hosts') +_rb_commonargs=( + '(-B --bts)'{-B,--bts=}'[use alternate BTS]:system:(debian gnome kde tdyc kde-debian)' + '(-l --ldap)'{-l,--ldap}'[enable LDAP support]' + '(-l --ldap)--no-ldap[disable LDAP support]' + '(--http_proxy)--proxy=:proxyhost:_hosts' + '(--proxy)--http_proxy=:proxyhost:_hosts' +) case "$service" in -bug) -_arguments '-c[exclude configs from report]' \ - '-f[argument is a file, not a package]' \ - '-H[special header]:custom header:' \ - '-q[quiet - no e-mail forwarding]' \ - '-s[set subject]:subject:' \ - '-S[set severity]:severity:(wishlist normal important serious grave critical)' \ - '-v[version]' \ - '-x[do not cc submitter]' \ - '-z[send configs verbatim]' \ - "$_bug_commonargs[@]" -;; - -reportbug) -_arguments '(--no-config-files)-c[exclude configs from report]' \ - '(-c)--no-config-files' \ - '(--filename)-f[argument is a file, not a package]:filename:_files' \ - '(-f)--filename=:filename:_files' \ - '(--header)-H[special header]:custom header:' \ - '(-H)--header=:custom header:' \ - '(--subject)-s[set subject]:subject:' \ - '(-s)--subject=:subject:' \ - '(--severity)-S[set severity]:severity:(wishlist normal important serious grave critical)' \ - '(-S)--severity=:severity:(wishlist normal important serious grave critical)' \ - '(--no-cc)-x[do not cc submitter]' \ - '(-x)--no-cc' \ - '(--no-compress)-z[send configs verbatim]' \ - '(-z)--no-compress[send configs verbatim]' \ - '(--af)-a[use af instead of editor]' \ - '(-a)--af[use af instead of editor]' \ - '(--no-bts-query)-b[do not check bts]' \ - '(-b)--no-bts-query' \ - '(--gpg --gnupg)-g[sign report with GnuPG]' \ - '(-g --gpg)--gnupg[sign report with GnuPG]' \ - '(-g --gnupg)--gpg[sign report with GnuPG]' \ - '(--include)-i[include text]:include file:_files' \ - '(-i)--include=:include file:_files' \ - '(--attach)-A[attach file]:attachment:_files' \ - '(-A)--attach=:attachment:_files' \ - '(--mutt)-M[use mutt instead of editor]' \ - '(-M)--mutt' \ - '(--gnus)-G[use GNUS instead of editor]' \ - '(-G)--gnus' \ - '(--editor)-e[use specified editor instead of editor]:editor:' \ - '(-e)--editor=:editor:' \ - '--mua=[use specified mua instead of editor]' \ - '--mta=[use specified mta]' \ - '(--nmh --mh)-n[use comp instead of editor]' \ - '(-n --mh)--nmh' \ - '(--nmh -n)--mh' \ - '(--output)-o[output to file instead of mail]:output file:_files' \ - '(-o)--output=:output file:_files' \ - '(--pgp)-P[sign report with PGP]' \ - '(-P)--pgp' \ - '(--class)-C:GNATS report class:' \ - '(-C)--class=:GNATS report class:' \ - '--realname=:real name:' \ - '(--replyto)--reply-to=' \ - '(--reply-to)--replyto=' \ - '--email=:originating address:' \ - '--smtphost=:SMTP server:_hosts' \ - '(--print)-p[print to stdout instead of mail]' \ - '(-p)--print' \ - '(--quiet)-q[reduce verbosity of output]' \ - '(-q)--quiet' \ - '(--no-query-source)--query-source' \ - '(--query-source)--no-query-source' \ - '(--no-debconf)--debconf' \ - '(--debconf)--no-debconf' \ - '(--query-only)-Q[do not submit]' \ - '(-Q)--query-only' \ - '(--justification)-j:justification:' \ - '(-j)--justification=:justification:' \ - '(--package-version)-V:package version:' \ - '(-V)--package-version=:package version:' \ - '(--interface)-u:user interface:' \ - '(-u)--interface=:user interface:' \ - '(--type)-t:type of report:' \ - '(-t)--type=:type of report:' \ - '--template[output a template report only]' \ - '--configure[reconfigure reportbug for this user]' \ - '(--no-check-available)--check-available' \ - '(--check-available)--no-check-available' \ - '--mode=' \ - '(--verify --no-verify)-v[verify integrity with debsums]' \ - '(--no-verify -v)--verify' \ - '(--verify -v)--no-verify' \ - '(--kudos)-k[send appreciative email to maintainer]' \ - '(-k)--kudos' \ - '--mirror=:BTS mirror:_hosts' \ - '--list-cc=:carbon copy:' \ - '--report-quiet' \ - '(--offline)-O[disable external queries]' \ - '(-O)--offline' \ - '(--query-bts --no-query-bts)-b[do not query BTS]' \ - '(-b --query-bts)--no-query-bts' \ - '(-b --no-query-bts)--query-bts' \ - '(--tags)-T[add specified tags]:tags:' \ - '(-T)--tags=:tags:' \ - '(-p)--print[print to stdout instead of mail]' \ - '(-m)--maintonly' \ - '(-d)--debug' \ - '--version' \ - '--license' \ - "$_bug_commonargs[@]" \ - "$_rb_commonargs[@]" -;; - -querybts) -_arguments '(--web)-w[launch external web browser]' \ - '(-w)--web' \ - '(--archive)-A[Browse archived bugs]' \ - '(-A)--archive' \ - '(--source)-s[Query for source packages rather than binary]' \ - '(-s)--source' \ - '(--version)-v[show version]' \ - '(-v)--version' \ - "$_rb_commonargs[@]" \ - '*:package:_deb_packages avail' - + bug) + _arguments \ + '-c[exclude configs from report]' \ + '-f[argument is a file, not a package]' \ + '-H[special header]:custom header:' \ + '-q[quiet - no e-mail forwarding]' \ + '-s[set subject]:subject:' \ + '-S[set severity]:severity:(wishlist normal important serious grave critical)' \ + '-v[version]' \ + '-x[do not cc submitter]' \ + '-z[send configs verbatim]' \ + "$_bug_commonargs[@]" + ;; + reportbug) + _arguments \ + '(-c --no-config-files)'{-c,--no-config-files}'[exclude configs from report]' \ + '(-f --filename)'{-f,--filename=}'[argument is a file, not a package]:filename:_files' \ + '(-H --header)'{-H,--header=}'[special header]:custom header' \ + '(-s --subject)'{-s,--subject=}'[set subject]:subject' \ + '(-S --severity)'{-S,--severity=}'[set severity]:severity:(wishlist normal important serious grave critical)' \ + '(-x --no-cc)'{-x,--no-cc}'[do not cc submitter]' \ + '(-z --no-compress)'{-z,--no-compress}'[send configs verbatim]' \ + '(-a --af)'{-a,--af}'[use af instead of editor]' \ + '(-b --no-bts-query)'{-b,--no-bts-query}'[do not check bts]' \ + '(-g --gpg --gnupg)'{-g,--gpg,--gnupg}'[sign report with GnuPG]' \ + '(-i --include)'{-i,--include}'[include text]:include file:_files' \ + '(-A --attach)'{-A,--attach=}'[attach file]:attachment:_files' \ + '(-M --mutt)'{-M,--mutt}'[use mutt instead of editor]' \ + '(-G --gnus)'{-G,--gnus}'[use GNUS instead of editor]' \ + '(-e --editor)'{-e,--editor=}'[use specified editor instead of editor]:editor' \ + '--mua=[use specified mua instead of editor]' \ + '--mta=[use specified mta]' \ + '(-n --nmh --mh)'{-n,--nmh,--mh}'[use comp instead of editor]' \ + '(-o --output)'{-o,--output=}'[output to file instead of mail]:output file:_files' \ + '(-P --pgp)'{-P,--pgp}'[sign report with PGP]' \ + '(-C --class)'{-C,--class=}':GNATS report class' \ + '--realname=:real name' \ + '(--replyto)--reply-to=' \ + '(--reply-to)--replyto=' \ + '--email=:originating address:_email_addresses' \ + '--smtphost=:SMTP server:_hosts' \ + '(-p --print)'{-p,--print}'[print to stdout instead of mail]' \ + '(-q --quiet)'{-q,--quiet}'[reduce verbosity of output]' \ + '(--no-query-source)--query-source' \ + '(--query-source)--no-query-source' \ + '(--no-debconf)--debconf' \ + '(--debconf)--no-debconf' \ + '(-Q --query-only)'{-Q,--query-only}'[do not submit]' \ + '(-j --justification)'{-j,--justification=}':justification' \ + '(-V --package-version)'{-V,--package-version=}':package version' \ + '(-u --interface)'{-u,--interface=}':user interface' \ + '(-t --type)'{-t,--type=}':type of report' \ + '--template[output a template report only]' \ + '--configure[reconfigure reportbug for this user]' \ + '(--no-check-available)--check-available' \ + '(--check-available)--no-check-available' \ + '--mode=' \ + '(-v --verify --no-verify)'{-v,--verify}'[verify integrity with debsums]' \ + '(--verify -v)--no-verify' \ + '(-k --kudos)'{-k,--kudos}'[send appreciative email to maintainer]' \ + '--mirror=:BTS mirror:_hosts' \ + '--list-cc=:carbon copy:' \ + '--report-quiet' \ + '(-O --offline)'{-O,--offline}'[disable external queries]' \ + '(-n --no-query-bts --query-bts)'{-b,--no-query-bts}'[do not query BTS]' \ + '(-b --no-query-bts)--query-bts' \ + '(-T --tags)'{-T,--tags=}'[add specified tags]:tags' \ + '(-m)--maintonly' \ + '(-d)--debug' \ + '--version' \ + '--license' \ + "$_bug_commonargs[@]" \ + "$_rb_commonargs[@]" + ;; + querybts) + _arguments \ + '(-w --web)'{-w,--web}'[launch external web browser]' \ + '(-A --archive)'{-A,--archive}'[browse archived bugs]' \ + '(-s --source)'{-s,--source}'[query for source packages rather than binary]' \ + '(-v --version)'{-v,--version}'[show version]' \ + "$_rb_commonargs[@]" \ + '*:package:_deb_packages avail' + ;; esac diff --git a/Completion/Debian/Command/_debchange b/Completion/Debian/Command/_debchange index 689329370..960194ce7 100644 --- a/Completion/Debian/Command/_debchange +++ b/Completion/Debian/Command/_debchange @@ -1,15 +1,10 @@ #compdef debchange dch=debchange _arguments \ - '(--help)-h[help]' \ - '(-h)--help' \ - '--version' \ - '(--append -a --newversion -v --increment)-i[increment]' \ - '(--append -a --newversion -v -i)--increment' \ - '(--increment -i --newversion -v --append)-a[append]' \ - '(--increment -i --newversion -v -a)--append' \ - '(--append -a --increment -i --newversion)-v[newversion]:version:' \ - '(--append -a --increment -i -v)--newversion:version:' \ - '(--preserve)-p[preserve]' \ - '(-p)--preserve' \ - ':text:' + '(-h --help)'{-h,--help}'[display help information]' \ + '--version' \ + '(--append -a --newversion -v --increment -i)'{-i,--increment}'[increment release or version number]' \ + '(--append -a --newversion -v --increment -i)'{-a,--append}'[add new changelog entry]' \ + '(--append -a --newversion -v --increment -i)'{-v,--newversion}'[specify new version number]:version:' \ + '(--preserve -p)'{-p,--preserve}'[preserve source tree directory name]' \ + ':text:' diff --git a/Completion/Debian/Command/_debfoster b/Completion/Debian/Command/_debfoster index 8f7f1b082..154d0e913 100644 --- a/Completion/Debian/Command/_debfoster +++ b/Completion/Debian/Command/_debfoster @@ -1,93 +1,68 @@ #compdef debfoster -_arguments \ -'(--verbose)-v[be a loudmouth]' \ -'(-v)--verbose[be a loudmouth]' \ -'(--version)-V[show version and copyright information]' \ -'(-V)--version[show version and copyright information]' \ -'(--help)-h[show this message]' \ -'(-h)--help[show this message]' \ -'(--quiet)-q[silently build keeper file]' \ -'(-q)--quiet[silently build keeper file]' \ -'(--force)-f[force system to conform to keeper file]' \ -'(-f)--force[force system to conform to keeper file]' \ -'(--mark-only)-m[do not install or delete packages]' \ -'(-m)--mark-only[do not install or delete packages]' \ -'(--upgrade)-u[try to upgrade dependencies]' \ -'(-u)--upgrade[try to upgrade dependencies]' \ -'(--config FILE)-c[specify configuration file]' \ -'(-c)--config FILE[specify configuration file]' \ -'(--keeperfile FILE)-k[specify keeper file]' \ -'(-k)--keeperfile FILE[specify keeper file]' \ -'(--no-keeperfile)-n[do not read keeper file]' \ -'(-n)--no-keeperfile[do not read keeper file]' \ -'(--ignore-default-rules)-i[ignore default rules]' \ -'(-i)--ignore-default-rules[ignore default rules]' \ -'(--show-keepers)-a[show packages on keeper list]' \ -'(-a)--show-keepers[show packages on keeper list]' \ -'(--show-orphans)-s[show orphaned packages]' \ -'(-s)--show-orphans[show orphaned packages]' \ -'(--show-depends)-d[show all depends of PACKAGE]:package:_deb_packages avail' \ -'(-d)--show-depends[show all depends of PACKAGE]:package:_deb_packages avail' \ -'(--show-dependents)-e[show dependents of PACKAGE]:package:_deb_packages avail' \ -'(-e)--show-dependents[show dependents of PACKAGE]:package:_deb_packages avail' \ -'(--show-providers)-p[show packages providing PACKAGE]:package:_deb_packages avail' \ -'(-p)--show-providers[show packages providing PACKAGE]:package:_deb_packages avail' \ -'(--show-related)-r[show packages brought in by PACKAGE]:package:_deb_packages avail' \ -'(-r)--show-related[show packages brought in by PACKAGE]:package:_deb_packages avail' \ -'(--use-tasks)-t[make tasks visible as packages]' \ -'(-t)--use-tasks[make tasks visible as packages]' \ -'*-'{-option,o}'[override any configuration option]:option string:->option' \ -'*:package markings: _alternative "installed:installed packages:_deb_packages -S- installed" "uninstalled:uninstalled packages:_deb_packages uninstalled"' \ -&& return 0 +local curcontext="$curcontext" state line expl ret=1 -ret=1 +_arguments -C \ + '(-v --verbose)'{-v,--verbose}'[be a loudmouth]' \ + '(-V --version)'{-V,--versuib}'[show version and copyright information]' \ + '(-h --help)'{-h,--help}'[show help information]' \ + '(-q --quiet)'{-q,--quiet}'[silently build keeper file]' \ + '(-f --force)'{-f,--force}'[force system to conform to keeper file]' \ + '(-m --mark-only)'{-m,--mark-only}'[do not install or delete packages]' \ + '(-u --upgrade)'{-u,--upgrade}'[try to upgrade dependencies]' \ + '(-c --config)'{-c,--config}'[specify configuration file]:file:_files' \ + '(-k --keeperfile)'{-k,--keeperfile}'[specify keeper file]:file:_files' \ + '(-n --no-keeperfile)'{-n,--no-keeperfile}'[do not read keeper file]' \ + '(-i --ignore-default-rules)'{-i,--ignore-default-rules}'[ignore default rules]' \ + '(-a --show-keepers)'{-a,--show-keepers}'[show packages on keeper list]' \ + '(-s --show-orphans)'{-s,--show-orphans}'[show orphaned packages]' \ + '(-d --show-depends)'{-d,--show-depends}'[show all depends of specified package]:package:_deb_packages avail' \ + '(-e --show-dependents)'{-e,--show-dependents}'[show dependents of specified package]:package:_deb_packages avail' \ + '(-p --show-providers)'{-p,--show-providers}'[show packages providing specified package]:package:_deb_packages avail' \ + '(-r --show-related)'{-r,--show-related}'[show packages brought in by specified package]:package:_deb_packages avail' \ + '(-t --use-tasks)'{-t,--use-tasks}'[make tasks visible as packages]' \ + '*-'{-option,o}'[override any configuration option]:option string:->option' \ + '*:package markings: _alternative "installed:installed packages:_deb_packages -S- installed" "uninstalled:uninstalled packages:_deb_packages uninstalled"' \ + && ret=0 -while [[ -n "$state" ]]; do - lstate="$state" - state='' - - case "$lstate" in - option) - if compset -P '*='; then - case "$IPREFIX" in - *(#i)(install|remove|info)cmd*) - _wanted values expl 'command string' _command && ret=0 - ;; - *(#i)(keeperfile|dpkg(status|available))*) - _wanted values expl 'metadata file' _files && ret=0 - ;; - *(#i)maxpriority*) - _wanted values expl 'package priority' \ - compadd required important standard optional extra ANY && ret=0 - ;; - *(#i)(use(hold|essential|predepends|recommends|suggests|tasks)|negativekeepers|verbose|force|quiet)*) - _wanted values expl 'truth value' \ - compadd yes no && ret=0 - ;; - *(#i)(no|)keepsections*) - _wanted values expl 'section' \ - compadd x11 web utils text tex sound shells science \ - otherosfs oldlibs news net misc math mail libs \ - interpreters hamradio graphics games electronics \ - editors doc devel comm base admin && ret=0 - ;; - *(#i)guessdepends*) - _wanted values expl 'name extension' \ - compadd doc dev && ret=0 - ;; - esac - else - _wanted values expl 'configure file option' \ - compadd -M 'm:{a-z}={A-Z}' -S '=' - \ - InstallCmd RemoveCmd InfoCmd KeeperFile DpkgStatus \ - DpkgAvailable MaxPriority UseHold UseEssential \ - UsePreDepends UseRecommends UseSuggests UseTasks \ - KeepSections NokeepSections GuessDepends NegativeKeepers \ - Verbose Force Quiet && ret=0 - fi - ;; - esac -done +if [[ -n "$state" ]]; then + if compset -P '*='; then + case "$IPREFIX" in + *(#i)(install|remove|info)cmd*) + _wanted values expl 'command string' _command && ret=0 + ;; + *(#i)(keeperfile|dpkg(status|available))*) + _wanted values expl 'metadata file' _files && ret=0 + ;; + *(#i)maxpriority*) + _wanted values expl 'package priority' \ + compadd required important standard optional extra ANY && ret=0 + ;; + *(#i)(use(hold|essential|predepends|recommends|suggests|tasks)|negativekeepers|verbose|force|quiet)*) + _wanted values expl 'truth value' \ + compadd yes no && ret=0 + ;; + *(#i)(no|)keepsections*) + _wanted values expl 'section' compadd \ + x11 web utils text tex sound shells science \ + otherosfs oldlibs news net misc math mail libs \ + interpreters hamradio graphics games electronics \ + editors doc devel comm base admin && ret=0 + ;; + *(#i)guessdepends*) + _wanted values expl 'name extension' \ + compadd doc dev && ret=0 + ;; + esac + else + _wanted values expl 'configure file option' \ + compadd -M 'm:{a-z}={A-Z}' -S '=' - \ + InstallCmd RemoveCmd InfoCmd KeeperFile DpkgStatus \ + DpkgAvailable MaxPriority UseHold UseEssential \ + UsePreDepends UseRecommends UseSuggests UseTasks \ + KeepSections NokeepSections GuessDepends NegativeKeepers \ + Verbose Force Quiet && ret=0 + fi +fi return ret diff --git a/Completion/Debian/Command/_dpkg b/Completion/Debian/Command/_dpkg index d8b5d9327..406428d97 100644 --- a/Completion/Debian/Command/_dpkg +++ b/Completion/Debian/Command/_dpkg @@ -1,4 +1,4 @@ -#compdef dpkg dpkg-deb +#compdef dpkg dpkg-deb dpkg-reconfigure local _dpkg_deb_actions _dpkg_common_actions _dpkg_actions _dpkg_options local _dpkg_options_recursive _dpkg_actions_install _dpkg_actions_record_avail @@ -73,63 +73,72 @@ _dpkg_options_recursive=( '(--recursive -R)'{--recursive,-R}'[recursive]' ) # _dpkg_actions_record_avail=('(--record-avail)-A[record available]' '(-A)--record-avail') case "$service" in -dpkg) -_arguments -C -s "$_dpkg_actions[@]" \ - "$_dpkg_deb_actions[@]" \ - "$_dpkg_common_actions[@]" \ - "$_dpkg_options[@]" \ - "$_dpkg_options_recursive[@]" && return 0 -;; - -dpkg-deb) -_arguments "$_dpkg_deb_actions[@]" \ - "$_dpkg_common_actions[@]" && return 0 - -;; + dpkg) + _arguments -C -s \ + "$_dpkg_actions[@]" \ + "$_dpkg_deb_actions[@]" \ + "$_dpkg_common_actions[@]" \ + "$_dpkg_options[@]" \ + "$_dpkg_options_recursive[@]" && return 0 + ;; + dpkg-deb) + _arguments "$_dpkg_deb_actions[@]" \ + "$_dpkg_common_actions[@]" && return 0 + ;; + dpkg-reconfigure) + _arguments -s \ + '(-f --frontend)'{-f,--frontend}'[select frontend to use]:frontend' \ + '(-p --priority)'{-p,--priority}'[specify min priority of questions]:priority' \ + '--default-priority[use default question priority]' \ + '(*)--all[reconfigure all installed packages using debconf]' \ + '(-u --unseen-only)'{-u,--unseen-only}'[only ask questions not yet seen are asked]' \ + '--force[reconfigure even packages in broken state]' \ + '(-)'{-h,--help}'[display help information]' \ + '*:package:_deb_packages installed' && return 0 + ;; esac case "$state" in install|record_avail) - _call_function ret _dpkg_$state && return ret + _call_function ret _dpkg_$state && return ret # not needed anymore? # "${(@e):-\$_dpkg_actions_${state}}" \ - _arguments -C -A '-*' -s \ - "$_dpkg_options[@]" \ - \!${^_dpkg_actions%%:*} \ - - recur \ - "$_dpkg_options_recursive[@]" \ - '*:directory:_path_files -/' \ - - nonrecur \ - '*:Debian package:_path_files -g \*.deb' + _arguments -C -A '-*' -s \ + "$_dpkg_options[@]" \ + \!${^_dpkg_actions%%:*} \ + - recur \ + "$_dpkg_options_recursive[@]" \ + '*:directory:_path_files -/' \ + - nonrecur \ + '*:Debian package:_path_files -g \*.deb' ;; remove|purge|status|listfiles) - _call_function ret _dpkg_$state && return ret - _arguments -C -A "-*" -s "$_dpkg_options[@]" \ - '*:package:_deb_packages installed' + _call_function ret _dpkg_$state && return ret + _arguments -C -A "-*" -s "$_dpkg_options[@]" \ + '*:package:_deb_packages installed' ;; list) - _call_function ret _dpkg_$state && return ret - _arguments -C -A "-*" -s "$_dpkg_options[@]" \ - '*:packages:_deb_packages avail' + _call_function ret _dpkg_$state && return ret + _arguments -C -A "-*" -s "$_dpkg_options[@]" \ + '*:packages:_deb_packages avail' ;; compare_versions) - _call_function ret _dpkg_$state && return ret - _arguments -C -A "-*" -s \ - '1:version A:' \ - '2:operator:(lt le eq ne ge gt lt-nl le-nl ge-nl gt-nl)' \ - '3:version B:' + _call_function ret _dpkg_$state && return ret + _arguments -C -A "-*" -s \ + '1:version A:' \ + '2:operator:(lt le eq ne ge gt lt-nl le-nl ge-nl gt-nl)' \ + '3:version B:' ;; configure) - _call_function ret _dpkg_$state && return ret - _arguments -C -A "-*" -s '--configure' \ - "$_dpkg_options[@]" \ - '(* --pending)-a[pending packages]' \ - '(* -a)--pending' \ - '*:package:_deb_packages installed' + _call_function ret _dpkg_$state && return ret + _arguments -C -A "-*" -s '--configure' \ + "$_dpkg_options[@]" \ + '(* -a --pending)'{-a,--pending}'[pending packages]' \ + '*:package:_deb_packages installed' ;; search) - _call_function ret _dpkg_$state && return ret - _files + _call_function ret _dpkg_$state && return ret + _files ;; esac diff --git a/Completion/Debian/Command/_dpkg_source b/Completion/Debian/Command/_dpkg_source new file mode 100644 index 000000000..274a85794 --- /dev/null +++ b/Completion/Debian/Command/_dpkg_source @@ -0,0 +1,28 @@ +#compdef dpkg-source + +_arguments \ + '-x[specify source file]:Debian source file:_files -g \*.dsc' \ + '-b[specify source directory]:Debian source directory:_files -/' \ + '-c-[control file]:control file:_files' \ + '-l-[changelog file]:changelog file:_files' \ + '-F-[changelog format]:changelog format:' \ + '-V-[set substitutions variable]:expression:' \ + '-T-[alternate variable file]:varlistfile:' \ + '-D-[override dsc field]:expression:' \ + '-U-[remove a field]:field:' \ + '-i-[ignore files in diff]:filter:' \ + '-sa[autoselect orig source]' \ + '-sk[use packaged orig source - unpack and keep]' \ + '-sp[use packaged orig source - unpack and remove]' \ + '-su[use unpackaged orig source - unpack and keep]' \ + '-sr[use unpackaged orig source - unpack and remove]' \ + '-ss[trust packed and unpacked source are the same]' \ + '-sn[no diff, do main tarfile only]' \ + '-sA[autoselect orig source with overwrite]' \ + '-sK[use packaged orig source - unpack and keep with overwrite]' \ + '-sP[use packaged orig source - unpack and remove with overwrite]' \ + '-sU[use unpackaged orig source - unpack and keep with overwrite]' \ + '-sR[use unpackaged orig source - unpack and remove with overwrite]' \ + '-sp[leave original source packed in cwd]' \ + '-su[unpack original source tree too]' \ + '-h[help]' diff --git a/Completion/Debian/Command/_dput b/Completion/Debian/Command/_dput index 5fe9847d1..64b682c6f 100644 --- a/Completion/Debian/Command/_dput +++ b/Completion/Debian/Command/_dput @@ -1,27 +1,14 @@ #compdef dput -if (( ! $+_dput_sites )); then - _dput_sites=( ${${(M)${(f)"$(install' \ + '--remove:*::alt:= ->remove' \ + '--auto:name:_files -W $alterdir' \ + '--display:name:_files -W $alterdir' \ + '--config:name:_files -W $alterdir' && return + +while true; do + case "$state" in + islave) + _call_function ret _update_alternatives_$state && return ret + state= + _arguments -C \ + '1:link:_files' \ + '2:name:_files -W $alterdir' \ + '3:path:_files' \ + '--slave:*::more:= ->islave' && return + [[ -z $state ]] && return 1 + ;; + + install) + _call_function ret _update_alternatives_$state && return ret + _arguments -C \ + '1:link:_files' \ + '2:name:_files -W $alterdir' \ + '3:path:_files' \ + '4:priority:' \ + '--slave:*::slave:= ->islave' && return + [[ -z $state ]] && return 1 + ;; + + remove) + _call_function ret _update_alternatives_$state && return ret + _arguments \ + '1:name:_files -W $alterdir' \ + '2:path:_files' + return + ;; + + *) return 1 ;; + esac +done diff --git a/Completion/Redhat/Command/_rpm b/Completion/Redhat/Command/_rpm index 228480039..231284e74 100644 --- a/Completion/Redhat/Command/_rpm +++ b/Completion/Redhat/Command/_rpm @@ -39,224 +39,269 @@ # relocate # complete a `old=new' pair of paths -# Used by `_arguments', made local here. - _rpm () { local curcontext="$curcontext" state lstate line nm="$compstate[nmatches]" typeset -A opt_args - - state='' - local ret=1 - local -a tmp expl commonopts packageopts + local -a tmp expl commonopts selectopts + commonopts=( - '*-v[verbose mode]' + '(-v --verbose)--quiet[print as little as possible]' + '(--quiet)*'{-v,--verbose}'[verbose output]' '--rcfile:resource file:_files' - '--ftpproxy:FTP proxy server:_hosts' - '--ftpport:FTP port number:' - '--httpproxy:HTTP proxy server:_hosts' - '--httpport:HTTP port number:' + '--ftpproxy:ftp proxy server:_hosts' + '--ftpport:ftp port number' + '--httpproxy:http proxy server:_hosts' + '--httpport:http port number' + {-\?,--help}'[print help information]' + '--version[print version number]' + '--pipe:pipe command:->command' \ + ) + + # package selection options of which only one can be used + selectopts=( + {-a,--all}'[query all packages]' + {-f,--file}'[query packages that own specified files]' + {-p,--package}'[query uninstalled packages]' + {-g,--group}'[query packages in one of specified groups]' + --fileid --hdrid --pkgid --tid --querybynumber + '--triggeredby' + '--whatprovides' + '--whatrequires' ) - packageopts=( - '-a[query all packages]' - '-p[query uninstalled package file]:*:RPM package file:->package_file' - '-f[specify file to query owner of]:file:_files' - '--triggeredby:RPM package:->package' - '--whatprovides:RPM capability:->capability' - '--whatrequires:RPM capability:->capability' + sopts=${selectopts%\[*}\ --specfile + selectopts=( + "(* $sopts)"${selectopts[1,2]} + "($sopts)"${selectopts[3,-1]} + '(-a --all)*: :->package-select' ) + pathopts=( - '--root:RPM root directory:_files -/' - '--dbpath:RPM database path:_files -/' + '--root:rpm root directory:_files -/' + '--dbpath:rpm database path:_files -/' ) - - # Do simple completions or get the first state. - + _arguments -C -s \ - '--help[print help message]' \ - '--version[print version number]' \ "${commonopts[@]}" \ - '-q+[query mode]:*:query:->query' \ - --{querytags,initdb,showrc} \ - '--pipe:pipe command:_command_names -e' \ - -{V,y}'[verify mode]:*:verify:->verify' \ - '--verify[verify mode]:*:verify:->verify' \ + {-q+,--query}'[query mode]:*:query:->query' \ + '(-V -y --verify)'{-V+,-y+,--verify}'[verify mode]:*:verify:->verify' \ + '--import:*:public key' \ + '(-K --checksig)'{-K,--checksig}'[signature check mode]:*:sigcheck:->sigcheck' \ + '(-i --install)'{-i+,--install}'[install mode]:*:install:->install' \ + '(-U --upgrade)'{-U+,--upgrade}'[upgrade mode]:*:upgrade:->upgrade' \ + '(-F --freshen)'{-F+,--freshen}'[freshen mode]:*:upgrade:->upgrade' \ + '(-e --erase)'{-e+,--erase}'[uninstall mode]:*:uninstall:->uninstall' \ + --{initdb,querytags,showrc} \ + '--rebuilddb:*:rebuild:->rebuild' \ + --{resign,addsign}':*:package:->package_file' \ '--setperms[set file permissions]:*:package:->setattrs' \ '--setugids[set file owner/group]:*:package:->setattrs' \ - '(--install)-i+[install mode]:*:install:->install' \ - '(-i)--install:*:install:->install' \ - '(--upgrade)-U+[upgrade mode]:*:upgrade:->upgrade' \ - '(-U)--upgrade:*:upgrade:->upgrade' \ - '(--freshen)-F+[freshen mode]:*:upgrade:->upgrade' \ - '(-F)--freshen:*:upgrade:->upgrade' \ - '(--erase)-e+[uninstall mode]:*:uninstall:->uninstall' \ - '(-e)--erase:*:uninstall:->uninstall' \ '-b+[build mode (spec file)]:build stage:((p\:execute\ \%prep\ stage l\:do\ a\ list\ check c\:execute\ build\ stage i\:execute\ install\ stage b\:build\ a\ binary\ package a\:build\ binary\ and\ source\ packages)):*:build:->build_b' \ '(-b)-t+[build mode (tar file)]:build stage:((p\:execute\ \%prep\ stage l\:do\ a\ list\ check c\:execute\ build\ stage i\:execute\ install\ stage b\:build\ a\ binary\ package a\:build\ binary\ and\ source\ packages)):*:build:->build_t' \ - --{resign,addsign}':*:RPM package:->package_file' \ - '--rmsource:*:spec file:->spec_file' \ - --{rebuild,recompile}':*:Src RPM files:->package_src' \ - '(--checksig)-K+[signature check mode]:*:sigcheck:->sigcheck' \ - '(-K)--checksig:*:sigcheck:->sigcheck' \ - '--rebuilddb:*:rebuild:->rebuild' && ret=0 - + '--rmsource:*:spec file:->spec_files' \ + --{rebuild,recompile}':*:source rpm file:->package_src' \ + '--eval:macro:->macros' && ret=0 + # As long as we have a state name... - + while [[ -n "$state" ]]; do - + # First try to call a user-defined function. - + _call_function ret _rpm_$state && return ret - + # Copy the state and reset `state', to simplify the test above. - + lstate="$state" state='' tmp=() - + # Dispatch... - + case "$lstate" in query) - # --dump requires on of -{l,c,d} + # --dump requires one of -{l,c,d} # --triggers requires --script _arguments -s \ - -q "${commonopts[@]}" "${packageopts[@]}" "${pathopts[@]}" \ - '--queryformat:RPM query format:->tags' \ - '-i[display package information]' \ - '--changelog[display change log]' \ - '-l[display package file list]' \ - '-s[show file states]' \ - '-d[documentation files only]' \ - '-c[configuration files only]' \ - '--dump[show all information]' \ - --provides \ - -{R,-requires}'[list dependencies]' \ - '--scripts[show (un)install scripts]' \ - '--triggers[show trigger scripts]' \ - '*:RPM package:->package_or_file' && ret=0 + \!{-q,--query} "${commonopts[@]}" "${selectopts[@]}" "${pathopts[@]}" \ + "($sopts)--specfile[query specified spec file as if it were a package]" \ + '(-i --info)'{-i,--info}'[display package information]' \ + '--changelog[display change log]' \ + '(-s --state -l --list --filesbypkg)'{-l,--list}'[display package file list]' \ + '(-s --state -l --list --filesbypkg)'{-s,--state}'[show file states]' \ + '(-s --state -l --list)--filesbypkg[list files with package names]' \ + {-d,--docfiles}'[documentation files only]' \ + {-c,--configfiles}'[configuration files only]' \ + '--dump[show all information]' \ + '--provides[show capabilities provided]' \ + \*--{qf,queryformat}'[specify format for package information]:rpm query format:->tags' \ + -{R,-requires}'[list dependencies]' \ + '--scripts[show (un)install scripts]' \ + {--triggers,--triggerscripts}'[show trigger scripts]' && ret=0 ;; setattrs) - _arguments -s --set{perm,ugids} "${packageopts[@]}" && ret = 0 + _arguments -s --set{perm,ugids} "${selectopts[@]}" && ret = 0 ;; verify) - _arguments -s \ - '(-y --verify)-V' '(-V --verify)-y' '(-y -V)--verify' \ - "${commonopts[@]}" "${packageopts[@]}" "${pathopts[@]}" \ - --no{deps,md5,files} \ - '*:RPM package:->package_or_file' && ret=0 + _arguments -s \!-{y,V} \ + "${commonopts[@]}" "${selectopts[@]}" "${pathopts[@]}" \ + --no{deps,files,scripts,digest,signature,linkto,md5,size,user,group,mtime,mode,rdev} && ret=0 ;; upgrade) - tmp=( '(--upgrade)-U' '(-U)--upgrade' '(--force)--oldpackage' ) + tmp=( '(--force)--oldpackage' ) ;& install) - (( $#tmp )) || tmp=( '(--install)-i' '(-i)--install' ) - _arguments -s "$tmp[@]" \ - "${commonopts[@]}" "${pathopts[@]}" \ - '--excludepath:exclude files in following path:_files -/' \ - '--relocate:relocate:->relocate' \ - '--prefix:package prefix directory:_files -/' \ - '(-h)--hash' '(--hash)-h' \ - '(--replacepkgs --replacefiles --oldpackage)--force' \ - '(--force)--'{replacefiles,replacepkgs} \ - --{badreloc,excludedocs,allfiles,ignorearch,ignoreos,includedocs,justdb,nodeps,noorder,noscripts,notriggers,percent,test} \ - '*:pkg file:->package_file' && ret=0 + _arguments -s \!-{i,U} "$tmp[@]" \ + "${commonopts[@]}" "${pathopts[@]}" \ + '--excludepath:file to exclude:_files -/' \ + '--relocate:relocate:->relocate' \ + '--prefix:package prefix directory:_files -/' \ + '(-h --hash)'{-h,--hash} \ + '(--replacepkgs --replacefiles --oldpackage)--force' \ + '(--force)--'{replacefiles,replacepkgs} \ + --{aid,allfiles,badreloc,excludedocs,ignorearch,ignoreos,ignoresize,includedocs,justdb,percent,repackage,test} \ + --np{digest,signature,deps,suggest,order,pre,post,preun,postun,trigger{s,in,un,postun}} \ + '(--nopre --nopost --nopreun --nopostun)--noscripts' \ + '*:pkg file:->package_file' && ret=0 ;; uninstall) - _arguments -s \ - '(-e)--erase' '(--erase)-e' \ - "${commonopts[@]}" "${pathopts[@]}" \ - --{allmatches,justdb,nodeps,noorder,noscripts,notriggers} \ - '*:RPM package:->package' && ret=0 + _arguments -s \!-e \ + "${commonopts[@]}" "${pathopts[@]}" \ + --{allmatches,justdb,repackage,test} \ + --no{deps,scripts,preun,postun,trigger{s,un,postun}} \ + '*:package:->package' && ret=0 ;; build_b) tmp=( '*:spec file:_files -g \*.spec' ) ;& build_t) (( $#tmp )) || tmp=( '*:tar file:_files -g \*.\(\#i\)tar\(.\*\|\)' ) - + _arguments -s \ - "${commonopts[@]}" "${pathopts[@]}" \ - --{short-circuit,clean,nobuild,rmsource,sign,test} \ - '--target:specify a build target:->target'\ - '--buildroot:build root directory:_files -/' \ - '--buildarch:architecture for which to build:->target' \ - '--buildos:operating system for which to build:' \ - '--timecheck:time check (seconds):' "$tmp[1]" && ret=0 + "${commonopts[@]}" "${pathopts[@]}" \ + --{short-circuit,clean,nobuild,rmsource,sign,test} \ + '--target:specify a build target:->target'\ + '--buildroot:build root directory:_files -/' \ + '--buildarch:architecture for which to build:->target' \ + '--buildos:operating system for which to build:' \ + '--timecheck:time check (seconds):' "$tmp[1]" && ret=0 ;; sigcheck) - _arguments -s \ - '(-K)--checksig' '(--checksig)-K' \ - "${commonopts[@]}" \ - --no{gpg,pgp,md5} \ - '*:RPM package file:->package_file' && ret=0 + _arguments -s \!-K \ + "${commonopts[@]}" \ + --no{gpg,pgp,md5,signature,digest} \ + '*:package file:->package_file' && ret=0 ;; rebuild) _arguments -s \ - "${commonopts[@]}" "${pathopts[@]}" \ - '*:RPM source package file:->package_file' && ret=0 + "${commonopts[@]}" "${pathopts[@]}" \ + '*:source package file:->package_file' && ret=0 + ;; + package-select) + case "${opt_args[(i)${sopts// /|}]}" in + -f|--file) _files ;; + -p|--package) state=package_file ;; + -g|--group) state=groups ;; + --fileid|--pkgid) _message md5 ;; + --hdrid) _message sha1 ;; + --querybynumber) _message number ;; + --what*) state=capabilities ;; + --specfile) state=spec_files ;; + *) state=package ;; + esac + ;; + macros) + local -a macros + local mfile + for mfile in {/usr/lib/rpm/{,redhat/}macros,/etc/rpm/macros,~/.rpmmacros}(N); do + macros=( $macros ${${(M)${(f)"$(<$mfile)"}:#%[^\{]*}%%[[:blank:]]*} ) + done + if zstyle -t ":completion:${curcontext}:macros" prefix-hidden; then + macros=( ${macros#%} ) + _wanted macros expl macro compadd -p '%' -a - macros + else + _wanted macros expl macro compadd -a - macros + fi + ;; + command) + compset -q + _normal ;; target) - _wanted target expl 'Target platforms' \ - compadd $(_call_program target rpm --showrc 2> /dev/null |grep 'compatible archs'|sed 's/.*: //') && ret=0 + _wanted targets expl 'target platform' compadd \ + ${${(M)${(f)"$(_call_programs targets rpm --showrc)"}:#compatible archs*}##*: } && ret=0 ;; + groups) + if ( (( ! $+_rpm_groups )) || _cache_invalid rpm-groups ) && + ! _retrieve_cache rpm-groups + then + typeset -gaU _rpm_groups + _rpm_groups=( + ${(f)"$(_call_program groups rpm -qa --queryformat '%\{group}\\n' 2>/dev/null)"} + ) + _store_cache RPM-groups _rpm_groups + fi + _wanted groups expl 'group' _multi_parts / _rpm_groups && ret=0 + ;; package_or_file) state=package_file - ;& + ;; package) if ( [[ ${+_rpms} -eq 0 ]] || _cache_invalid RPMs ) && - ! _retrieve_cache RPMs; + ! _retrieve_cache RPMs; then - _rpms=( $(_call_program packages rpm -qa 2>/dev/null) ) - _store_cache RPMs _rpms + _rpms=( $(_call_program packages rpm -qa 2>/dev/null) ) + _store_cache RPMs _rpms fi - _wanted packages expl 'RPM package' \ - compadd -M 'r:|-=* r:|=*' - "$_rpms[@]" && ret=0 + _wanted packages expl 'package' \ + compadd -M 'r:|-=* r:|=*' - "$_rpms[@]" && ret=0 ;; - spec_file) + spec_files) _wanted specfiles expl 'spec file' \ - _files -g \*.spec && ret=0 + _files -g \*.spec && ret=0 ;; package_file) - _wanted files expl 'RPM package file' \ - _files -g '*.(#i)rpm' && ret=0 + _wanted files expl 'package file' \ + _files -g '*.(#i)rpm' && ret=0 if [[ -prefix 1 (f|ht)tp:// ]]; then - _wanted urls expl 'URL of RPM package file' \ - _urls -f -g '*.(#i)rpm' "${expl[@]}" && ret=0 + _wanted urls expl 'URL of rpm package file' \ + _urls -f -g '*.(#i)rpm' "${expl[@]}" && ret=0 else - _wanted urls expl 'URL of RPM package file' \ - compadd -S '' "${expl[@]}" ftp:// http:// && ret=0 + _wanted urls expl 'URL of rpm package file' \ + compadd -S '' "${expl[@]}" ftp:// http:// && ret=0 fi ;; package_src) - _files -g \*.src\(\#i\).rpm - ;& + _files -g "(#i)*.src.rpm" && ret=0 + ;; tags) - if compset -P '*%*\{'; then - _wanted tags expl 'RPM tag' \ - compadd -M 'm:{a-z}={A-Z}' -S '\}' - \ - "${(@)${(@f)$(_call_program tags rpm --querytags 2> /dev/null)}#RPMTAG_}" && ret=0 + local -a suf + if compset -P "*%*${${QIPREFIX:+{}:-\{}"; then + compset -S '(|\\)}*' || suf=( -qS ${${QIPREFIX:+\}}:-\\\}} ) + _wanted tags expl 'rpm tag' compadd -M 'm:{a-z}={A-Z}' "$suf[@]" - \ + "${(L@)${(@f)$(_call_program tags rpm --querytags 2>/dev/null)}#RPMTAG_}" && ret=0 else - _message 'RPM format' + _message 'rpm query format' fi ;; - capability) - _message 'RPM capability' + capabilities) + _wanted capabilities expl capability compadd \ + ${(f)"$(_call_program capabilities rpm -qa --queryformat '%\{requirename}\\n' 2>/dev/null)"} ;; relocate) if compset -P '*='; then - _description directories expl 'new path' + _description directories expl 'new path' else - _description directories expl 'old path' + _description directories expl 'old path' fi - + _files "$expl[@]" -/ && ret=0 ;; esac - + [[ ret -eq 0 || $nm -ne $compstate[nmatches] ]] && return 0 done - + return ret } diff --git a/Completion/Unix/Command/.distfiles b/Completion/Unix/Command/.distfiles index 8eb4718bf..a14dd6ffd 100644 --- a/Completion/Unix/Command/.distfiles +++ b/Completion/Unix/Command/.distfiles @@ -17,7 +17,7 @@ _diff _gs _make _psutils _tin _mail _loadkeys _apm _ruby _samba _sysctl _links _user_admin _rsync _arping _spamassassin _mtools _fsh _chkconfig _cdcd _irssi _sccs _texinfo _ant -_global _global_tags _figlet _ifconfig _last _larch +_global _figlet _ifconfig _last _larch _lsof _mt _xmlsoft _elinks _tidy _python _antiword _renice _sablotron _cdrecord _aap _du _rar _vorbis _subversion diff --git a/Completion/Unix/Command/_apm b/Completion/Unix/Command/_apm new file mode 100644 index 000000000..efe50d713 --- /dev/null +++ b/Completion/Unix/Command/_apm @@ -0,0 +1,41 @@ +#compdef apm + +if [[ $OSTYPE == linux* ]]; then + + _arguments -s \ + '(-)'{-V,--version}'[print the apm program version and exit immediately]' \ + '(-v --verbose)'{-v,--verbose}'[print information about APM BIOS and Linux APM driver version]' \ + '(-m --minutes)'{-m,--minutes}'[print total minutes remaining instead of using an hh:mm format]' \ + '(-s --suspend)'{-s,--suspend}'[put the machine into suspend mode if possible]' \ + '(-S --standby)'{-S,--standby}'[put the machine into standby mode if possible]' \ + '(-n --noignore)'{-n,--noignore}'[tell the system not to ignore system-generated APM message]' \ + '(-i --ignore)'{-i,--ignore}'[tell the system to ignore system-generated APM message]' && return + +elif [[ $OSTYPE == freebsd* ]]; then + + _arguments \ + '-a[display AC line status]' \ + '-b[display battery status]' \ + '-d[disable/enable display suspension]:bool:' \ + '-e[disable/enable apm functions]:bool:' \ + '-h[disable/enable HLT in kernel context switch]:bool:' \ + '-l[display remaining battery percentage]' \ + '-r[enable resume wakeup timer]' \ + '-s[display status of APM support]' \ + '-t[display estimated remaining battery life in seconds]' \ + '-Z[transition system into standby mode]' \ + '-z[suspend the system]' && return + +elif [[ $OSTYPE == openbsd* ]]; then + _arguments \ + '-z[engage suspend mode]' \ + '-S[engage stand-by mode]' \ + '-l[display estimated battery lifetime percentage]' \ + '-m[display estimated battery lifetime minutes]' \ + '-b[display battery status]' \ + '-a[display AC line status]' \ + '-v[verbose]' \ + '-f[socket]:sockname:_files' && return +fi + +return 1 diff --git a/Completion/Unix/Command/_arping b/Completion/Unix/Command/_arping index 89bdccd92..382ce247e 100644 --- a/Completion/Unix/Command/_arping +++ b/Completion/Unix/Command/_arping @@ -1,20 +1,22 @@ #compdef arping _arguments -s \ - '-h[help]' \ - '-q[quiet]' \ - '-v[verbose]' \ - '-r[raw]' \ - '-R[Raw]' \ - '-d[find duplicate replies]' \ - '-B[255.255.255.255]' \ - '-0[source 0.0.0.0]' \ - '-b[source 255.255.255.255]' \ - '-S[set source IP]:source IP address:_hosts' \ - '-T[target IP]:target IP address:_hosts' \ - '-p[promiscuous mode]' \ - '-s[set source MAC address]:source MAC address:' \ - '-t[set target MAC address]:target MAC address:' \ - '-c[send this many requests]:count:' \ - '-i[interface]:interface:' \ - ':address:_hosts' \ + '(-)-h[display help information]' \ + '-q[only display error messages]' \ + '-a[audible ping]' \ + '*-v[verbose output]' \ + '-r[raw output: only the MAC/IP address displayed]' \ + '-R[like -r but shows "the other one"]' \ + '-d[find duplicate replies]' \ + '(:)-B[255.255.255.255]' \ + '-0[source 0.0.0.0]' \ + '-b[source 255.255.255.255]' \ + '-S[set source IP]:source IP address:_hosts' \ + '-T[target IP]:target IP address:_hosts' \ + '-p[turn on promiscuous mode]' \ + '-s[set source MAC address]:source MAC address' \ + '-t[set target MAC address]:target MAC address' \ + '-c[send this many requests]:count' \ + '-i[interface]:interface' \ + '-A[only count addresses matching requested address]' \ + '(-B):address:_hosts' \ diff --git a/Completion/Unix/Command/_cvs b/Completion/Unix/Command/_cvs index d3e30479f..7ab72d341 100644 --- a/Completion/Unix/Command/_cvs +++ b/Completion/Unix/Command/_cvs @@ -2,7 +2,7 @@ # redefine _cvs. -_cvs () { +_cvs() { local extra # "+Qqrwtnlvb:T:e:d:Hfz:s:xa" @@ -24,60 +24,58 @@ _cvs () { '-t[trace]' \ '(-r)-w[make new working file read-write]' \ '-x[encrypt client/server communication]' \ - '(--version)-v[print version]' \ - '(-v)--version[print version]' \ - '( --help --help-commands --help-synonyms --help-options)-H[print help]' \ - '(-H --help-commands --help-synonyms --help-options)--help[print help]' \ - '(-H --help --help-synonyms --help-options)--help-commands[command help]' \ - '(-H --help --help-commands --help-options)--help-synonyms[command synonyms help]' \ - '(-H --help --help-commands --help-synonyms )--help-options[global options help]' \ + '(-)'{-v,--version}'[print version and copyright information]' \ + '(-)'{-H,--help}'[print help information]' \ + '(-)--help-commands[command help]' \ + '(-)--help-synonyms[command synonyms help]' \ + '(-)--help-options[global options help]' \ '*--allow-root=[allowable root for pserver]:rootdir:_files -/' \ - '-b+[binary directory]:bindir:_cvs_bindir' \ '-T+[temporary directory]:temporary directory:_cvs_tempdir' \ '-d+[cvs root directory]:cvsroot:_cvs_root' \ '-e+[editor]:editor:_cvs_editor' \ '-s+[user variable]:user variable:_cvs_user_variable' \ - '-z+[gzip level]:gzip level:_cvs_gzip_level' \ + '-z+[gzip level]:gzip level:(0 1 2 3 4 5 6 7 8 9)' \ '*::cvs command:_cvs_command' } # define cvs command dispatch function. (( $+functions[_cvs_command] )) || -_cvs_command () { - local cmd cvsroot="$CVSROOT" +_cvs_command() { + local cmd cvsroot="$CVSROOT" ret=1 [[ -f CVS/Root ]] && cvsroot="$(&1)"}:# *}/(#b) #([a-z]##) */$match[1] - }}} - ${(f)${(F)${${(M)${(f)"$(_call_program synonyms cvs --help-synonyms 2>&1)"}:# *}/(#b) #([a-z]#) #([a-z]#) ([a-z]#)/$match[1] - $match[2] $match[3] }}} - ) + if (( ! $+_cvs_syns )); then + typeset -gA _cvs_syns + _cvs_syns=( ${(s. .)${(f)"$(cvs --help-synonyms 2>&1)"}[2,-2]/(#b) #([a-z]#) #([a-z]#) ([a-z]#)/$match[1] $match[2]:$match[3]} ) fi + (( $+_cvs_cmds )) || _cvs_cmds=( + ${${(f)"$(_call_program commands cvs --help-commands 2>&1)"}[2,-2]/(#b) #([a-z]##) #([A-Z])/$match[1]:${match[2]:l}} + 'version:display cvs version being used on client and server' + ) + if (( CURRENT == 1 )); then - _tags commands && { compadd "$@" -k _cvs_cmds || compadd "$@" ${(kv)=_cvs_cmds} } + _describe -t commands 'cvs command' _cvs_cmds || compadd "$@" - ${(s.:.)${(j.:.)_cvs_syns}} else local curcontext="$curcontext" - cmd="${${(k)_cvs_cmds[(R)* $words[1] *]}:-${(k)_cvs_cmds[(i)$words[1]]}}" + cmd="${${_cvs_cmds[(r)$words[1]:*]%%:*}:-${(k)_cvs_syns[(r)(*:|)$words[1](:*|)]}}" if (( $#cmd )); then curcontext="${curcontext%:*:*}:cvs-${cmd}:" - _cvs_$cmd + _call_function ret _cvs_$cmd || _message 'no more arguments' else _message "unknown cvs command: $words[1]" fi + return ret fi } # define completion functions for each cvs command (( $+functions[_cvs_add] )) || -_cvs_add () { +_cvs_add() { # "+k:m:" _arguments -s \ '-k+[keyword]:keyword substitution:_cvs_k' \ @@ -86,7 +84,7 @@ _cvs_add () { } (( $+functions[_cvs_admin] )) || -_cvs_admin () { +_cvs_admin() { # "+ib::c:a:A:e::l::u::LUn:N:m:o:s:t::IqxV:k:" _arguments -s \ -{i,x} \ @@ -95,25 +93,25 @@ _cvs_admin () { '-I[interactive]' \ '-q[quiet]' \ '-b-[default branch]:default branch:(1.1.1)' \ - '-c+:comment leader (not used):' \ - '-a+:login names (not work with CVS):' \ - '-A+:access list to append (not work with CVS):' \ - '-e-:access list to erase (not work with CVS):' \ - '-l-[lock]:revision to lock:' \ - '-u-[unlock]:revision to unlock:' \ - '-n+[name revision]:symbolic-name(\:revision):' \ - '-N+[force to name revision]:symbolic-name(\:revision):' \ - '-m+[replace log]:revision\:msg:' \ - '-o+[delete revision]:range to delete:' \ - '-s+[replace state attribute]:state(\:revision):' \ + '-c+:comment leader (not used)' \ + '-a+:login names (not work with CVS)' \ + '-A+:access list to append (not work with CVS)' \ + '-e-:access list to erase (not work with CVS)' \ + '-l-[lock]:revision to lock' \ + '-u-[unlock]:revision to unlock' \ + '-n+[name revision]:symbolic-name(\:revision)' \ + '-N+[force to name revision]:symbolic-name(\:revision)' \ + '-m+[replace log]:revision\:msg' \ + '-o+[delete revision]:range to delete' \ + '-s+[replace state attribute]:state(\:revision)' \ '-t-[replace descriptive text]:descriptive text:_cvs_admin_t' \ - '-V+:version (obsolete):' \ + '-V+:version (obsolete)' \ '-k+[set keyword substitution]:keyword substitution:_cvs_k' \ '*:file:_cvs_files' } (( $+functions[_cvs_admin_t] )) || -_cvs_admin_t () { +_cvs_admin_t() { if compset -P -; then _message 'descriptive text' else @@ -122,7 +120,7 @@ _cvs_admin_t () { } (( $+functions[_cvs_annotate] )) || -_cvs_annotate () { +_cvs_annotate() { # "+lr:D:fR" _arguments -s \ "(-R)-l[don't recurse]" \ @@ -134,7 +132,7 @@ _cvs_annotate () { } (( $+functions[_cvs_rannotate] )) || -_cvs_rannotate () { +_cvs_rannotate() { # "+lr:D:fR" _arguments -s \ "(-R)-l[don't recurse]" \ @@ -146,7 +144,7 @@ _cvs_rannotate () { } (( $+functions[_cvs_checkout] )) || -_cvs_checkout () { +_cvs_checkout() { # "+ANnk:d:flRpQqcsr:D:j:P" _arguments -s \ '-N[don'\''t shorten module paths]' \ @@ -167,7 +165,7 @@ _cvs_checkout () { } (( $+functions[_cvs_commit] )) || -_cvs_commit () { +_cvs_commit() { # "+nlRm:fF:r:" _arguments -s \ '-n[disable module program]' \ @@ -181,7 +179,7 @@ _cvs_commit () { } (( $+functions[_cvs_diff] )) || -_cvs_diff () { +_cvs_diff() { local of ofwuc ouc oss ofwy ofwg ofwl # output formats of="-y --side-by-side -n --rcs -e -f --ed -q --brief -c -C --context -u -U \ @@ -220,83 +218,59 @@ _cvs_diff () { "(-R)-l[don't recurse]" \ '(-l)-R[recursive]' \ '-k+[keyword]:keyword substitution:_cvs_k' \ - '(-r)-D+[specify date]:date:_cvs_D' \ - '(-r)-D+[specify date]:date:_cvs_D' \ - '(-D)-r+[specify revision]:tag:_cvs_revisions' \ - '(-D)-r+[specify revision]:tag:_cvs_revisions' \ + {,}'(-r)-D+[specify date]:date:_cvs_D' \ + {,}'(-D)-r+[specify revision]:tag:_cvs_revisions' \ -{h,0,1,2,3,4,5,6,7,8,9} \ '--binary[binary mode]' \ - '--ifdef=[set macro name for merged if-then-else format]:name:' \ - '(-i)--ignore-case[case insensitive]' \ - '(--ignore-case)-i[case insensitive]' \ - '(-w)--ignore-all-space[ignore all white space]' \ - '(--ignore-all-space)-w[ignore all white space]' \ - '(-b)--ignore-space-change[ignore changes in the amount of white space]' \ - '(--ignore-space-change)-b[ignore changes in the amount of white space]' \ - '(-B)--ignore-blank-lines[ignore lines that are all blank]' \ - '(--ignore-blank-lines)-B[ignore lines that are all blank]' \ - '(-I)--ignore-matching-lines=[ignore lines that match regex]:line exclusion regex:' \ - '(--ignore-matching-lines)-I+[ignore lines that match regex]:line exclusion regex:' \ - '(-a)--text[treat all files as text]' \ - '(--text)-a[treat all files as text]' \ - "($of $oss)--context=-[context diff]:number of lines of copied context:" \ - "($of $oss)-C+[output a context diff]:number of lines of copied context:" \ + '--ifdef=[set macro name for merged if-then-else format]:name' \ + '(-i --ignore-case)'{-i,--ignore-case}'[case insensitive]' \ + '(-w --ignore-all-space)'{-w,--ignore-all-space}'[ignore all white space]' \ + '(-b --ignore-space-change)'{-b,--ignore-space-change}'[ignore changes in the amount of white space]' \ + '(-B --ignore-blank-lines)'{-B,--ignore-blank-lines}'[ignore lines that are all blank]' \ + '(-I --ignore-matching-lines)'{-I+,--ignore-matching-lines=}'[ignore lines that match regex]:line exclusion regex' \ + '(-a --text)'{-a,--text}'[treat all files as text]' \ + "($of $oss)"{-C+,--context=-}'[context diff; specify lines of context]:number of lines of context' \ "($of $oss)-c[output a context diff]" \ - "($of $oss)--unified=-[output a unified diff]:number of lines of unified context:" \ - "($of $oss)-U+[output a unified diff]:number of lines of unified context:" \ + "($of $oss)"{-U+,--unified=-}'[unified diff; specify lines of context]:number of lines of context' \ "($of $oss)-u[output a unified diff]" \ - "($ofwuc $oss -L)--label=[set label to use instead of file name]:label:" \ - "($ofwuc $oss --label)-L+[set label to use instead of file name]:label:" \ - "($ofwuc $oss -L)--label=[set label to use instead of file name]:label:" \ - "($ofwuc $oss --label)-L+[set label to use instead of file name]:label:" \ - "($ofwuc $oss -p)--show-c-function[show C function of each change]" \ - "($ofwuc $oss --show-c-function)-p[show C function of each change]" \ - "($ofwuc $oss -F)--show-function-line=[show the most recent line matching regex]:regex:" \ - "($ofwuc $oss --show-function-line)-F+[show the most recent line matching regex]:regex:" \ + {,}"($ofwuc $oss -L --label)"{-L+,--label=}'[set label to use instead of file name]:label' \ + "($ofwuc $oss -p --show-c-function)"{-p,--show-c-function}'[show C function of each change]' \ + "($ofwuc $oss -F --show-function-line=)"{-F+,--show-function-line=}'[show the most recent line matching regex]:regex' \ "($of $ouc $oss)--brief[output only whether files differ]" \ - "($of $ouc $oss)--ed[output an ed script]" \ - "($of $ouc $oss)-e[output an ed script]" \ - "($of $ouc $oss)--forward-ed[output a reversed ed script]" \ - "($of $ouc $oss)-f[output a reversed ed script]" \ - "($of $ouc $oss)--rcs[RCS format diff]" \ - "($of $ouc $oss)-n[RCS format diff]" \ + "($of $ouc $oss)"{-e,--ed}'[output an ed script]' \ + "($of $ouc $oss)"{-f,--forward-ed}'[output a reversed ed script]' \ + "($of $ouc $oss)"{-n,--rcs}'[RCS format diff]' \ "($of $ouc)--side-by-side[output in two columns]" \ "($of $ouc)-y[output in two columns]" \ - "($ofwy $ouc -W)--width=[set size of line]:number of characters per line:" \ - "($ofwy $ouc --width)-W+[set size of line]:number of characters per line:" \ + "($ofwy $ouc -W --width)"{-W+,--width=}'[set size of line]:number of characters per line' \ "($ofwy $ouc)--left-column[output only left column of common lines]" \ "($ofwy $ouc)--suppress-common-lines[do not output common lines]" \ - "($ofwg $ouc $oss)--old-group-format=[set old group format]:old group format:" \ - "($ofwg $ouc $oss)--new-group-format=[set new group format]:new group format:" \ - "($ofwg $ouc $oss)--changed-group-format=[set changed group format]:changed group format:" \ - "($ofwg $ouc $oss)--unchanged-group-format=[set unchanged group format]:unchanged group format:" \ - "($ofwl $ouc $oss)--line-format=[set line format]:line format:" \ - "($ofwl $ouc $oss)--old-line-format=[set old line format]:old line format:" \ - "($ofwl $ouc $oss)--new-line-format=[set new line format]:new line format:" \ - "($ofwl $ouc $oss)--unchanged-line-format=[set unchanged line format]:unchanged line format:" \ + "($ofwg $ouc $oss)--old-group-format=[set old group format]:old group format" \ + "($ofwg $ouc $oss)--new-group-format=[set new group format]:new group format" \ + "($ofwg $ouc $oss)--changed-group-format=[set changed group format]:changed group format" \ + "($ofwg $ouc $oss)--unchanged-group-format=[set unchanged group format]:unchanged group format" \ + "($ofwl $ouc $oss)--line-format=[set line format]:line format" \ + "($ofwl $ouc $oss)--old-line-format=[set old line format]:old line format" \ + "($ofwl $ouc $oss)--new-line-format=[set new line format]:new line format" \ + "($ofwl $ouc $oss)--unchanged-line-format=[set unchanged line format]:unchanged line format" \ '--paginate[output through pr]' \ - '(-t)--expand-tabs[expand tabs to spaces]' \ - '(--expand-tabs)-t[expand tabs to spaces]' \ + '(-t --expand-tabs)'{-t,--expand-tabs}'[expand tabs to spaces]' \ '--initial-tab[prepend a tab]' \ - '(-N)--new-file[treat absent files as empty]' \ - '(--new-file)-N[treat absent files as empty]' \ - '(-s)--report-identical-files[report when two files are the same]' \ - '(--report-identical-files)-s[report when two files are the same]' \ - '--horizon-lines=[set number of lines to keep in prefix and suffix]:number of horizon lines:' \ - '(-d)--minimal[try to find a smaller set of changes]' \ - '(--minimal)-d[try to find a smaller set of changes]' \ - '(-H)--speed-large-files[assume large files and many small changes]' \ - '(--speed-large-files)-H[assume large files and many small changes]' \ + '(-N --new-file)'{-N,--new-file}'[treat absent files as empty]' \ + '(-s --report-identical-files)'{-s,--report-identical-files}'[report when two files are the same]' \ + '--horizon-lines=[set number of lines to keep in prefix and suffix]:number of horizon lines' \ + '(-d --minimal)'{-d,--minimal}'[try to find a smaller set of changes]' \ + '(-H --speed-large-files)'{-H,--speed-large-files}'[assume large files and many small changes]' \ '*:file:_cvs_diff_arg' } (( $+functions[_cvs_diff_arg] )) || -_cvs_diff_arg () { +_cvs_diff_arg() { _cvs_files_modified || _cvs_files } (( $+functions[_cvs_edit] )) || -_cvs_edit () { +_cvs_edit() { # "+lRa:" _arguments -s \ "(-R)-l[don't recurse]" \ @@ -306,7 +280,7 @@ _cvs_edit () { } (( $+functions[_cvs_editors] )) || -_cvs_editors () { +_cvs_editors() { # "+lR" _arguments -s \ "(-R)-l[don't recurse]" \ @@ -315,7 +289,7 @@ _cvs_editors () { } (( $+functions[_cvs_export] )) || -_cvs_export () { +_cvs_export() { # "+Nnk:d:flRQqr:D:" _arguments -s \ '-N[don'\''t shorten module paths]' \ @@ -331,7 +305,7 @@ _cvs_export () { } (( $+functions[_cvs_history] )) || -_cvs_history () { +_cvs_history() { # "+Tacelow?D:b:f:m:n:p:r:t:u:x:X:z:" _arguments -s \ '-T[all tags]' \ @@ -342,22 +316,22 @@ _cvs_history () { '-o[check-outed modules]' \ '-w[working directory]' \ '-D+[since date]:date:_cvs_D' \ - '-b+[back to record]:string:' \ + '-b+[back to record]:string' \ '-f+[specify file]:file:_cvs_files' \ '-m+[specify module]:module:_cvs_modules' \ '*-n+[in module]:module:_cvs_modules' \ - '*-p+[in repository]:repository:' \ - '-r+[since revision]:rev:' \ - '-t+[since tag]:tag:' \ - '*-u+[specify user]:user name:' \ + '*-p+[in repository]:repository' \ + '-r+[since revision]:rev' \ + '-t+[since tag]:tag' \ + '*-u+[specify user]:user name' \ '-x+[specify type]:type:_cvs_history_x' \ - '-X+[debugging]:arg:' \ - '-z+[specify timezone]:timezone:' \ + '-X+[debugging]:arg' \ + '-z+[specify timezone]:timezone' \ '*:file:_cvs_files' } (( $+functions[_cvs_history_x] )) || -_cvs_history_x () { +_cvs_history_x() { _values -s '' 'type' \ 'F[release]' \ 'O[checkout]' \ @@ -373,7 +347,7 @@ _cvs_history_x () { } (( $+functions[_cvs_import] )) || -_cvs_import () { +_cvs_import() { # "+Qqdb:m:I:k:W:" _arguments -s \ '-d[use file modification time]' \ @@ -384,16 +358,11 @@ _cvs_import () { '*-W+[wrapper specification]:spec:_files' \ ':repository:_cvs_modules' \ ':vendor tag:_cvs_vendor_branches' \ - ':release tag:' -} - -(( $+functions[_cvs_init] )) || -_cvs_init () { - false + ':release tag' } (( $+functions[_cvs_log] )) || -_cvs_log () { +_cvs_log() { # "+bd:hlNRr::s:tw::" _arguments -s \ '-b[default branch]' \ @@ -402,15 +371,15 @@ _cvs_log () { '-R[print the name of RCS file in the repository]' \ '-N[don'\''t list tags]' \ '(-h)-t[header with descriptive text]' \ - '-d+[specify dates]:dates:' \ - '-r-[specify revisions]:revisions:' \ + '-d+[specify dates]:dates' \ + '-r-[specify revisions]:revisions' \ '-s+[specify states]:states:(Exp Stab Rel dead)' \ - '-w-[specify logins]:logins:' \ + '-w-[specify logins]:logins' \ '*:file:_cvs_files' } (( $+functions[_cvs_rlog] )) || -_cvs_rlog () { +_cvs_rlog() { # "+bd:hlNRr::s:tw::" _arguments -s \ '-b[default branch]' \ @@ -419,25 +388,15 @@ _cvs_rlog () { '(-l)-R[recursive]' \ '-N[don'\''t list tags]' \ '(-h)-t[header with descriptive text]' \ - '-d+[specify dates]:dates:' \ - '-r-[specify revisions]:revisions:' \ + '-d+[specify dates]:dates' \ + '-r-[specify revisions]:revisions' \ '-s+[specify states]:states:(Exp Stab Rel dead)' \ - '-w-[specify logins]:logins:' \ + '-w-[specify logins]:logins' \ '*:file:_cvs_modules' } -(( $+functions[_cvs_login] )) || -_cvs_login () { - false -} - -(( $+functions[_cvs_logout] )) || -_cvs_logout () { - false -} - (( $+functions[_cvs_rdiff] )) || -_cvs_rdiff () { +_cvs_rdiff() { # "+V:k:cuftsQqlRD:r:" _arguments -s \ '-c[output a context diff]' \ @@ -446,7 +405,7 @@ _cvs_rdiff () { '-s[short patch]' \ "(-R)-l[don't recurse]" \ '(-l)-R[recursive]' \ - '-V+[specify version]:version:' \ + '-V+[specify version]:version' \ '-k+[keyword]:keyword substitution:_cvs_k' \ '(-D -D -r -r)-t[top two differences]' \ '(-t -r)-D+[specify date]:date:_cvs_D' \ @@ -457,7 +416,7 @@ _cvs_rdiff () { } (( $+functions[_cvs_release] )) || -_cvs_release () { +_cvs_release() { # "+Qdq" _arguments -s \ '-d[delete]' \ @@ -465,7 +424,7 @@ _cvs_release () { } (( $+functions[_cvs_remove] )) || -_cvs_remove () { +_cvs_remove() { # "+flR" _arguments -s \ '-f[force to remove]' \ @@ -475,7 +434,7 @@ _cvs_remove () { } (( $+functions[_cvs_remove_arg] )) || -_cvs_remove_arg () { +_cvs_remove_arg() { if (( $+opt_args[-f] )); then _cvs_files else @@ -484,7 +443,7 @@ _cvs_remove_arg () { } (( $+functions[_cvs_rtag] )) || -_cvs_rtag () { +_cvs_rtag() { # "+FanfQqlRdbr:D:" _arguments -s \ '(-d)-F[move tag if already exists]' \ @@ -497,12 +456,12 @@ _cvs_rtag () { '(-d)-b[create branch]' \ '-D+[specify date]:date:_cvs_D' \ '-r+[specify revision]:tag:_cvs_revisions' \ - ':tag:' \ + ':tag' \ '*:module:_cvs_modules' } (( $+functions[_cvs_status] )) || -_cvs_status () { +_cvs_status() { # "+vlR" _arguments -s \ '-v[verbose]' \ @@ -512,7 +471,7 @@ _cvs_status () { } (( $+functions[_cvs_tag] )) || -_cvs_tag () { +_cvs_tag() { # "+FQqlRcdr:D:bf" _arguments -s \ '(-d)-F[move tag if already exists]' \ @@ -529,7 +488,7 @@ _cvs_tag () { } (( $+functions[_cvs_unedit] )) || -_cvs_unedit () { +_cvs_unedit() { # "+lR" _arguments -s \ "(-R)-l[don't recurse]" \ @@ -538,7 +497,7 @@ _cvs_unedit () { } (( $+functions[_cvs_update] )) || -_cvs_update () { +_cvs_update() { # "+ApCPflRQqduk:r:D:j:I:W:" _arguments -s \ '-C[overwrite local modification]' \ @@ -559,7 +518,7 @@ _cvs_update () { } (( $+functions[_cvs_watch] )) || -_cvs_watch () { +_cvs_watch() { local expl if (( CURRENT == 2 )); then @@ -568,39 +527,34 @@ _cvs_watch () { case "$words[2]" in on|off) # "+lR" _arguments -s \ - "(-R)-l[don't recurse]" \ - '(-l)-R[recursive]' \ - ':watch command:' \ - '*:file:_cvs_files' - ;; + "(-R)-l[don't recurse]" \ + '(-l)-R[recursive]' \ + ':watch command' \ + '*:file:_cvs_files' + ;; add|remove) # "+lRa:" _arguments -s \ - "(-R)-l[don't recurse]" \ - '(-l)-R[recursive]' \ - '*-a+[specify action]:action:(edit unedit commit all none)' \ - ':watch command:' \ - '*:file:_cvs_files' - ;; + "(-R)-l[don't recurse]" \ + '(-l)-R[recursive]' \ + '*-a+[specify action]:action:(edit unedit commit all none)' \ + ':watch command' \ + '*:file:_cvs_files' + ;; esac fi } (( $+functions[_cvs_watchers] )) || -_cvs_watchers () { +_cvs_watchers() { # "+lR" _arguments -s \ - "(-R)-l[don't recurse]" \ - '(-l)-R[recursive]' \ - '*:file:_cvs_files' -} - -(( $+functions[_cvs_version] )) || -_cvs_version () { - false + "(-R)-l[don't recurse]" \ + '(-l)-R[recursive]' \ + '*:file:_cvs_files' } (( $+functions[_cvs_loadstat] )) || -_cvs_loadstat () { +_cvs_loadstat() { zstyle -t ":completion:${curcontext}:" disable-stat && return 1 (( $+_cvs_loadstat_status )) && return $_cvs_loadstat_status @@ -610,7 +564,7 @@ _cvs_loadstat () { } (( $+functions[_cvs_root] )) || -_cvs_root () { +_cvs_root() { local cvspassfile id slash typeset -gU _cvs_roots @@ -636,45 +590,35 @@ _cvs_root () { } (( $+functions[_cvs_tempdir] )) || -_cvs_tempdir () { +_cvs_tempdir() { _tags directories && compadd "$@" $TMPPREFIX:h $TMPDIR /tmp } (( $+functions[_cvs_user_variable] )) || -_cvs_user_variable () { +_cvs_user_variable() { if compset -P '*='; then _default else - _message "variable=value" + _message "variable" fi } # define completion functions for cvs global options. -(( $+functions[_cvs_bindir] )) || -_cvs_bindir () { - _tags directories && { compadd "$@" /usr/local/bin || _files "$@" -/ } -} - (( $+functions[_cvs_editor] )) || -_cvs_editor () { +_cvs_editor() { _tags commands && compadd "$@" vi } -(( $+functions[_cvs_gzip_level] )) || -_cvs_gzip_level () { - _tags values && compadd "$@" 9 -} - # define completion functions for cvs common options and arguments. (( $+functions[_cvs_D] )) || -_cvs_D () { +_cvs_D() { _tags values && compadd "$@" today yesterday week\ ago month\ ago } (( $+functions[_cvs_k] )) || -_cvs_k () { +_cvs_k() { _values 'keyword substitution' \ 'kv[generate keyword strings using the default form]' \ "kvl[include locker's name in strings if given revision is locked]" \ @@ -685,12 +629,12 @@ _cvs_k () { } (( $+functions[_cvs_m] )) || -_cvs_m () { +_cvs_m() { _message "log message" } (( $+functions[_cvs_modules] )) || -_cvs_modules () { +_cvs_modules() { if compset -P '(#m)(*/)'; then _cvs_sub_modules "$cvsroot" "${MATCH%/}" else @@ -699,13 +643,13 @@ _cvs_modules () { } (( $+functions[_cvs_top_modules] )) || -_cvs_top_modules () { +_cvs_top_modules() { local root="$1" if [[ -d $root ]]; then _wanted modules expl 'module name' \ - compadd - $root/*(/:t) \ - ${${(M)${(f)"$(<$root/CVSROOT/modules)"}:#[^#]*}%%[ ]*} + compadd - $root/*(/:t) \ + ${${(M)${(f)"$(<$root/CVSROOT/modules)"}:#[^#]*}%%[ ]*} else if [[ "$_cvs_top_modules_cache_key" != "$root" ]]; then _cvs_top_modules_cache_key="$root" @@ -722,7 +666,7 @@ _cvs_top_modules () { fi if (( $#_cvs_top_modules_cache_mods )); then _wanted modules expl 'module name' \ - compadd -a _cvs_top_modules_cache_mods + compadd -a _cvs_top_modules_cache_mods else _message 'module name' fi @@ -730,7 +674,7 @@ _cvs_top_modules () { } (( $+functions[_cvs_sub_modules] )) || -_cvs_sub_modules () { +_cvs_sub_modules() { local root="$1" dir="$2" ignore if [[ -d $root ]]; then @@ -746,7 +690,7 @@ _cvs_sub_modules () { fi if (( $#_cvs_sub_modules_cache_mods )); then _wanted modules expl 'module name' \ - compadd -qS/ -a _cvs_sub_modules_cache_mods + compadd -qS/ -a _cvs_sub_modules_cache_mods else _message 'module name' fi @@ -755,7 +699,7 @@ _cvs_sub_modules () { # _cvs_run cvsroot directory cvs-arguments... (( $+functions[_cvs_run] )) || -_cvs_run () { +_cvs_run() { local cvsroot="$1" dir="$2" shift 2 local d=/tmp/zsh-cvs-work-$$ @@ -772,7 +716,7 @@ _cvs_run () { # _cvs_remote_directories cvsroot directory [variable] (( $+functions[_cvs_remote_directories] )) || -_cvs_remote_directories () { +_cvs_remote_directories() { local root="$1" dir="$2" subdirs shift 2 subdirs=(${${(M)${(f)"$(_call_program directories _cvs_run "$root" "$dir" update -r00 -d -p 2>&1)"}:#* New directory \`*\' -- ignored}/(#b)*\`(*)\'*/$match[1]}) @@ -786,7 +730,7 @@ _cvs_remote_directories () { } (( $+functions[_cvs_vendor_branches] )) || -_cvs_vendor_branches () { +_cvs_vendor_branches() { local expl vendor_branch vendor_branch=() if zstyle -T ":completion:${curcontext}:" remote-access; then @@ -806,7 +750,7 @@ _cvs_vendor_branches () { # _cvs_extract_vendor_branch [-b numeric-branch] cvsroot directory [variable] (( $+functions[_cvs_extract_vendor_branch] )) || -_cvs_extract_vendor_branch () { +_cvs_extract_vendor_branch() { local numeric='1\.1\.1' if [[ $1 = -b ]]; then numeric="${2//./\\.}" @@ -841,7 +785,7 @@ q } (( $+functions[_cvs_revisions] )) || -_cvs_revisions () { +_cvs_revisions() { local expl if [[ $_cvs_revisions_key != $cvsroot:$PWD ]]; then @@ -850,7 +794,7 @@ _cvs_revisions () { _cvs_revisions_cache=( $(CVS_IGNORE_REMOTE_ROOT= _call_program tags cvs -d "$cvsroot" -q status -vl .| sed -n -e '/No Tags Exist/d' \ - -e 's/^ \([A-Za-z][-_0-9A-Za-z]*\).*/\1/p'| + -e 's/^ \([A-Za-z][-_0-9A-Za-z]*\).*/\1/p'| sort|uniq) ) else @@ -868,7 +812,7 @@ _cvs_revisions () { # define completion functions for files maintained by cvs. (( $+functions[_cvs_files] )) || -_cvs_files () { +_cvs_files() { _alternative \ 'directories:directory:_cvs_existing_directories' \ 'existing-files:file:_cvs_existing_entries' \ @@ -876,7 +820,7 @@ _cvs_files () { } (( $+functions[_cvs_files_modified] )) || -_cvs_files_modified () { +_cvs_files_modified() { _alternative \ 'directories:directory:_cvs_existing_directories' \ 'existing-files:file:_cvs_modified_entries' \ @@ -884,28 +828,28 @@ _cvs_files_modified () { } (( $+functions[_cvs_files_removed] )) || -_cvs_files_removed () { +_cvs_files_removed() { _alternative \ 'directories:directory:_cvs_existing_directories' \ 'removed-files:removed file:_cvs_nonexistent_entries' } (( $+functions[_cvs_files_unmaintained] )) || -_cvs_files_unmaintained () { +_cvs_files_unmaintained() { _cvs_nonentried_files || _cvs_existing_directories || _cvs_strict_nonentried_files } (( $+functions[_cvs_existing_directories] )) || -_cvs_existing_directories () { +_cvs_existing_directories() { local expl _wanted directories expl directory _path_files -g "*~(*/|)CVS(/)" || _cvs_path_prefixes } (( $+functions[_cvs_existing_entries] )) || -_cvs_existing_entries () { +_cvs_existing_entries() { local expl match linedir realdir pat match=() : ${PREFIX:#(#b)(*/)(*)} @@ -917,7 +861,7 @@ _cvs_existing_entries () { } (( $+functions[_cvs_modified_entries] )) || -_cvs_modified_entries () { +_cvs_modified_entries() { if _cvs_loadstat; then local expl match linedir realdir pat slash=/ match=() @@ -941,7 +885,7 @@ _cvs_ignore_default=( ) (( $+functions[_cvs_strict_nonentried_files] )) || -_cvs_strict_nonentried_files () { +_cvs_strict_nonentried_files() { local expl match linedir realdir omitpats match=() @@ -953,15 +897,15 @@ _cvs_strict_nonentried_files () { ${${${${(M)${(f)"$(<"$realdir"CVS/Entries)"}:#/*}#/}%%/*}//(#m)[][*?()<|^~#\\]/\\$MATCH} ) if (( $#omitpats )); then - _path_files -g "*~(*/|)(${(j:|:)~omitpats})(D.)" + _path_files -g "*~(*/|)(${(j:|:)~omitpats})(D.)" else - _path_files -g "*~(*/|)(D.)" + _path_files -g "*~(*/|)(D.)" fi } } (( $+functions[_cvs_nonentried_files] )) || -_cvs_nonentried_files () { +_cvs_nonentried_files() { local expl match linedir realdir omitpats match=() @@ -983,7 +927,7 @@ _cvs_nonentried_files () { } (( $+functions[_cvs_nonexistent_entries] )) || -_cvs_nonexistent_entries () { +_cvs_nonexistent_entries() { local expl match linedir realdir files match=() : ${PREFIX:#(#b)(*/)(*)} @@ -1000,7 +944,7 @@ _cvs_nonexistent_entries () { } (( $+functions[_cvs_path_prefixes] )) || -_cvs_path_prefixes () { +_cvs_path_prefixes() { local expl match match=() [[ "$PREFIX$SUFFIX" = (#b)(*)(/[^/]#) ]] && { diff --git a/Completion/Unix/Command/_fakeroot b/Completion/Unix/Command/_fakeroot new file mode 100644 index 000000000..f7a298cf2 --- /dev/null +++ b/Completion/Unix/Command/_fakeroot @@ -0,0 +1,10 @@ +#compdef fakeroot + +_arguments \ + '(-l --lib)'{-l,--lib}'[specify alternate wrapper library]:wrapper library:_files' \ + '--faked[specify alternate faked binary]:fake binary:_command_names -e' \ + '-s[save the fakeroot environment on exit]:save file:_files' \ + '-i[load a previously saved environment]:file:_files' \ + '(-u --unknown-is-real)'{-u,--unknown-is-real}'[use real ownership of previously unknown files]' \ + '(-):command name:_command_names -e' \ + '*::arguments:_normal' diff --git a/Completion/Unix/Command/_fsh b/Completion/Unix/Command/_fsh index a7cc22e6a..637bc401f 100644 --- a/Completion/Unix/Command/_fsh +++ b/Completion/Unix/Command/_fsh @@ -1,23 +1,21 @@ #compdef fsh -_arguments \ - '(--help)-h[help]' \ - '(-h)--help' \ - '(--version)-V[version]' \ - '(-V)--version' \ - '-r[method]:method:(rsh ssh)' \ - '-l[login]:login:_users' \ - '(--timeout)-T:idle timeout:' \ - '(-T)--timeout:idle timeout:' \ - ':remote host name:_hosts' \ - '(-):command: _command_names -e' \ - '*::args:->command' && return 0 +local curcontext="$curcontext" state line ret=1 -case "$state" in - command) - shift 1 words - (( CURRENT-- )) - _normal - return - ;; -esac +_arguments -C \ + '(- : *)'{-h,--help}'[display help information]' \ + '(- : *)'{-V,--version}'[display version information]' \ + '-r[specify method]:method:(rsh ssh)' \ + '-l[specify login id]:login:_users' \ + '(-T --timeout)'{-T,--timeout}':idle timeout' \ + ':remote host name:_hosts' \ + '(-):command: _command_names -e' \ + '*::args:->command' && ret=0 + +if [[ -n "$state" ]]; then + shift 1 words + (( CURRENT-- )) + _normal && ret=0 +fi + +return ret diff --git a/Completion/Unix/Command/_global b/Completion/Unix/Command/_global index cbf8a7179..bb6f7a0fa 100644 --- a/Completion/Unix/Command/_global +++ b/Completion/Unix/Command/_global @@ -1,45 +1,29 @@ #compdef global +local cmds="(-c --completion -f --file -g --grep -I --idutils -p --print-dbpath -P --path -u --update --version --help)" + _arguments \ - '(--completion)-c[completion on prefix]:prefix:' \ - '(-c)--completion:prefix:' \ - '(--file)-f[print function definitions in file]' \ - '(-f)--file' \ - '(--grep)-g[print all lines which match pattern using grep]:pattern' \ - '(-g)--grep' \ - '(--idutils)-I[print all lines which match pattern using id-utils]:pattern' \ - '(-I)--idutils' \ - '(--print-dbpath)-p[print location of GTAGS]' \ - '(-p)--print-dbpath' \ - '(--path)-P[print paths matching pattern]:pattern:' \ - '(-P)--path' \ - '(--update)-u[locate tag files and update incrementally]' \ - '(-u)--update' \ - '(--absolute)-a[print absolute path names]' \ - '(-a)--absolute' \ - '(--ignore-case)-i[ignore case in patterns]' \ - '(-i)--ignore-case' \ - '(--local)-l[print just objects which exist under the current directory]' \ - '(-l)--local' \ - '(--nofilter)-n[suppress sort filter and path conversion filter]' \ - '(-n)--nofilter' \ - '(--other)-o[search in other files, not just source files (with -g)]' \ - '(-o)--other' \ - '(--quiet)-q[quiet mode]' \ - '(-q)--quiet' \ - '(--reference --rootdir)-r[find object references instead of definitions]' \ - '(-r --rootdir)--rereference' \ - '(-r --reference)--rootdir' \ - '(--symbol)-s[find symbols instead of function names]:pattern:' \ - '(-s)--symbol' \ - '(--tags)-t[output in standard ctags format]' \ - '(-t)--tags' \ - '(--through -s -r -l)-T[search through all tag files in GTAGSLIBPATH]' \ - '(-T -s -r -l)--through' \ - '(--verbose)-v[verbose mode]' \ - '(-v)--verbose' \ - '(--cxref)-x[in addition to default output, list line number and contents]' \ - '(-x)--cxref' \ - '--version:show version number:' \ - '--help:show help:' \ - ':word:_global_tags' + "$cmds"{-c,--completion}'[completion on prefix]:prefix:' \ + "$cmds"{-f,--file}'[print function definitions in file]' \ + "$cmds"{-g,--grep}'[print all lines which match pattern using grep]:pattern' \ + "$cmds"{-I,--idutils}'[print all lines which match pattern using id-utils]:pattern' \ + "$cmds"{-p,--print-dbpath}'[print location of GTAGS]' \ + "$cmds"{-P,--path}'[print paths matching pattern]:pattern:' \ + "$cmds"{-u,--update}'[locate tag files and update incrementally]' \ + '(-a --absolute)'{-a,--absolute}'[print absolute path names]' \ + '(-e --regexp :)'{-e,--regexp}'[specify pattern]:pattern:_global_tags' \ + '(-G --basic-regexp :)'{-G,--basic-regexp}'[specify basic regexp to use]:word:_global_tags' \ + '(-i --ignore-case)'{-i,--ignore-case}'[ignore case in patterns]' \ + '(-l --local)'{-l,--local}'[print just objects which exist under the current directory]' \ + '(-n --nofilter)'{-n,--nofilter}'[suppress sort filter and path conversion filter]' \ + '(-o --other)'{-o,--other}'[search in other files, not just source files (with -g)]' \ + '(-q --quiet)'{-q,--quiet}'[quiet mode]' \ + '(-r --reference --rootdir)'{-r,--reference,--rootdir}'[find object references instead of definitions]' \ + '(-s --symbol)'{-s,--symbol}'[find symbols instead of function names]:pattern' \ + '(-t --tags)'{-t,--tags}'[output in standard ctags format]' \ + '(-T --through -s -r -l)'{-T,--through}'[search through all tag files in GTAGSLIBPATH]' \ + '(-v --verbose)'{-v,--verbose}'[verbose mode]' \ + '(-x --cxref)'{-x,--cxref}'[additionally list line number and contents]' \ + '(- :)--version[display version information]' \ + '(- :)--help[display help information]' \ + ':word:_global_tags' diff --git a/Completion/Unix/Command/_global_tags b/Completion/Unix/Command/_global_tags deleted file mode 100644 index bdd01baf6..000000000 --- a/Completion/Unix/Command/_global_tags +++ /dev/null @@ -1,9 +0,0 @@ -#autoload - -local globalresults - -[[ -z $words[CURRENT] ]] && return 1 - -globalresults=($(global --completion $words[CURRENT])) - -compadd -M 'm:{a-zA-Z}={A-Za-z}' -a "$@" - globalresults diff --git a/Completion/Unix/Command/_imagemagick b/Completion/Unix/Command/_imagemagick index eac3a2bf7..fd9780ad7 100644 --- a/Completion/Unix/Command/_imagemagick +++ b/Completion/Unix/Command/_imagemagick @@ -1,4 +1,4 @@ -#compdef display animate import identify montage convert combine mogrify xtp +#compdef animate composite combine convert display identify import mogrify montage xtp local state line expl formats curcontext="$curcontext" typeset -A opt_args @@ -19,227 +19,309 @@ if (( $# )); then fi case "$service" in -display) - _arguments -M 'm:{a-z}={A-Z}' \ + display) + _arguments -M 'm:{a-z}={A-Z}' \ '*-backdrop[use full screen]' \ - '*-border:border size (x):' \ - '*-colormap:colormap type:(Shared Private)' \ - '*-colors:preferred number of colors:' \ + '*-background:color:_x_color' \ + '*-border:border size (x)' \ + '*-bordercolor:color:_x_color' \ + '*-borderwidth:geometry' \ + '*-cache[specify memory available to the pixel cache]:memory (MB)' \ + '*-colormap:colormap type:(shared private)' \ + '*-colors:preferred number of colors' \ '*-colorspace:colorspace type:(GRAY OHTA RGB Transparent XYZ YCbCr YIQ YPbPr YUV CMYK)' \ - '*-comment:comment string:' \ + '*-comment:comment string' \ '*-compress:image compression type:(None BZip Fax Group4 JPEG LZW RunlengthEncoded Zip)' \ '*-contrast[enhance contrast]' \ '*+contrast[reduce contrast]' \ - '*-crop:crop image (x{+-}{+-}{%}):' \ - '*-delay:delay for next image (1/100ths of a second):' \ - '*-density:resolution in pixels of image (x):' \ + '*-crop:crop image (x{+-}{+-}{%%})' \ + '*-debug' \ + '*-delay:delay for next image (1/100ths of a second)' \ + '*-density:image resolution (x in pixels)' \ '*-despeckle[reduce speckles in image]' \ '*-display:display:_x_display' \ '*-dispose:GIF disposal method:((0:no\ disposal 1\:don'\''t\ dispose\ between\ frames 2\:overwrite\ frame\ with\ background\ color 3\:overwrite\ with\ previous\ frame))' \ '*-dither[apply dithering]' \ - '*-edge:edge detection factor (0.0 - 99.9%):' \ + '*-edge:edge detection factor (0.0 - 99.9%%)' \ + '*-endian:image endianess:(MSB LSB)' \ + '*+endian' \ '*-enhance[enhance noisy image]' \ '*-filter:filter type for resizing:(Point Box Triangle Hermite Hanning Hamming Blackman Gaussian Quadratic Cubic Catrom Mitchell Lanczos Bessel Sinc)' \ '*-flip[vertical mirror image]' \ '*-flop[horizontal mirror image]' \ + '*-font:_x_font' \ + '*-foreground:color:_x_color' \ '*-frame:border dimensions (x++)' \ - '*-gamma[gamma correction level]:gamma correction level ( or //):' \ - '*+gamma[gamma correction level (don'\''t change pixels)]:gamma correction level ( or //):' \ - '*-geometry:window geometry (x{+-}{+-}{%}{!}{<}{>}):' \ + '*-gamma[gamma correction level]:gamma correction level ( or //)' \ + '*+gamma[gamma correction level (don'\''t change pixels)]:gamma correction level ( or //)' \ + '*-geometry:window geometry (x{+-}{+-}{%%}{!}{<}{>})' \ + '(- *)-help[display help information]' \ + '*-iconGeometry:geometry:_x_geometry' \ + '*-iconic' \ '*-immutable[disallow image modifications]' \ '*-interlace:interlacing scheme:(None Line Plane Partition)' \ - '*-label:label string:' \ + '*-label:label string' \ + '*-magnify:factor' \ '*-map:colormap type for display:(best default gray red green blue)' \ '*-matte[store matte channel]' \ + '*-mattecolor:color:_x_color' \ '*-monochrome[transform to black and white]' \ + '*-name:image name' \ '*-negate[invert image]' \ '*+negate[invert only grayscale]' \ - '*-page:geometry of image canvas (x{+-}{+-}{%}{!}{<}{>}):(11x17 Ledger Legal Letter LetterSmall ArchE ArchD ArchC ArchB ArchA A0 A1 A2 A3 A4 A4Small A5 A6 A7 A8 A9 A10 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 Flsa Flse HalfLetter)' \ - '*-quality:JPEG/MIFF/PNG compression level:' \ - '*-raise:3-D edges (raised):' \ - '*+raise:3-D edges (lowered):' \ + '*-noop' \ + '*-page:geometry of image canvas (x{+-}{+-}{%%}{!}{<}{>}):(11x17 Ledger Legal Letter LetterSmall ArchE ArchD ArchC ArchB ArchA A0 A1 A2 A3 A4 A4Small A5 A6 A7 A8 A9 A10 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 Flsa Flse HalfLetter)' \ + '*-quality:JPEG/MIFF/PNG compression level' \ + '*-raise:3-D edges (raised)' \ + '*+raise:3-D edges (lowered)' \ '*-remote:remote command (file name):_imagemagick' \ - '*-roll:image roll offset ({+-}{+-}):' \ - '*-rotate:rotation (degrees{<}{>}):' \ - '*-sample:scale factors (x):' \ - '*-scene:image scene number:' \ - '*-segment:cluster pixel number:' \ - '*-sharpen:sharpening factor (0.0 - 99.9%):' \ - '*-size:image size (x+):' \ + '*-roll:image roll offset ({+-}{+-})' \ + '*-rotate:rotation (degrees{<}{>})' \ + '*-sample:scale factors (x)' \ + '*-sampling_factor:sampling factor (x)' \ + '*-scenes:image scene number' \ + '*-segment:cluster pixel number' \ + '*-shared_memory' \ + '*-sharpen:sharpening factor (0.0 - 99.9%%)' \ + '*-size:image size (x+)' \ + '*-text_font:_x_font' \ '*-texture:background texture image:_imagemagick' \ - '*-update:redisplay test time (seconds):' \ - '*-title:image title:' \ - '*-treedepth:color reduction tree depth:' \ + '*-title:image title' \ + '*-treedepth:color reduction tree depth' \ + '*-trim' \ + '*-update:redisplay test time (seconds)' \ + '*-use_pixmap' \ + '*-verbose' \ '*-visual:visual to use for display:(StaticGray GrayScale StaticColor PseudoColor TrueColor DirectColor default)' \ '*-window:window ID to display image in:_x_window' \ + '*-window_group' \ '*-write:output filename:_files' \ '*:picture file:_imagemagick' && return ;; -animate) - _arguments -M 'm:{a-z}={A-Z}' \ + animate) + _arguments -M 'm:{a-z}={A-Z}' \ '*-backdrop[use full screen]' \ + '*-background:color:_x_color' \ + '*-bordercolor:color:_x_color' \ + '*-borderwidth:geometry' \ + '*-cache[specify memory available to the pixel cache]:memory (MB)' \ + '*-chop:x{+-}{+-}' \ '*-colormap:colormap type:(Shared Private)' \ - '*-colors:preferred number of colors:' \ + '*-colors:preferred number of colors' \ '*-colorspace:colorspace type:(GRAY OHTA RGB Transparent XYZ YCbCr YIQ YPbPr YUV CMYK)' \ - '*-crop:crop image (x{+-}{+-}{%}):' \ - '*-delay:delay for next image (1/100ths of a second):' \ - '*-density:resolution in pixels of image (x):' \ + '*-crop:crop image (x{+-}{+-})' \ + '*-debug' \ + '*-delay:delay for next image (1/100ths of a second)' \ + '*-density:image resolution (x in pixels)' \ + '*-depth:image depth:(8 16)' \ '*-display:display:_x_display' \ '*-dither[apply dithering]' \ - '*-gamma[gamma correction level]:gamma correction level ( or //):' \ - '*+gamma[gamma correction level (don'\''t change pixels)]:gamma correction level ( or //):' \ - '*-geometry:window geometry (x{+-}{+-}{%}{!}{<}{>}):' \ + '*-font:_x_font' \ + '*-foreground:color:_x_color' \ + '*-gamma[gamma correction level]:gamma correction level ( or //)' \ + '*+gamma[gamma correction level (don'\''t change pixels)]:gamma correction level ( or //)' \ + '*-geometry:window geometry (x{+-}{+-}{%%}{!}{<}{>})' \ + '(- *)-help[display help information]' \ + '*-iconGeometry:geometry:_x_geometry' \ + '*-iconic' \ '*-interlace:interlacing scheme:(None Line Plane Partition)' \ '*-map:colormap type for display:(best default gray red green blue)' \ + '*-matte[store matte channel]' \ + '*-mattecolor:color:_x_color' \ '*-monochrome[transform to black and white]' \ + '*-name:image name' \ + '*-noop' \ + '*-pause:delay (seconds)' \ '*-remote:remote command (file name):_imagemagick' \ - '*-rotate:rotation (degrees{<}{>}):' \ - '*-scene:image scene number:' \ - '*-size:image size (x+):' \ - '*-title:image title:' \ - '*-treedepth:color reduction tree depth:' \ + '*-rotate:rotation (degrees{<}{>})' \ + '*-scenes:image scene number' \ + '*-shared_memory' \ + '*-size:image size (x+)' \ + '*-text_font:_x_font' \ + '*-title:image title' \ + '*-treedepth:color reduction tree depth' \ + '*-trim' \ '*-verbose[print image information]' \ '*-visual:visual to use for display:(StaticGray GrayScale StaticColor PseudoColor TrueColor DirectColor default)' \ '*-window:window ID to display image in:_x_window' \ '*:picture file:_imagemagick' && return ;; -import) - _arguments -M 'm:{a-z}={A-Z}' \ + import) + _x_arguments -M 'm:{a-z}={A-Z}' \ '-adjoin[join images]' \ '-border:border size (x):' \ - '-colors:preferred number of colors:' \ + '-bordercolor:color:_x_color' \ + '-cache[specify memory available to the pixel cache]:memory (MB)' \ + '-colors:preferred number of colors' \ '-colorspace:colorspace type:(GRAY OHTA RGB Transparent XYZ YCbCr YIQ YPbPr YUV CMYK)' \ - '-comment:comment string:' \ - '-compress:image compression type:(None BZip Fax Group4 JPEG LZW RunlengthEncoded Zip)' \ - '-crop:crop image (x{+-}{+-}{%}):' \ - '-delay:delay for next image (1/100ths of a second):' \ - '-density:resolution in pixels of image (x):' \ + '-comment:comment string' \ + '-crop:crop image (x{+-}{+-}{%%})' \ + '-debug' \ + '-delay:delay for next image (1/100ths of a second)' \ + '-density:resolution in pixels of image (x)' \ + '-depth:image depth:(8 16)' \ '-descend[descend window hierarchy]' \ - '-display:display:_x_display' \ '-dispose:GIF disposal method:((0:no\ disposal 1\:don'\''t\ dispose\ between\ frames 2\:overwrite\ frame\ with\ background\ color 3\:overwrite\ with\ previous\ frame))' \ '-dither[apply dithering]' \ + '(+endian)-endian:image endianess:(MSB LSB)' \ + '(-endian)+endian' \ '-frame[include window manager frame]' \ - '-geometry:image geometry (x{+-}{+-}{%}{!}{<}{>}):' \ + '(- *)-help[display help information]' \ '-interlace:interlacing scheme:(None Line Plane Partition)' \ + '-label:label string' \ '-monochrome[transform to black and white]' \ '-negate[invert image]' \ '+negate[invert only grayscale]' \ - '-page:geometry of image canvas (x{+-}{+-}{%}{!}{<}{>}):(11x17 Ledger Legal Letter LetterSmall ArchE ArchD ArchC ArchB ArchA A0 A1 A2 A3 A4 A4Small A5 A6 A7 A8 A9 A10 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 Flsa Flse HalfLetter)' \ - '-pointsize:Postscript font size:' \ - '-quality:JPEG/MIFF/PNG compression level:' \ - '-rotate:rotation (degrees{<}{>}):' \ - '-scene:number of screen snapshots:' \ + '-page:geometry of image canvas (x{+-}{+-}{%%}{!}{<}{>}):(11x17 Ledger Legal Letter LetterSmall ArchE ArchD ArchC ArchB ArchA A0 A1 A2 A3 A4 A4Small A5 A6 A7 A8 A9 A10 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 Flsa Flse HalfLetter)' \ + '-pause:delay (seconds)' \ + '-ping' \ + '-pointsize:Postscript font size' \ + '-quality:JPEG/MIFF/PNG compression level' \ + '-resize:size (x{%%}{@}{!}{<}{>})' \ + '-rotate:rotation (degrees{<}{>})' \ + '-sampling_factor:sampling factor (x)' \ + '-scene:number of screen snapshots' \ '-screen[get root window]' \ '-silent[be quiet]' \ - '-transparency:transparent color:_x_color' \ - '-treedepth:color reduction tree depth:' \ + '-snaps:number' \ + '-transparent:transparent color:_x_color' \ + '-treedepth:color reduction tree depth' \ + '-trim' \ + '-type:image type:(Bilevel Grayscale Palette PaletteMatte TrueColor TrueColorMatte ColorSeparation ColorSeparationMatte Optimize)' \ '-verbose[print image information]' \ '-window:window ID to get:_x_window' \ ':output file:_files' && return ;; -montage) - _arguments -M 'm:{a-z}={A-Z}' \ + montage) + _arguments -M 'm:{a-z}={A-Z}' \ '*-adjoin[join images]' \ - '*-blur:blur factor (0.0 - 99.9%):' \ - '*-colors:preferred number of colors:' \ + '*-background:color:_x_color' \ + '*-blur:blur factor (0.0 - 99.9%%)' \ + '*-bordercolor:color:_x_color' \ + '*-borderwidth:geometry' \ + '*-cache[specify memory available to the pixel cache]:memory (MB)' \ + '*-colors:preferred number of colors' \ '*-colorspace:colorspace type:(GRAY OHTA RGB Transparent XYZ YCbCr YIQ YPbPr YUV CMYK)' \ - '*-comment:comment string:' \ + '*-comment:comment string' \ '*-compose:image composition type:(Over In Out Atop Xor Plus Minus Add Subtract Difference Bumpmap Replace ReplaceRed ReplaceGreen ReplaceBlue ReplaceMatte)' \ '*-compress:image compression type:(None BZip Fax Group4 JPEG LZW RunlengthEncoded Zip)' \ - '*-crop:crop image (x{+-}{+-}{%}):' \ - '*-density:resolution in pixels of image (x):' \ + '*-crop:crop image (x{+-}{+-}{%%})' \ + '*-debug' \ + '*-density:resolution in pixels of image (x)' \ + '*-depth:image depth:(8 16)' \ '*-display:display:_x_display' \ '*-dispose:GIF disposal method:((0:no\ disposal 1\:don'\''t\ dispose\ between\ frames 2\:overwrite\ frame\ with\ background\ color 3\:overwrite\ with\ previous\ frame))' \ '*-dither[apply dithering]' \ '*+dither[render Postscript without aliasing]' \ '*-draw:drawing primitive:compadd -S "\\ " - rectangle circle ellipse polygon color matte text image' \ + '*-endian:image endianess:(MSB LSB)' \ + '*+endian' \ '*-filter:filter type for resizing:(Point Box Triangle Hermite Hanning Hamming Blackman Gaussian Quadratic Cubic Catrom Mitchell Lanczos Bessel Sinc)' \ '*-frame[draw frame around image]' \ - '*-frame[don'\''t draw frame around image]' \ '*-font:annotation font:_x_font' \ - '*-gamma[gamma correction level]:gamma correction level ( or //):' \ - '*+gamma[gamma correction level (don'\''t change pixels)]:gamma correction level ( or //):' \ - '*-geometry:window geometry (x{+-}{+-}{%}{!}{<}{>}):' \ + '*-gamma[gamma correction level]:gamma correction level ( or //)' \ + '*+gamma[gamma correction level (don'\''t change pixels)]:gamma correction level ( or //)' \ + '*-geometry:window geometry (x{+-}{+-}{%%}{!}{<}{>})' \ '*-gravity:image gravity:(Center North NorthEast East SouthEast South SouthWest West NorthWest)' \ + '(- *)-help[display help information]' \ '*-interlace:interlacing scheme:(None Line Plane Partition)' \ - '*-label:label string:' \ + '*-label:label string' \ '*-matte[store matte channel]' \ + '*-mattecolor:color:_x_color' \ '*-mode:montage type:(Frame Unframe Concatenate)' \ '*-monochrome[transform to black and white]' \ - '*-page:geometry of image canvas (x{+-}{+-}{%}{!}{<}{>}):(11x17 Ledger Legal Letter LetterSmall ArchE ArchD ArchC ArchB ArchA A0 A1 A2 A3 A4 A4Small A5 A6 A7 A8 A9 A10 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 Flsa Flse HalfLetter)' \ + '*-noop' \ + '*-page:geometry of image canvas (x{+-}{+-}{%%}{!}{<}{>}):(11x17 Ledger Legal Letter LetterSmall ArchE ArchD ArchC ArchB ArchA A0 A1 A2 A3 A4 A4Small A5 A6 A7 A8 A9 A10 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 Flsa Flse HalfLetter)' \ '*-pen:font color:_x_color' \ - '*-pointsize:Postscript font size:' \ - '*-quality:JPEG/MIFF/PNG compression level:' \ - '*-rotate:rotation (degrees{<}{>}):' \ - '*-scene:image scene number:' \ + '*-pointsize:Postscript font size' \ + '*-quality:JPEG/MIFF/PNG compression level' \ + '*-resize:size (x{%%}{@}{!}{<}{>})' \ + '*-rotate:rotation (degrees{<}{>})' \ + '*-sampling_factor:sampling factor (x)' \ + '*-scenes:image scene number' \ '*-shadow[add shadow]' \ - '*-sharpen:sharpening factor (0.0 - 99.9%):' \ - '*-size:image size (x+):' \ + '*-sharpen:sharpening factor (0.0 - 99.9%%)' \ + '*-size:image size (x+)' \ + '*-stroke:color:_x_color' \ '*-texture:background texture image:_imagemagick' \ - '*-tile:number of tiles (x):' \ - '*-transparency:transparent color:_x_color' \ - '*-treedepth:color reduction tree depth:' \ + '*-tile:number of tiles (x)' \ + '*-title:image title' \ + '*-transparent:transparent color:_x_color' \ + '*-treedepth:color reduction tree depth' \ + '*-trim' \ + '*-type:image type:(Bilevel Grayscale Palette PaletteMatte TrueColor TrueColorMatte ColorSeparation ColorSeparationMatte Optimize)' \ '*-verbose[print image information]' \ '*:picture file:_imagemagick' && return ;; -convert) - _arguments -C -M 'm:{a-z}={A-Z}' \ + convert) + _arguments -C -M 'm:{a-z}={A-Z}' \ '-adjoin[join images]' \ + '-affine[drawing transform matrix]:matrix' \ '-antialias[remove pixel aliasing]' \ '-append[append image sequence]' \ '-average[average image sequence]' \ - '-blur:blur factor (0.0 - 99.9%):' \ - '-border:border size (x):' \ + '-background[specify background color]:color:_x_color' \ + '-blur:blur factor (0.0 - 99.9%%)' \ + '-border:border size (x)' \ '-bordercolor:border color:_x_color' \ '-box:annotation bounding box color:_x_color' \ - '-charcoal:charcoal drawing factor:' \ - '-coalesce[merge image sequence]:' \ - '-colorize:colorization amount ( or //):' \ - '-colors:preferred number of colors:' \ + '-cache[specify memory available to the pixel cache]:memory (MB)' \ + '-channel:channel:(Red Green Blue Opacity Cyan Magenta Yellow Black)' \ + '-charcoal:charcoal drawing factor' \ + '-chop:x{+-}{+-}' \ + '-clip' \ + '-coalesce[merge image sequence]' \ + '-colorize:colorization amount ( or //)' \ + '-colors:preferred number of colors' \ '-colorspace:colorspace type:(GRAY OHTA RGB Transparent XYZ YCbCr YIQ YPbPr YUV CMYK)' \ - '-comment:comment string:' \ + '-comment:comment string' \ '-compress:image compression type:(None BZip Fax Group4 JPEG LZW RunlengthEncoded Zip)' \ '-contrast[enhance contrast]' \ '+contrast[reduce contrast]' \ - '-crop:crop image (x{+-}{+-}{%}):' \ - '-cycle:image colormap shift:' \ + '-crop:crop image (x{+-}{+-}{%%})' \ + '-cycle:image colormap shift' \ + '-debug' \ '-deconstruct[break down image sequence into parts]' \ - '-delay:delay for next image (1/100ths of a second):' \ - '-density:resolution in pixels of image (x):' \ + '-delay:delay for next image (1/100ths of a second)' \ + '-density:resolution in pixels of image (x)' \ '-depth:image depth:(8 16)' \ '-despeckle[reduce speckles in image]' \ '-display:display:_x_display' \ '-dispose:GIF disposal method:((0:no\ disposal 1\:don'\''t\ dispose\ between\ frames 2\:overwrite\ frame\ with\ background\ color 3\:overwrite\ with\ previous\ frame))' \ '-dither[apply dithering]' \ '-draw:drawing primitive:compadd -S "\\ " - rectangle circle ellipse polygon color matte text image' \ - '-edge:edge detection factor (0.0 - 99.9%):' \ + '-edge:edge detection factor (0.0 - 99.9%%)' \ '-emboss[emboss image]' \ + '(+endian)-endian:image endianess:(MSB LSB)' \ + '(-endian)+endian' \ '-enhance[enhance image]' \ '-equalize[histogram equalization]' \ + '-fill[specify color to use when filling a graphic primitive]:color:_x_color' \ '-filter:filter type for resizing:(Point Box Triangle Hermite Hanning Hamming Blackman Gaussian Quadratic Cubic Catrom Mitchell Lanczos Bessel Sinc)' \ + '-flatten[flatten a sequence of images]' \ '-flip[vertical mirror image]' \ '-flop[horizontal mirror image]' \ '-font:annotation font:_x_font' \ '-frame:border dimensions (x++)' \ - '-fuzz:maximum distance for equal colors:' \ - '-gamma[gamma correction level]:gamma correction level ( or //):' \ - '+gamma[gamma correction level (don'\''t change pixels)]:gamma correction level ( or //):' \ - '-geometry:window geometry (x{+-}{+-}{%}{!}{<}{>}):' \ + '-fuzz:maximum distance for equal colors' \ + '-gamma[gamma correction level]:gamma correction level ( or //)' \ + '+gamma[gamma correction level (don'\''t change pixels)]:gamma correction level ( or //)' \ + '-geometry:window geometry (x{+-}{+-}{%%}{!}{<}{>})' \ '-gravity:image gravity:(Center North NorthEast East SouthEast South SouthWest West NorthWest)' \ - '-implode:implosion factor (0.0 - 99.9%):' \ + '-implode:implosion factor (0.0 - 99.9%%)' \ '-interlace:interlacing scheme:(None Line Plane Partition)' \ - '-label:label string:' \ + '-label:label string' \ '-layer:layer type:(Red Green Blue Matte)' \ - '-linewidth:line width:' \ - '-loop:number of iterations (GIF animation):' \ + '-linewidth:line width' \ + '-loop:number of iterations (GIF animation)' \ '-map[single image colormap file]:picture file for colors:_imagemagick' \ '+map[all images colormap file]:picture file for colors:_imagemagick' \ '-matte[store matte channel]' \ - '-modulate:,,:' \ + '-modulate:,,' \ '-monochrome[transform to black and white]' \ '-morph[morph image sequence]' \ '-negate[invert image]' \ @@ -248,37 +330,37 @@ convert) '+noise:noise type:(Uniform Gaussian Multiplicative Impulse Laplacian Poisson)' \ '-normalize[use full color value range]' \ '-opaque:image pen color:_x_color' \ - '-page:geometry of image canvas (x{+-}{+-}{%}{!}{<}{>}):(11x17 Ledger Legal Letter LetterSmall ArchE ArchD ArchC ArchB ArchA A0 A1 A2 A3 A4 A4Small A5 A6 A7 A8 A9 A10 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 Flsa Flse HalfLetter)' \ - '-paint:oil painting radius:' \ + '-page:geometry of image canvas (x{+-}{+-}{%%}{!}{<}{>}):(11x17 Ledger Legal Letter LetterSmall ArchE ArchD ArchC ArchB ArchA A0 A1 A2 A3 A4 A4Small A5 A6 A7 A8 A9 A10 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 Flsa Flse HalfLetter)' \ + '-paint:oil painting radius' \ '-pen:font color:_x_color' \ - '-pointsize:Postscript font size:' \ + '-pointsize:Postscript font size' \ '-preview:image preview type:(Rotate Shear Roll Hue Saturation Brightness Gamma Spiff Dull Grayscale Quantize Despeckle ReduceNoise AddNoise Sharpen Blur Threshold Edge Detect Spread Shade Raise Segment Solarize Swirl Implode Wave OilPaint CharcoalDrawing JPEG)' \ '-profile:information profile:->profile' \ - '-quality:JPEG/MIFF/PNG compression level:' \ - '-raise:lighten or darken edges (x):' \ - '-region:image region (x{+-}{+-}):' \ - '-roll:image roll offset ({+-}{+-}):' \ - '-rotate:rotation (degrees{<}{>}):' \ - '-sample:scale factors (x):' \ - '-scene:image scene number:' \ - '-seed:random number seed:' \ - '-segment:segment thresholds (x):' \ - '-shade:image shading (x):' \ - '-sharpen:sharpening factor (0.0 - 99.9%):' \ - '-shear:shearing angles (x in degrees):' \ - '-size:image size (x+):' \ - '-solarize:solarization threshold:' \ - '-spread:neighborhood size:' \ - '-swirl:swirl tightness:' \ + '-quality:JPEG/MIFF/PNG compression level' \ + '-raise:lighten or darken edges (x)' \ + '-region:image region (x{+-}{+-})' \ + '-roll:image roll offset ({+-}{+-})' \ + '-rotate:rotation (degrees{<}{>})' \ + '-sample:scale factors (x)' \ + '-scene:image scene number' \ + '-seed:random number seed' \ + '-segment:segment thresholds (x)' \ + '-shade:image shading (x)' \ + '-sharpen:sharpening factor (0.0 - 99.9%%)' \ + '-shear:shearing angles (x in degrees)' \ + '-size:image size (x+)' \ + '-solarize:solarization threshold' \ + '-spread:neighborhood size' \ + '-swirl:swirl tightness' \ '-texture:background texture image:_imagemagick' \ - '-threshold:threshold for maximum intensity:' \ + '-threshold:threshold for maximum intensity' \ '-transparency:transparent color:_x_color' \ - '-treedepth:color reduction tree depth:' \ + '-treedepth:color reduction tree depth' \ '-units:image resolution type:(Undefined PixelsPerInch PixelsPerCentimeter)' \ '-verbose[print image information]' \ - '-view:FlashPix viewing parameters:' \ - '-wave:sine wave parameters (x):' \ - '*:picture file:_imagemagick' && return 0 + '-view:FlashPix viewing parameters' \ + '-wave:sine wave parameters (x)' \ + '*:picture file:_imagemagick' && return if [[ "$state" = profile ]]; then if compset -P '*:'; then @@ -290,36 +372,36 @@ convert) fi ;; -combine) - _arguments -M 'm:{a-z}={A-Z}' \ - '-blend:blending factor (0.0 - 99.9%):' \ - '-colors:preferred number of colors:' \ + combine|composite) + _arguments -M 'm:{a-z}={A-Z}' \ + '-blend:blending factor (0.0 - 99.9%%)' \ + '-colors:preferred number of colors' \ '-colorspace:colorspace type:(GRAY OHTA RGB Transparent XYZ YCbCr YIQ YPbPr YUV CMYK)' \ - '-comment:comment string:' \ + '-comment:comment string' \ '-compose:image composition type:(Over In Out Atop Xor Plus Minus Add Subtract Difference Bumpmap Replace ReplaceRed ReplaceGreen ReplaceBlue ReplaceMatte)' \ '-compress:image compression type:(None BZip Fax Group4 JPEG LZW RunlengthEncoded Zip)' \ - '-density:resolution in pixels of image (x):' \ - '-displace:displacements scales (x):' \ + '-density:resolution in pixels of image (x)' \ + '-displace:displacements scales (x)' \ '-display:display:_x_display' \ '-dispose:GIF disposal method:((0:no\ disposal 1\:don'\''t\ dispose\ between\ frames 2\:overwrite\ frame\ with\ background\ color 3\:overwrite\ with\ previous\ frame))' \ '-dither[apply dithering]' \ '+dither[render Postscript without aliasing]' \ '-font:normal text font:_x_font' \ - '-geometry:window geometry (x{+-}{+-}{%}{!}{<}{>}):' \ + '-geometry:window geometry (x{+-}{+-}{%%}{!}{<}{>})' \ '-gravity:image gravity:(Center North NorthEast East SouthEast South SouthWest West NorthWest)' \ '-interlace:interlacing scheme:(None Line Plane Partition)' \ - '-label:label string:' \ + '-label:label string' \ '-matte[store matte channel]' \ '-monochrome[transform to black and white]' \ '-negate[invert image]' \ '+negate[invert only grayscale]' \ - '-page:geometry of image canvas (x{+-}{+-}{%}{!}{<}{>}):(11x17 Ledger Legal Letter LetterSmall ArchE ArchD ArchC ArchB ArchA A0 A1 A2 A3 A4 A4Small A5 A6 A7 A8 A9 A10 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 Flsa Flse HalfLetter)' \ - '-quality:JPEG/MIFF/PNG compression level:' \ - '-scene:image scene number:' \ - '-stegano:watermark offset:' \ + '-page:geometry of image canvas (x{+-}{+-}{%%}{!}{<}{>}):(11x17 Ledger Legal Letter LetterSmall ArchE ArchD ArchC ArchB ArchA A0 A1 A2 A3 A4 A4Small A5 A6 A7 A8 A9 A10 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 Flsa Flse HalfLetter)' \ + '-quality:JPEG/MIFF/PNG compression level' \ + '-scene:image scene number' \ + '-stegano:watermark offset' \ '-stereo[create stereo anaglyph]' \ '-tile[repeat composite operation]' \ - '-treedepth:color reduction tree depth:' \ + '-treedepth:color reduction tree depth' \ '-verbose[print image information]' \ ':image file:_imagemagick' \ ':composite file:_imagemagick' \ @@ -327,25 +409,27 @@ combine) ':combined file:_files' && return ;; -mogrify) - _arguments -M 'm:{a-z}={A-Z}' \ + mogrify) + _arguments -M 'm:{a-z}={A-Z}' \ + '*-affine[drawing transform matrix]:matrix' \ '*-antialias[remove pixel aliasing]' \ - '*-blur:blur factor (0.0 - 99.9%):' \ - '*-border:border size (x):' \ + '*-background[specify background color]:color:_x_color' \ + '*-blur:blur factor (0.0 - 99.9%%)' \ + '*-border:border size (x)' \ '*-bordercolor:border color:_x_color' \ '*-box:annotation bounding box color:_x_color' \ - '*-charcoal:charcoal drawing factor:' \ - '*-colorize:colorization amount ( or //):' \ - '*-colors:preferred number of colors:' \ + '*-charcoal:charcoal drawing factor' \ + '*-colorize:colorization amount ( or //)' \ + '*-colors:preferred number of colors' \ '*-colorspace:colorspace type:(GRAY OHTA RGB Transparent XYZ YCbCr YIQ YPbPr YUV CMYK)' \ - '*-comment:comment string:' \ + '*-comment:comment string' \ '*-compress:image compression type:(None BZip Fax Group4 JPEG LZW RunlengthEncoded Zip)' \ '*-contrast[enhance contrast]' \ '*+contrast[reduce contrast]' \ - '*-crop:crop image (x{+-}{+-}{%}):' \ - '*-cycle:image colormap shift:' \ - '*-delay:delay for next image (1/100ths of a second):' \ - '*-density:resolution in pixels of image (x):' \ + '*-crop:crop image (x{+-}{+-}{%%})' \ + '*-cycle:image colormap shift' \ + '*-delay:delay for next image (1/100ths of a second)' \ + '*-density:resolution in pixels of image (x)' \ '*-depth:image depth:(8 16)' \ '*-despeckle[reduce speckles in image]' \ '*-display:display:_x_display' \ @@ -353,7 +437,7 @@ mogrify) '*-dither[apply dithering]' \ '*+dither[render Postscript without aliasing]' \ '*-draw:drawing primitive:compadd -S "\\ " - point line rectangle fillRectangle circle fillCircle ellipse fillEllipse polygon fillPolygon color matte text image' \ - '*-edge:edge detection factor (0.0 - 99.9%):' \ + '*-edge:edge detection factor (0.0 - 99.9%%)' \ '*-emboss[emboss image]' \ '*-enhance[enhance image]' \ '*-equalize[histogram equalization]' \ @@ -363,20 +447,20 @@ mogrify) "*-format:output file format:(${formats//:/ })" \ '*-font:annotation font:_x_font' \ '*-frame:border dimensions (x++)' \ - '*-fuzz:maximum distance for equal colors:' \ - '*-gamma[gamma correction level]:gamma correction level ( or //):' \ - '*+gamma[gamma correction level (don'\''t change pixels)]:gamma correction level ( or //):' \ - '*-geometry:window geometry (x{+-}{+-}{%}{!}{<}{>}):' \ + '*-fuzz:maximum distance for equal colors' \ + '*-gamma[gamma correction level]:gamma correction level ( or //)' \ + '*+gamma[gamma correction level (don'\''t change pixels)]:gamma correction level ( or //)' \ + '*-geometry:window geometry (x{+-}{+-}{%%}{!}{<}{>})' \ '*-gravity:image gravity:(Center North NorthEast East SouthEast South SouthWest West NorthWest)' \ - '*-implode:implosion factor (0.0 - 99.9%):' \ + '*-implode:implosion factor (0.0 - 99.9%%)' \ '*-interlace:interlacing scheme:(None Line Plane Partition)' \ '*-layer:layer type:(Red Green Blue Matte)' \ - '*-linewidth:line width:' \ - '*-loop:number of iterations (GIF animation):' \ + '*-linewidth:line width' \ + '*-loop:number of iterations (GIF animation)' \ '*-map[single image colormap file]:picture file for colors:_imagemagick' \ '*+map[all images colormap file]:picture file for colors:_imagemagick' \ '*-matte[store matte channel]' \ - '*-modulate:,,:' \ + '*-modulate:,,' \ '*-monochrome[transform to black and white]' \ '*-negate[invert image]' \ '*+negate[invert only grayscale]' \ @@ -384,45 +468,45 @@ mogrify) '*+noise:noise type:(Uniform Gaussian Multiplicative Impulse Laplacian Poisson)' \ '*-normalize[use full color value range]' \ '*-opaque:image pen color:_x_color' \ - '*-page:geometry of image canvas (x{+-}{+-}{%}{!}{<}{>}):(11x17 Ledger Legal Letter LetterSmall ArchE ArchD ArchC ArchB ArchA A0 A1 A2 A3 A4 A4Small A5 A6 A7 A8 A9 A10 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 Flsa Flse HalfLetter)' \ - '*-paint:oil painting radius:' \ + '*-page:geometry of image canvas (x{+-}{+-}{%%}{!}{<}{>}):(11x17 Ledger Legal Letter LetterSmall ArchE ArchD ArchC ArchB ArchA A0 A1 A2 A3 A4 A4Small A5 A6 A7 A8 A9 A10 B0 B1 B2 B3 B4 B5 C0 C1 C2 C3 C4 C5 C6 Flsa Flse HalfLetter)' \ + '*-paint:oil painting radius' \ '*-pen:font color:_x_color' \ - '*-pointsize:Postscript font size:' \ - '*-quality:JPEG/MIFF/PNG compression level:' \ - '*-raise:lighten or darken edges (x):' \ - '*-region:image region (x{+-}{+-}):' \ - '*-resize:size (x{%}{@}{!}{<}{>}):' \ - '*-roll:image roll offset ({+-}{+-}):' \ - '*-rotate:rotation (degrees{<}{>}):' \ - '*-sample:scale factors (x):' \ - '*-scene:image scene number:' \ - '*-seed:random number seed:' \ - '*-segment:segment thresholds (x):' \ - '*-shade:image shading (x):' \ - '*-sharpen:sharpening factor (0.0 - 99.9%):' \ - '*-shave:shave edges (x{%}):' \ - '*-shear:shearing angles (x in degrees):' \ - '*-size:image size (x+):' \ - '*-solarize:solarization threshold:' \ - '*-spread:neighborhood size:' \ - '*-swirl:swirl tightness:' \ + '*-pointsize:Postscript font size' \ + '*-quality:JPEG/MIFF/PNG compression level' \ + '*-raise:lighten or darken edges (x)' \ + '*-region:image region (x{+-}{+-})' \ + '*-resize:size (x{%%}{@}{!}{<}{>})' \ + '*-roll:image roll offset ({+-}{+-})' \ + '*-rotate:rotation (degrees{<}{>})' \ + '*-sample:scale factors (x)' \ + '*-scene:image scene number' \ + '*-seed:random number seed' \ + '*-segment:segment thresholds (x)' \ + '*-shade:image shading (x)' \ + '*-sharpen:sharpening factor (0.0 - 99.9%%)' \ + '*-shave:shave edges (x{%%})' \ + '*-shear:shearing angles (x in degrees)' \ + '*-size:image size (x+)' \ + '*-solarize:solarization threshold' \ + '*-spread:neighborhood size' \ + '*-swirl:swirl tightness' \ '*-texture:background texture image:_imagemagick' \ - '*-threshold:threshold for maximum intensity:' \ + '*-threshold:threshold for maximum intensity' \ '*-transparency:transparent color:_x_color' \ - '*-treedepth:color reduction tree depth:' \ + '*-treedepth:color reduction tree depth' \ '*-units:image resolution type:(Undefined PixelsPerInch PixelsPerCentimeter)' \ '*-verbose[print image information]' \ - '*-view:FlashPix viewing parameters:' \ - '*-wave:sine wave parameters (x):' \ + '*-view:FlashPix viewing parameters' \ + '*-wave:sine wave parameters (x)' \ '*:picture file:_imagemagick' && return ;; -xtp) - _arguments -M 'm:{a-z}={A-Z}' \ - '-account:password:' \ + xtp) + _arguments -M 'm:{a-z}={A-Z}' \ + '-account:password' \ '-binary[retrieve files as binary]' \ '-directory[list directory]' \ - '-exclude:regular expression for exclusion:' \ + '-exclude:regular expression for exclusion' \ '-file:output file:_files' \ '-get[get files]' \ '-port:port: _ports' \ @@ -431,23 +515,25 @@ xtp) '-prune[process files from remote directory]' \ '-put[put files]' \ '-retrieve[retrieve matching files]' \ - '-timeout:maximum timeout:' \ + '-timeout:maximum timeout' \ '-type:remote system type:(UNIX VMS other)' \ ':url: _urls' && return ;; -identify) - _arguments \ - '*-density:resolution in pixels of image (x):' \ + identify) + _arguments \ + '*-cache[specify memory available to the pixel cache]:memory (MB)' \ + '*-debug' '*-ping' \ + '*-density:resolution in pixels of image (x)' \ '*-depth[specify image depth]:image depth:(8 16)' \ - '*-size:image size (x+):' \ + '*-format[specify format for image characteristics]:format' \ + '(- *)-help[display help information]' \ + '*-size:image size (x+)' \ '*-verbose[print more detailed info about image]' \ - '*-noop[disable effect of preceding options]' \ '*:picture file:_imagemagick' && return - ;; + ;; -*) - _message 'eh?' + *) _message 'eh?' ;; esac return 1 diff --git a/Completion/Unix/Command/_irssi b/Completion/Unix/Command/_irssi index d84812010..ee1e1ef43 100644 --- a/Completion/Unix/Command/_irssi +++ b/Completion/Unix/Command/_irssi @@ -1,45 +1,36 @@ #compdef irssi -typeset -A opt_args - local expl _irssi_servers() { - local a - a=($(grep "\(^[{ ]*address\)\|\([{ ]address\)[ ]*=" ~/.irssi/config | sed -e "s,^.*address *= *\"\([^\"]\+\).*,\1 ,g")) - compadd -x 'use "--help" to get descriptions' $a[@] - } + local a + a=( $(grep "\(^[{ ]*address\)\|\([{ ]address\)[ ]*=" ~/.irssi/config | sed -e "s,^.*address *= *\"\([^\"]\+\).*,\1 ,g") ) + _wanted irc-servers expl 'irc server' compadd "$@" -a - a +} _irssi_ports() { - local a - a=($(grep "\(^[{ ]*port\)\|\([{ ]port\)[ ]*=" ~/.irssi/config | sed -e "s,^.*port *= *\"\([^\"]\+\).*,\1,g")) - compadd -x 'use "--help" to get descriptions' $a[@] - } + local a + a=( $(grep "\(^[{ ]*port\)\|\([{ ]port\)[ ]*=" ~/.irssi/config | sed -e "s,^.*port *= *\"\([^\"]\+\).*,\1,g") ) + _wanted ports expl 'port' compadd "$@" -a - a +} _irssi_nick() { - local a - a=($(grep "\(^[{ ]*nick\)\|\([{ ]nick\)\|\([{ ]alternate_nick\)\|\(^[{ ]*alternate_nick\)[ ]*=" ~/.irssi/config | sed -e "s,^.*nick *= *\"\([^\"]\+\).*,\1,g")) - compadd -x 'use "--help" to get descriptions' $a[@] - } + local a + a=( $(grep "\(^[{ ]*nick\)\|\([{ ]nick\)\|\([{ ]alternate_nick\)\|\(^[{ ]*alternate_nick\)[ ]*=" ~/.irssi/config | sed -e "s,^.*nick *= *\"\([^\"]\+\).*,\1,g") ) + _wanted nicknames expl 'nick' compadd "$@" -a - a +} -_arguments -C -s \ - "--config=[config file]:config:_files" \ - "--home=[home dir location]:home:_dir_list" \ - "-c[connect to servers]:irc servers: _irssi_servers" \ - "--connect=[connect to servers]:irc servers: _irssi_servers" \ - '-w[password]' \ - '--password=[password]' \ - "-p[specify a port]:port: _irssi_ports" \ - "--port=[specify a port]:port: _irssi_ports" \ - '-![disable autoconnect]' \ - '--noconnect[disable autoconnect]' \ - "-n[set nick name]:nick: _irssi_nick" \ - "--nick=[set nick name]:nick: _irssi_nick" \ - '-h[hostname]' \ - '--hostname=[hostname]' \ - '-v[version]' \ - '--version[version]' \ - '-?[help message]' \ - '--help[help message]' \ - '--usage[display usage]' \ +_arguments -s \ + '--config=[config file]:config:_files' \ + '--home=[home dir location]:home:_dir_list' \ + '(-c --connect)'{-c,--connect=}'[connect to servers]:irc server:_irssi_servers' \ + '(-w --password)'{-w,--password=}'[password]:password' \ + '(-p --port)'{-p,--port=}'[specify a port]:port:_irssi_ports' \ + '-![disable autoconnect]' \ + '--noconnect[disable autoconnect]' \ + '(-n --nick)'{-n,--nick=}'[set nick name]:nick:_irssi_nick' \ + '(-h --hostname)'{-h,--hostname=}'[specify hostname]:hostname:_hosts' \ + '(-)'{-v,--version}'[display version information]' \ + '(-)'{-\?,--help}'[display help information]' \ + '(-)--usage[display usage]' diff --git a/Completion/Unix/Command/_mysql_utils b/Completion/Unix/Command/_mysql_utils new file mode 100644 index 000000000..64bafcfd7 --- /dev/null +++ b/Completion/Unix/Command/_mysql_utils @@ -0,0 +1,213 @@ +#compdef mysql mysqlshow mysqldump mysqladmin + +# Adam Spiers + +# Auxiliary functions + +_mysql_get_identity () { + _mysql_user=${(v)opt_args[(i)-u|--user]} + _mysql_port=${(v)opt_args[(i)-P|--port]} + _mysql_host=${(v)opt_args[(i)-h|--host]} + + _mysql_params=( + ${_mysql_user:+"--user=$_mysql_user"} + ${_mysql_host:+"--host=$_mysql_host"} + ${_mysql_port:+"--port=$_mysql_port"} + ) +} + +_mysql_hosts () { + local _mysql_user _mysql_port _mysql_host _mysql_params + _mysql_get_identity + + _wanted hosts expl 'server host' \ + _combination -s '[:@]' '' hosts-ports-users \ + ${_mysql_user:+users=${_mysql_user:q}} \ + ${_mysql_port:+ports=${_mysql_port:q}} \ + hosts - +} + +_mysql_ports () { + local _mysql_user _mysql_port _mysql_host _mysql_params + _mysql_get_identity + + _wanted ports expl 'server port' \ + _combination -s '[:@]' '' hosts-ports-users \ + ${_mysql_user:+users=${_mysql_user:q}} \ + ${_mysql_host:+hosts=${_mysql_host:q}} \ + ports - +} + +_mysql_users () { + local _mysql_user _mysql_port _mysql_host _mysql_params + _mysql_get_identity + + _wanted users expl 'server username' \ + _combination -s '[:@]' '' hosts-ports-users \ + ${_mysql_host:+hosts=${_mysql_host:q}} \ + ${_mysql_port:+ports=${_mysql_port:q}} \ + users - +} + +_mysql_databases () { + local _mysql_user _mysql_port _mysql_host _mysql_params + _mysql_get_identity + + compadd "$@" - ${${(f)~~"$(_call_program databases \ + mysql "$_mysql_params[@]" <<<'show databases' 2>/dev/null)"}[2,-1]} +} + +_mysql_tables () { + local _mysql_user _mysql_port _mysql_host _mysql_params + _mysql_get_identity + + compadd "$@" - ${${(f)~~"$(_call_program tables \ + mysql "$_mysql_params[@]" $1 <<< 'show tables' 2>/dev/null)"}[2,-1]} +} + +_mysql_variables () { + _values -s , 'MySQL client variables' \ + 'max_allowed_packet[maximum allowed packet size]:packet size in bytes:' \ + 'net_buffer_length[network buffer length]:buffer length in bytes:' +} + + +# The actual completion code for the commands + +_mysql () { + _arguments -s \ + "$_mysql_common_opts[@]" \ + '(- :)'{-V,--version}'[display client version]' \ + {-A,--no-auto-rehash}'[no automatic rehashing]' \ + '(-t --table)'{-B,--batch}'[batch mode (no pretty ASCII)]' \ + {-T,--debug-info}'[print debug info on exit]' \ + {-e,--exec-command}':batch-execute specified command and exit: ' \ + {-f,--force}'[continue through errors]' \ + {-i,--ignore-space}'[ignore space after function names]' \ + {-H,--html}'[produce HTML output]' \ + {-n,--unbuffered}'[flush the buffer after each query]' \ + {-O,--set-variable=}':set variable:_mysql_variables' \ + {-o,--one-database}'[only update the default database]' \ + {-q,--quick}'[disable caching of the result]' \ + {-r,--raw}'[write fields without conversion]' \ + {-s,--silent}'[silent mode]' \ + {-L,--skip-line-numbers}"[don't write line number for errors]" \ + {-N,--skip-column-names}"[don't write column names in results]" \ + '(-B --batch)'{-t,--table}'[output in table format]' \ + {-v,--verbose}'[verbose mode]' \ + {-E,--vertical}'[print query output vertically]' \ + {-w,--wait}'[wait and retry server connection if necessary]' \ + ':MySQL database:_mysql_databases' +} + +_mysqlshow () { + _arguments -s \ + "$_mysql_common_opts[@]" \ + {-V,--version}'[display version]' \ + {-\#+,--debug=}':debug file: ' \ + ':MySQL database to show:_mysql_databases' \ + ':table to show:{ _mysql_tables "$line[1]" }' \ + ':field wildcard: ' +} + +_mysqldump () { + _arguments -s \ + "$_mysql_common_opts[@]" \ + {-V,--version}'[display version]' \ + {-a,--all}'[include all create options]' \ + {-\#+,--debug=}':debug file: ' \ + {-c,--complete-insert}'[use complete insert statements]' \ + {-e,--extended-insert}'[allow new INSERT syntax]' \ + "--add-drop-table[add a 'drop table' before each create]" \ + "--add-locks[add locks around insert statements]" \ + "--allow-keywords[allow creation of column names that are keywords]" \ + "--delayed[insert rows with INSERT DELAYED]" \ + {-F,--flush-logs}'[flush logs file in server before dump]' \ + {-l,--lock-tables}'[lock all tables for read]' \ + {-t,--no-create-info}"[don't write table creation info]" \ + {-d,--no-data}"[don't write row information]" \ + {-O,--set-variable}':set variable:_mysql_variables' \ + '--opt[create fastest possible dump for reading]' \ + {-q,--quick}"[don't buffer, dump directly to stdout]" \ + {-T,--tab=}"[dump tab-separated text files for each table]:directory to store text files:_files -/" \ + {-w+,--where=}'[dump only selected records]:WHERE clause to limit records to dump: ' \ + '--fields-terminated-by=:(with --tab) fields in textfile terminated by ...: ' \ + '--fields-enclosed-by=:(with --tab) fields in import file enclosed by ...: ' \ + '--fields-optionally-enclosed-by=:(with --tab) fields in import file optionally enclosed by ...: ' \ + '--fields-escaped-by=:(with --tab) fields in import file escaped by ...: ' \ + '--lines-terminated-by=:(with --tab) lines in import file terminated by ...: ' \ + ':MySQL database to dump:_mysql_databases' \ + '*:tables to dump:{ _mysql_tables "$line[1]" }' +} + +_mysqladmin () { + local curcontext="$curcontext" state line expl ret=1 + typeset -A opt_args + + _arguments -C -s \ + "$_mysql_common_opts[@]" \ + '(- *)'{-v,--version}'[display version]' \ + '(-\# --debug)'{-\#+,--debug=}'[output debug log]:debug file' \ + '(-f --force)'{-f,--force}'[continue through errors]' \ + '(-i --sleep)'{-i+,--sleep=}'[repeat commands periodically]:number of seconds between executions: ' \ + '(-s --silent)'{-s,--silent}"[silently exit if can't connect to server]" \ + '(-t --timeout)'{-t+,--timeout=}'[specify timeout for connection]:time (seconds)' \ + '(-w --wait)'{-w+,--wait=}'[wait and retry server connection if necessary]:number of retries' \ + '*::mysqladmin command:->mysqladmin-commands' && ret=0 + + if [[ -n "$state" ]]; then + if (( CURRENT == 1 )); then + _wanted commands expl 'mysqladmin command' compadd - \ + create drop extended-status \ + flush-{hosts,logs,status,tables,privileges} \ + kill password ping processlist \ + reload refresh shutdown \ + status variables version && ret=0 + else + case "${words[1]:t}" in + create|drop) + _wanted databases expl "MySQL databases" _mysql_databases && ret=0 + ;; + kill) + _message 'thread ids' + ;; + password) + _message 'new password' + ;; + esac + fi + fi + + return ret +} + +_mysql_utils () { + local _mysql_common_opts + + _mysql_common_opts=( + '(-)'{-\?,--help}'[display help]' + '(-S --socket)'{-S+,--socket=}'[specify socket file to use for connection]:server socket file:_files' + '(-h --host)'{-h+,--host=}'[specify server hostname]:hostname:_mysql_hosts' + '(-P,--port)'{-P+,--port=}'[specify port number for connection]:server port:_mysql_ports' + '(-u --user)'{-u+,--user=}'[specify username for login]:server username:_mysql_users' + '(-p --password)'{-p+,--password=}'[specify password to use for connection]:server password' + '(-C --compress)'{-C,--compress}'[use compression in server/client protocol]' + ) + + case "$service" in + mysql) + _mysql "$@" + ;; + mysqlshow) + _mysqlshow "$@" + ;; + mysqldump) + _mysqldump "$@" + ;; + mysqladmin) + _mysqladmin "$@" + ;; + esac +} + +_mysql_utils "$@" diff --git a/Completion/Unix/Command/_pbm b/Completion/Unix/Command/_pbm new file mode 100644 index 000000000..a5226f34a --- /dev/null +++ b/Completion/Unix/Command/_pbm @@ -0,0 +1,891 @@ +#compdef -P (p[bgpn]m*|*top[bgpn]m) + +# Completion for all (or most, you'll never know) pbmplus commands. +# For some of them there are special cases in the biggish `case' below. +# Note that since this function is a post-pattern function, these +# defaults can be overridden by simply defining completion functions +# for those commands whose arguments you want to complete differently. + +local pat expl ret=1 + +if [[ "$service" = pnm* ]]; then + pat='*.(#i)p[bgp]m' +elif [[ "$service" = *top[bgpn]m ]]; then + pat="*.(#i)${service%%top[bgpn]m}" +else + pat="*.(#i)${service[1,3]}" +fi + +if (( $# + $+_in_pbm )); then + _wanted files expl 'picture file' _path_files "$@" -g "$pat" - || + _files "$@" "$expl[@]" -g '*.(#i)p[bgp]m' + return +fi + +local _in_pbm=yes + +case "$service" in +asciitop[gn]m) + _arguments \ + '-d[specify divisor]:divisor' \ + ':height' ':width' ':file:_pbm' + ;; + +fitstopgm) + _arguments \ + '-image[specify image number]:image number' \ + ':file:_pbm' + ;; + +fitstopnm) + _arguments \ + '-image[specify image number]:image number' \ + '-noraw[produce ASCII pnm file]' \ + '(-min -max)-scanmax[force scanning data for minimum and maximum]' \ + '-printmax[only print minimum and maximum values]' \ + '(-scanmax)-min[override minimum value]:minimum value' \ + '(-scanmax)-max[override maximum value]:maximum value' \ + ':file:_pbm' + ;; + +g3topbm) + _arguments \ + '-kludge[ignore first few lines]' \ + '-reversebits[interpret bits least-significant first]' \ + '-stretch[duplicate each row]' \ + ':file:_pbm' + ;; + +giftopnm) + _arguments \ + '-alphaout=[output alpha channel]:file:_pbm' \ + '-verbose[verbose mode]' \ + '-comments[only print comment fields]' \ + '-image[specify image number]:image number' \ + ':file:_pbm' + ;; + +jpegtopnm) + _arguments \ + '-dct:dct method:(int fast float)' \ + -{nosmooth,adobe,notadobe,dumpexif,comments,verbose} \ + '-maxmemory:memory use limit (kB)' \ + '-exif=:file:_files' \ + '-tracelevel:trace level' \ + ':file:_pbm' + ;; + +macptopbm) + _arguments '-extraskip:number of bytes to skip' ':file:_pbm' + ;; + +pbmclean) + if [[ "$PREFIX" = -* ]]; then + _message 'maximum number of identical neighbours' + else + _pbm + fi + ;; + +pbmmake) + _arguments \ + '(-black -gray)-white[produce white pbm file]' \ + '(-white -gray)-black[produce black pbm file]' \ + '(-white -black)-gray[produce gray pbm file (stippled)]' \ + ':width' ':height' + ;; + +pbmmask) + _arguments '-expand[expand mask by one pixel]' ':file:_pbm' + ;; + +pbmpscale) + _arguments ':scale factor' ':file:_pbm' + ;; + +pbmreduce) + _arguments \ + '(-fs -threshold)-floyd[use Floyd-Steinberg error diffusion]' \ + '(-floyd -threshold)-fs[use Floyd-Steinberg error diffusion]' \ + '(-floy -fs)-threshold[use simple thresholding]' \ + '-value[specify thresholding value]:threshold value' \ + ':reduction factor' ':file:_pbm' + ;; + +pbmtext) + _arguments \ + '(-builtin)-font[specify font file]:font file:_files -g \*.\(\#i\)pbm' \ + '(-font)-builtin[select builtin font]:builtin font:(bdf fixed)' \ + '-space[add space between characters]:space (pixels)' \ + '*:text' + ;; + +pbmto10x) + _arguments '-h[use resolution 120 x 144]' ':file:_pbm' + ;; + +pbmtobg|pbmtobbnbg) + _arguments ':raster operation' ':x position' ':y position' + ;; + +pbmtoepsi) + _arguments '-bbonly[only create boundary box]' ':file:_pbm' + ;; + +pbmtolj) + _arguments \ + '-resolution[specify output device resolution]:resolution:(75 100 150 300 600)' \ + '-float[suppress positioning information]' \ + "-norest[don't write reset sequences]" \ + '(-delta -compress)-packbits[enable use of TIFF packbits compression]' \ + '(-packbits -compress)-delta[enable use of delta-between-rows compression]' \ + '(-packbits -delta)-compress[enable both compression schemes]' \ + ':file:_pbm' + ;; + +pbmtoln03) + _arguments \ + '-l[specify left margin]:left margin' \ + '-r[specify right margin]:right margin' \ + '-t[specify top margin]:top margin' \ + '-b[specify bottom margin]:bottom margin' \ + '-f[specify form length]:form length' ':file:_pbm' + ;; + +pbmtolps) + _arguments '-dpi[specify output resolution]:resolution' ':file:_pbm' + ;; + +pbmtomacp) + _arguments \ + '-l[specify left offset]:left offset' \ + '-r[specify right offset]:right offset' \ + '-t[specify top offset]:top offset' \ + '-b[specify bottom offset]:bottom offset' \ + ':file:_pbm' + ;; + +pbmtopgm) + _arguments ':width' ':height' ':file:_pbm' + ;; + +pbmtopk) + _arguments \ + '-s[set design size]:design size' \ + '-C[set coding scheme]:coding scheme' \ + '-F[set font family comment]:font family' \ + '-f[specify file with options]:option file:_files' \ + '*-c[specify next character number]:character number' \ + '*-W[specify TFM width of next character]:width' \ + '*-H[specify TFM height of next character]:height' \ + '*-D[specify TFM depth of next character]:depth' \ + '*-I[specify italic correction of next character]:italic correction' \ + '*-h[specify horizontal escapement of next character]:horizontal escapement' \ + '*-v[specify vertical escapement of next character]:vertical escapement' \ + '*-x[specify x offset of next character]:x offset' \ + '*-y[specify y offset of next character]:y offset' \ + ':pk file:_files -g \*.\(\#i\)pk' \ + ':tfm file:_files -g \*.\(\#i\)tfm' \ + '*:file:_pbm' + ;; + +pbmupc) + _arguments -s{1,2} ':product type' ':manufacturer code' ':product code' + ;; + +pgmcrater) + _arguments \ + '-number[specify number of craters]:number of craters' \ + '-gamma[specify gamma correction factor]:gamma factor' \ + '(-ysize)-height[specify picture height]:height' \ + '(-height)-ysize[specify picture height]:height' \ + '(-xsize)-width[specify picture width]:width' \ + '(-width)-xsize[specify picture width]:width' + ;; + +pgmkernel) + _arguments '-weight:weight' ':width' ':height' + ;; + +pgmnoise) + _arguments ':width' ':height' + ;; + +pgmnorm|ppmnorm) + _arguments \ + '(-bvalue)-bpercent[specify percentage to map to black]:black percentage' \ + '(-bpercent)-bvalue[specify pixel value to map to black]:black pixel value' \ + '(-wvalue)-wpercent[specify percentage to map to white]:white percentage' \ + '(-wpercent)-wvalue[specify pixel value to map to white]:white pixel value' \ + ':file:_pbm' + ;; + +pgmoil) + _arguments '-n[specify smear size]:smear size' ':file:_pbm' + ;; + +pgmramp) + _arguments \ + '(-tb -rectangle -ellipse)-lr[produce left to right ramp]' \ + '(-lr -rectangle -ellipse)-tb[produce top to bottom ramp]' \ + '(-lr -tb -ellipse)-rectangle[produce rectangular ramp]' \ + '(-lr -tb -rectangle)-ellipse[produce elliptical ramp]' \ + ':width' ':height' + ;; + +pgmtexture) + _arguments '-d[specify distance]:distance' ':file:_pbm' + ;; + +pgmtopbm) + _arguments \ + '(-fs -threshold -hilbert -dither8 -d8 -cluster3 -c3 -cluster4 -c4 -cluster8 -c8 -clump)-floyd[use FLoyd-Steinberg error diffusion]' \ + '(-floyd -threshold -hilbert -dither8 -d8 -cluster3 -c3 -cluster4 -c4 -cluster8 -c8 -clump)-fs[use FLoyd-Steinberg error diffusion]' \ + '(-floyd -fs -hilbert -dither8 -d8 -cluster3 -c3 -cluster4 -c4 -cluster8 -c8 -clump)-threshold[use simple thresholding]' \ + '(-floyd -fs -threshold -dither8 -d8 -cluster3 -c3 -cluster4 -c4 -cluster8 -c8 -value)-hilbert[use space filling curve halftoning (hilbert curve)]' \ + '(-floyd -fs -threshold -hilbert -d8 -cluster3 -c3 -cluster4 -c4 -cluster8 -c8 -value -clump)-dither8[use Bayer'"'"'s ordered dither (16 x 16 matrix)]' \ + '(-floyd -fs -threshold -hilbert -dither8 -cluster3 -c3 -cluster4 -c4 -cluster8 -c8 -value -clump)-d8[use Bayer'"'"'s ordered dither (16 x 16 matrix)]' \ + '(-floyd -fs -threshold -hilbert -dither8 -d8 -c3 -cluster4 -c4 -cluster8 -c8 -value -clump)-cluster3[use 45 degree clustered dither]' \ + '(-floyd -fs -threshold -hilbert -dither8 -d8 -cluster3 -cluster4 -c4 -cluster8 -c8 -value -clump)-c3[use 45 degree clustered dither]' \ + '(-floyd -fs -threshold -hilbert -dither8 -d8 -cluster3 -c3 -c4 -cluster8 -c8 -value -clump)-cluster4[use 45 degree clustered dither]' \ + '(-floyd -fs -threshold -hilbert -dither8 -d8 -cluster3 -c3 -cluster4 -cluster8 -c8 -value -clump)-c4[use 45 degree clustered dither]' \ + '(-floyd -fs -threshold -hilbert -dither8 -d8 -cluster3 -c3 -cluster4 -c4 -c8 -value -clump)-cluster8[use 45 degree clustered dither]' \ + '(-floyd -fs -threshold -hilbert -dither8 -d8 -cluster3 -c3 -cluster4 -c4 -cluster8 -value -clump)-c8[use 45 degree clustered dither]' \ + '-value[specify thresholding value]:threshold value' \ + '-clump[specify number of pixels per clump]:number of pixel' \ + ':file:_pbm' + ;; + +pgmtoppm) + if [[ CURRENT -eq 2 ]]; then + if compset -P '?*-'; then + _x_color + return + fi + _x_color && ret=0 + + _wanted options expl option compadd - -map && ret=0 + + return ret + elif [[ CURRENT -eq 3 && "$words[2]" = -map ]]; then + _description files expl 'map file' + _files "$expl[@]" -g '*.(#i)ppm' + else + _pbm + fi + ;; + +pktopbm) + _arguments \ + '*-x[set width of next bitmap]:width' \ + '*-y[set height of next bitmap]:height' \ + '*-c[set next character number]:character number' \ + ':pk file:_files -g \*.\(\#i\)pk' \ + '*:file:_pbm' + ;; + +pngtopnm) + _arguments \ + -{verbose,alpha,mix,time} \ + '-background:color:_x_color' \ + '-gamma:value' '-text:file:_files' \ + ':file:_pbm' + ;; + +pnmalias) + _arguments \ + '-bgcolor[specify background color]:background color:_x_color' \ + '-fgcolor[specify background color]:foreground color:_x_color' \ + '(-bonly)-fonly[apply antialias only to foreground pixels]' \ + '(-fonly)-bonly[apply antialias only to background pixels]' \ + '(-balias)-falias[apply antialias to all pixels around foreground pixels]' \ + '(-falias)-balias[apply antialias to all pixels around foreground pixels]' \ + '-weight[set central aliasing weight]:central aliasing weight' \ + ':file:_pbm' + ;; + +pnmarith) + _arguments \ + '(-)'-{add,subtract,multiply,difference,minimum,maximum} \ + '*:file:_pbm' + ;; + +pnmcat) + _arguments \ + '(-black)-white[]' \ + '(-white)-black[]' \ + '(-lr -topbottom -tb -jleft -jright)-leftright[place pictures left to right]' \ + '(-leftright -topbottom -tb -jleft -jright)-lr[place pictures left to right]' \ + '(-tb -leftright -lr -jtop -jbottom)-topbottom[place pictures top to bottom]' \ + '(-topbottom -leftright -lr -jtop -jbottom)-tb[place pictures top to bottom]' \ + '(-topbottom -tb -jbottom -jleft -jright)-jtop[align pictures at top]' \ + '(-topbottom -tb -jtop -jleft -jright)-jbottom[align pictures at bottom]' \ + '(-leftright -lr -jright -jtop -jbottom)-jleft[align pictures at left side]' \ + '(-leftright -lr -jleft -jtop -jbottom)-jright[align pictures at right side]' \ + '*:file:_pbm' + ;; + +pnmcomp) + _arguments \ + '-invert[invert overlay pixel values]' \ + '(-align)-xoff[specify overlay x offset]:x offset' \ + '(-valign)-yoff[specify overlay y offset]:y offset' \ + '(-xoff)-align=[specify horizontal alignment for overlay image]:alignment:(left center right)' \ + '(-yoff)-valign=[specify vertical alignment for overlay image]:alignment:(top middle bottom)' \ + '-alpha[specify alpha mask file]:alpha mask file:_files -g \*.\(\#i\)pgm' \ + ':overlay file:_pbm' '*:file:_pbm' + ;; + +pnmconvol) + _arguments ':convolution file:_pbm' ':file:_pbm' + ;; + +pnmcrop) + _arguments \ + '(-black)-white' \ + '(-white)-black' \ + -sides \ + -{left,right,top,bottom} \ + -verbose \ + ':file:_pbm' + ;; + +pnmcut) + _arguments \ + '-left:left col' '-right:right col' '-top:top col' '-bottom:bottom col' \ + '-width:width' '-height:height' -pad -verbose \ + ':x position' ':y position' ':width' ':height' ':file:_pbm' + ;; + +pnmdepth) + _arguments ':new maximum value' ':file:_pbm' + ;; + +pnmenlarge) + _arguments ':enlargement factor' ':file:_pbm' + ;; + +pnmflip) + _arguments \ + \*-{leftright,lr,topbottom,tb,transpose,xy,rotate90,r90,ccw,rotate270,r270,cw,rotate180,r180} \ + ':file:_pbm' + ;; + +pnmgamma) + _arguments \ + -ungamma -cieramp \ + '1:gamma value or red gamma value' \ + '2: :{ _message "green gamma value";_pbm }' \ + '3:blue gamma value' \ + '4:file:_pbm' + ;; + +pnmhisteq) + _arguments \ + '-verbose[verbose mode]' \ + '-gray[modify only gray pixels]' \ + '-rmap[specify input luminosity map file]:luminosity map file:_files -g \*.\(\#i\)pgm' \ + '-wmap[specify output luminosity map file]:luminosity map file:_files -g \*.\(\#i\)pgm' \ + ':file:_pbm' + ;; +pnmhistmap) + _arguments -{black,white,verbose} '-max:maximum value' ':file:_pbm' + ;; + +pnmindex) + _arguments \ + '-size[set size of index pictures]:image size' \ + '-across[specify number of pictures per ros]:images per row' \ + '-colors[specify maximum number of colors]:number of colors' \ + '-black[use black padding]' \ + '-title[specify a title to place at the top of the image]:title' \ + '(-noquant)-quant[enable quantization]' \ + '(-quant)-noquant[disable quantization]' \ + '*:file:_pbm' + ;; + +pnmmargin) + _arguments \ + '(-black -colors)-white' \ + '(-white -colors)-black' \ + '(-white -black)-color:color:_x_color' \ + ':border width' \ + ':file:_pbm' + ;; + +pnmnlfilt) + _arguments ':alpha value' ':radius' ':file:_pbm' + ;; + +pnmpad) + _arguments \ + '(-white)-black[add black border]' \ + '(-black)-white[add white border]' \ + '-l-[specify left border width]:left border width' \ + '-r-[specify right border width]:right border width' \ + '-t-[specify top border width]:top border width' \ + '-b-[specify bottom border width]: :_guard "[0-9]#" "bottom border width"' \ + ':file:_pbm' + ;; + +pnmpaste) + _arguments \ + '(-)'{-replace,-or,-and,-xor} \ + ':"from" picture file:_pbm' \ + :{x,y}' position' \ + ':"into" picture file:_pbm' + ;; + +pnmrotate) + _arguments '-noantialias' ':rotation angle' ':file:_pbm' + ;; + +pnmscale) + local -a scale + + [[ "$words[2]" = -* ]] || scale=( ':scale factor' ) + + _arguments \ + '(-)-reduce:reduction factor' \ + '(-reduce -xysize -pixels -width -xscale)-xsize:width' \ + '(-reduce -xysize -pixels -xsize -xscale)-width:width' \ + '(-reduce -xysize -pixels -height -yscale)-ysize:height' \ + '(-reduce -xysize -pixels -ysize -yscale)-height:height' \ + '(-reduce -xysize -pixels -width -xsize)-xscale:horizontal scale factor' \ + '(-reduce -xysize -pixels -height -ysize)-yscale:vertical scale factor' \ + '(-width -xsize -height -ysize -xscale -yscale -pixels)-xysize:width::height' \ + '(-width -xsize -height -ysize -xscale -yscale -xysize)-pixels:total number of pixels' \ + '-verbose' "$scale[@]" \ + ':file:_pbm' + ;; + +pnmshear) + _arguments '-noantialias' ':shearing angle' ':file:_pbm' + ;; + +pnmtile) + _arguments ':width' ':height' ':file:_pbm' + ;; + +pnmtoddif) + _arguments \ + '-resolution:horizontal resolution::vertical resolution' \ + ':file:_pbm' ':ddif file:_files -g \*.\(\#i\)ddif' + ;; + +pnmtofits) + _arguments '-max:maximum value' '-min:minimum value' ':file:_pbm' + ;; + +pnmtojpeg) + _arguments \ + '--exif=:file:_files' \ + '--quality=:quality' \ + --{grayscale,greyscale,optimize,progressive,verbose,baseline} \ + '--comment=:comment' \ + '--dct=:dct method:(int fast float)' \ + '--restart=:rows' \ + '--smooth=:strength' \ + '--maxmemory=:memory use limit (kB)' \ + '--qtables=:file:_files' \ + '--qslots=:table' \ + '--sample=:sampling factor' \ + '--scans:file:_files' \ + ':file:_pbm' + ;; + +pnmtopng) + _arguments \ + -{verbose,downscale,interlace,hist,force} \ + '-alpha:file:_files' '-gamma:value' \ + '-transparent::color:_x_color' '-background:color:_x_color' \ + '-chroma:wx::wy::rx::ry::gx::gy::bx::by' \ + '-phys:x::y::unit' \ + '-text:file:_files' '-ztxt:file:_files' \ + '-time:date ([yy]yy-mm-dd)::time (hh:mm:ss)' \ + '-filter:type:((0\:none 1\:sub 2\:up 3\:avg 4\:paeth))' \ + '-compression:level:(0 1 2 3 4 5 6 7 8 9)' \ + ':file:_pbm' + ;; + +pnmtops) + _arguments \ + '(-noturn)-turn' '(-turn)-noturn' \ + '(-nocenter)-center '(-center)-nocenter \ + '(-rle)-runlength' '(-runlength)-rle' \ + '(-imagewidth -imageheight)-scale:scale factor' \ + '-dpi:output resolution' \ + '(-scale -equalpixels)-imagewidth:width on page (inches)' \ + '(-scale -equalpixels)-imageheight:height on page (inches)' \ + '-width:page width' '-height:page height' \ + '(-imagewidth -imageheight)-equalpixels' \ + ':file:_pbm' + ;; + +pnmtorast) + _arguments '(-rle)-standard' '(-standard)-rle' ':file:_pbm' + ;; + +pnmtosgi) + _arguments \ + '(-rle)-verbatim' '(-verbatim)-rle' \ + '-imagename:image name' \ + ':file:_pbm' + ;; + +pnmtotiff) + _arguments \ + '(-packbits -lzw -g3 -g4 -2d -fill -predictor)-none' \ + '(-none -lzw -g3 -g4 -2d -fill -predictor)-packbits' \ + '(-none -packbits -g3 -g4 -2d -fill -predictor)-lzw' \ + '(-none -packbits -lzw -g4 -predictor)-g3' \ + '(-none -packbits -lzw -g3 -2d -fill -predictor)-g4' \ + '-2d' \ + '-fill' '-minisblack' \ + '(-lsb2msb)-msb2lsb' \ + '(-msb2lsb)-lsb2msb' \ + '-predictor:LZW predictor:((1\:without\ differencing 2\:with\ differencing))' \ + '-rowsperstrip:number of rows per strip' ':file:_pbm' + ;; + +pnmtoxwd) + _arguments \ + '-pseudodepth:depth of PseudoColor dumps' '-directcolor' \ + ':file:_pbm' + ;; + +ppm3d) + _arguments :{left,right}' picture file:_pbm' ':horizontal offset' + ;; + +ppmbrighten) + _arguments \ + '-n[normalize value]' \ + '-s[specify saturation difference]:saturation difference' \ + '-v[specify value difference]:value difference' \ + ':file:_pbm' + ;; + +ppmchange) + local curcontext="$curcontext" state line + + _arguments -C \ + "-closeness[specify how close a pixel's color should be]:closeness (percent)" \ + '-remainder[specify replacement for colours not given explicit replacement]:color:_x_color' \ + '*: :->args' && ret=0 + + if [[ -n "$state" ]]; then + if (( CURRENT & 1 )); then + _wanted colors expl 'new color' _x_color && ret=0 + else + _alternative \ + 'files:file:_pbm' \ + 'colors:old color:_x_color' && ret=0 + fi + fi + + return ret + ;; + +ppmdim) + _arguments ':diminishing factor' ':file:_pbm' + ;; + +ppmdist) + _arguments \ + '(-frequency)-intensity[sort colors by grayscale intensity]' \ + '(-intensity)-frequency[sort colors by frequency]' \ + ':file:_pbm' + ;; + +ppmdither) + _arguments \ + '-dim:matrix size' \ + '-red:number of red shades' \ + '-green:number of green shades' \ + '-blue:number of blue shades' \ + ':file:_pbm' + ;; + +ppmflash) + _arguments ':flash factor' ':file:_pbm' + ;; + +ppmforge) + _arguments \ + -{clouds,night} \ + '-dimension:fractal dimension' '-hour:hour angle' \ + '(-tilt)-inclination:inclination angle' \ + '(-inclination)-tilt:inclination angle' \ + '-mesh:FFT mesh size' '-power:elevations power factor' \ + '-glaciers:glacier elevation' '-ice:polar ice cap extent' \ + '-saturation:star color saturation' \ + '-seed:random number seed' \ + '-stars:minimum star pixel percentage' \ + '(-xsize)-width:width' '(-width)-xsize:width' \ + '(-ysize)-height:height' '(-height)-ysize:height' + ;; + +ppmmake) + _arguments ':color:_x_color' ':width' ':height' + ;; + +ppmmix) + _arguments ':fade factor' ':file:_pbm' ':file:_pbm' + ;; + +ppmntsc) + _arguments ':dim factor' ':file:_pbm' + ;; + +ppmpat) + _arguments \ + '(-)'-{gingham{2,3},g{2,3},madras,tartan,poles,squig,camo,anticamo} \ + ':width' ':height' + ;; + +ppmquant) + local opt=yes + + if [[ "$words[2]" = -(fs|floyd) ]]; then + (( CURRENT-- )) + shift 1 words + opt='' + fi + + if [[ CURRENT -eq 2 ]]; then + if [[ -n "$opt" ]]; then + _wanted options expl option compadd - -map -fs -floyd && ret=0 + else + _wanted options expl option compadd - -map && ret=0 + fi + _message 'number of colors' + + return ret + elif [[ CURRENT -eq 3 && "$words[2]" = -map ]]; then + _description files expl 'map file' + _files "$expl[@]" -g '*.(#i)ppm' + else + _pbm + fi + ;; + +ppmquantall) + _arguments \ + '-ext:extension' ': :_guard "[0-9]#" "number of colors"' \ + '*:file:_pbm' + ;; + +ppmshift) + _arguments ':shift value' ':file:_pbm' + ;; + +ppmspread) + _arguments ':maximum spread amount' ':file:_pbm' + ;; + +ppmtoacad) + _arguments \ + '(-poly)-dxb[write AutoCAD binary database import file]' \ + '(-dxb)-poly[render pixels as filled polygons]' \ + '-8[restrict colors to the 8 RGB shades]' \ + '(-background)-white[use white background]' \ + '(-white)-background:background color (0-255)' \ + '-aspect:pixel aspect ratio' \ + ':file:_pbm' + ;; + +ppmtobmp) + _arguments \ + '(-windows)-os2' '(-os2)-windows' \ + '-bpp[secify bits per pixel for BMP file]:bits per pixel:(1 4 8 24)' \ + ':file:_pbm' + ;; + +ppmtogif) + _arguments \ + '-interlace[produce interlaced GIF]' \ + '-sort[produce GIF with sorted color map]' \ + '-map[use colors in specified file]:map file:_files' \ + '(-alpha)-transparent[specify transparent color]:color' \ + '(-transparent)-alpha[specify PGM file containing alpha mask]:file:_pbm' \ + '-comment[include a comment in the GIF file]:comment text' \ + '-nolxw[skip LZW compression]' \ + ':file:_pbm' + ;; + +ppmtoicr) + _arguments \ + '-windowname:window name' '-expand:expansion factor' \ + '-display:display screen' '-rle' ':file:_pbm' + ;; + +ppmtoilbm) + _arguments \ + '(-mp -maxplanes)'{-mp,-maxplanes}':planes' \ + '(-fp -fixplanes)'{-fp,-fixplanes}':planes' \ + '(-hambits -hamplanes)'{-hambits,-hamplanes}':planes' \ + -normal -hamif -24if -dcif -hamforce -24force -dcforce \ + '(-dcbits -dcplanes)'{-dcbits,-dcplanes}':bits for red: :bits for green: :bits for blue' \ + -ecs -aga -ham6 -ham8 -compress '-cmethod:method:(none byterun1)' \ + '-map:ppm file:_pbm' -cmaponly -savemem \ + ':file:_pbm' + ;; + +ppmtomap) + _arguments -s{ort,quare} ':file:_pbm' + ;; + +ppmtomitsu) + _arguments \ + '-sharpness:sharpness:(1 2 3 4)' \ + '-enlarge:enlargement factor:(1 2 3)' \ + '-media:output media (default\: 1184x1350):((A\:1216x1350 A4\:1184x1452 AS\:1216x1650 A4S\:1184x1754))' \ + '-copy:number of copies:(1 2 3 4 5 6 7 8 9)' \ + -{dpi300,tiny} ':file:_pbm' + ;; + +ppmtopcx) + _arguments -{24bit,packed} ':file:_pbm' + ;; + +ppmtopj) + _arguments \ + '-gamma:gamma value' '-xpos:x position' -{rle,center} \ + '-ypos:y position' '-back:background brightness:(dark lite)' \ + '-render:rendering algorithm:(none snap bw dither diffuse monodither monodiffuse clusterdither monoclusterdither)' \ + ':file:_pbm' + ;; + +ppmtopjxl) + _arguments \ + -{nopack,presentation,dark,diffuse,cluster,dither} \ + '-gamma:gamma value' \ + '-xshift:x shift' '-yshift:y shift' \ + '(-width -xscale)-xscale:width' \ + '(-xsize -xscale)-width:width' \ + '(-xsize -width)-xscale:horizontal scale factor' \ + '(-height -yscale)-ysize:height' \ + '(-ysize -yscale)-height:height' \ + '(-ysize -height)-yscale:vertical scale factor' \ + ':file:_pbm' + ;; + +ppmtosixel) + _arguments -{raw,margin} ':file:_pbm' + ;; + +ppmtotga) + _arguments -{mono,cmap,rgb,norle} ':file:_pbm' + ;; + +ppmtouil) + _arguments '-name:name prefix' ':file:_pbm' + ;; + +ppmtorle) + _arguments \ + '-name=:name prefix' \ + '-rgb=:X11 rgb file:_files' \ + '-alphamask=:pgm file:_pbm' \ + ':file:_pbm' + ;; + +ppmtoyuvsplit) + _arguments ':base name' ':file:_pbm' + ;; + +psidtopgm) + _arguments \ + ':width' ':height' ':bits per sample' \ + ':postscript file:_files -g "*.(#i)(ps|eps)"' + ;; +pstopnm) + _arguments \ + '(-portrait)-landscape' \ + '(-landscape)-portrait' \ + '(-pgm -ppm)-pbm' \ + '(-pbm -ppm)-pgm' \ + '(-pbm -pgm)-ppm' \ + -{forceplain,help,nocrop,verbose} \ + '-llx:loxer left x position' '-lly:lower left y position' \ + '-urx:upper right x position' '-ury:upper right y position' \ + '-xborder:x border fraction' '-yborder:y border fraction' \ + '-xmax:maximum width' '-ymax:maximum height' \ + '-xsize:width' '-ysize:height' \ + ':postscript file:_files -g \*.\(\#i\)\(ps\|eps\)' + ;; + +rawtopgm) + _arguments \ + '-maxval:value' \ + '-bpp:bytes:(1 2)' \ + -littleendian \ + '(-bt -bottomfirst -rowskip)-'{bt,bottomfirst} \ + '-headerskip:header bytes to skip' \ + '(-bt -bottomfirst)-rowskip:row padding to skip' \ + ': :_guard "[0-9]#" width' ':height' ':grayscale bytes' + ;; + +rawtoppm) + _arguments \ + '-headerskip:header bytes to skip' \ + '-rowskip:row padding to skip' \ + '(-rgb -rbg -grb -gbr -brg -bgr)'-{rgb,rbg,grb,gbr,brg,bgr} \ + '(-interrow)-interpixel' \ + '(-interpixel)-interrow' \ + ': :_guard "[0-9]#" width' ':height' ':grayscale bytes' + ;; + +rgb3toppm) + if [[ CURRENT -eq 2 ]]; then + expl='red picture file' + elif [[ CURRENT -eq 3 ]]; then + expl='green picture file' + elif [[ CURRENT -eq 4 ]]; then + expl='blue picture file' + fi + + if [[ -n "$expl" ]]; then + _description files expl "$expl" + _files "$expl" -g '*.(#i)pgm' + fi + ;; + +rletopnm) + _arguments \ + '--alphaout=:alpha file:_pbm' \ + -{h,-headerdump,v,-verbose,p,-plain} \ + ':file:_pbm' + ;; + +sgitopnm) + _arguments '-verbose' '-channel:channel' ':file:_pbm' + ;; + +sldtoppm) + _arguments \ + -{adjust,dir,info,verbose} \ + '(-width -xsize)'-{width,xsize}:width \ + '(-height -ysize)'-{height,ysize}:height \ + '-scale:scale factor' \ + '(-lib -Lib)'-{l,L}'ib:slide name' \ + ':file:_pbm' + ;; + +yuvsplittoppm) + _arguments ':base name' ':width' ':height' '-ccir601' + ;; + +yuvtoppm) + _arguments ':width' ':height' ':image bytes' + ;; + +zeisstopnm) + _arguments '(-pgm -ppm)'-p{g,p}m ':file:_pbm' + ;; + +*) + _wanted files expl 'picture file' _path_files -g "$pat" || + _files "$expl[@]" -g '*.(#i)p[bgp]m' +esac diff --git a/Completion/Unix/Command/_rsync b/Completion/Unix/Command/_rsync index 143a7bd4b..11c45edae 100644 --- a/Completion/Unix/Command/_rsync +++ b/Completion/Unix/Command/_rsync @@ -15,7 +15,7 @@ if [[ -prefix *::*/ ]]; then _wanted files expl 'remote files and directories' \ compadd -d remdispf ${remdispf##* } - + _wanted files expl 'remote files and directories' \ compadd -S/ -d remdispd ${remdispd##* } @@ -45,7 +45,7 @@ elif [[ -prefix 1 *: ]]; then _wanted files expl 'remote files and directories' \ compadd -d remdispf ${${remfiles:#*/}/[*=@|](#e)/} - + _wanted files expl 'remote files and directories' \ compadd -S/ -d remdispd ${${(M)remfiles:#*/}/${slash}(#e)/} else @@ -61,118 +61,91 @@ elif [[ -prefix 1 *@ ]]; then _wanted -C user-at hosts expl "host for $user" \ _combination -s '[:@]' "${tag}" users-hosts users="$user" hosts -S "$suf" "$@" - else - if compset -S '@*'; then - _wanted users expl "user" \ - _combination -s '[:@]' "${tag}" users-hosts users -q "$@" - - else - _hosts -S: - fi - + if compset -S '@*'; then + _wanted users expl "user" \ + _combination -s '[:@]' "${tag}" users-hosts users -q "$@" - + else + _alternative 'user:users:_users -S @' 'host:hosts:_hosts -S:' + fi fi } _rsync_files() { -_files || _rsync_remote_files + _alternative "file:files:_files" "remote-files:remote files:_rsync_remote_files" } - -_arguments -C -s \ - '*:files:_rsync_files' \ - '(--verbose)-v[verbose]' \ - '(-v)--verbose' \ - '(--quiet)-q[quiet]' \ - '(-q)--quiet' \ - '(--checksum)-c[always checksum]' \ - '(-c)--checksum[always checksum]' \ - '(--archive)-a[archive mode]' \ - '(-a)--archive[archive mode]' \ - '(--recursive)-r[recurse into directories]' \ - '(-r)--recursive[recurse into directories]' \ - '(--relative)-R[use relative path names]' \ - '(-R)--relative[use relative path names]' \ - '(--backup)-b[make backups]' \ - '(-b)--backup[make backups]' \ - '--backup-dir[make backups into this directory]:backup directory:_files -/' \ - '--suffix=[override backup suffix]:suffix:' \ - '(--update)-u[update only]' \ - '(-u)--update[update only]' \ - '(--links)-l[copy symlinks as symlinks]' \ - '(-l)--links[copy symlinks as symlinks]' \ - '(--copy-links)-L[copy referent of symlinks]' \ - '(-L)--copy-links[copy referent of symlinks]' \ - '--copy-unsafe-links[copy links outside the source tree]' \ - '--safe-links[ignore links outside the destination tree]' \ - '(--hard-links)-H[preserve hard links]' \ - '(-H)--hard-links[preserve hard links]' \ - '(--perms)-p[preserve permissions]' \ - '(-p)--perms[preserve permissions]' \ - '(--owner)-o[preserve owner]' \ - '(-o)--owner[preserve owner]' \ - '(--group)-g[preserve group]' \ - '(-g)--group[preserve group]' \ - '(--devices)-D[preserve devices]' \ - '(-D)--devices[preserve devices]' \ - '(--times)-t[preserve times]' \ - '(-t)--times[preserve times]' \ - '(--sparse)-S[handle sparse files efficiently]' \ - '(-S)--sparse[handle sparse files efficiently]' \ - '(--dry-run)-n[show what would have been transferred]' \ - '(-n)--dry-run[show what would have been transferred]' \ - '(--whole-file)-W[copy whole files]' \ - '(-W)--whole-file[copy whole files]' \ - '(--one-file-system)-x[do not cross filesystem boundaries]' \ - '(-x)-one-file-system[do not cross filesystem boundaries]' \ - '(--block-size)-B[checksum blocking size]:block size:' \ - '(-B)--block-size=[checksum blocking size]:block size:' \ - '(--rsh)-e[rsh command]:remote command:(rsh ssh)' \ - '(-e)--rsh[rsh command]:remote command:(rsh ssh)' \ - '--rsync-path=[specify path to rsync on the remote machine]:remote command:' \ - '(--cvs-exclude)-C[autoignore files in the same way as CVS]' \ - '(-C)--cvs-exclude[autoignore files in the same way as CVS]' \ - '--existing[only update files that already exist]' \ - '--ignore-existing[ignore files that already exist on the receiving side]' \ - '--delete[delete files that do not exist on the sending side]' \ - '--delete-excluded[also delete excluded files on the receiving side]' \ - '--delete-after[perform delete after transferring]' \ - '--ignore-errors[delete even if there are IO errors]' \ - '--max-delete=[do not delete more than NUM files]:number:' \ - '--partial[keep partially transferred files]' \ - '--force[force deletion of directories even if not empty]' \ - '--numeric-ids[do not map uid/gid values by user/group name]' \ - '--timeout=[set IO timeout in seconds]:seconds:' \ - '(--ignore-times)-I[do not exclude files that match length and time]' \ - '(-I)--ignore-times[do not exclude files that match length and time]' \ - '--size-only[only use file size when determining if a file should be transferred]' \ - '--modify-window=[timestamp window for file match]:seconds:' \ - '(--temp-dir)-T[create temporary files in specified directory]:directory:_files -/' \ - '(-T)--temp-dir=[create temporary files in specified directory]:directory:_files -/' \ - '--compare-dest=[also compare destination files relative to specified directory]:directory:_files -/' \ - '-P[equivalent to --partial --progress]' \ - '(--compress)-z[compress file data]' \ - '(-z)--compress[compress file data]' \ - '--exclude=[exclude files matching pattern]:pattern:' \ - '--exclude-from=[exclude patterns listed in file]:file:_files' \ - '--include=[do not exclude files matching pattern]:pattern:' \ - '--include-from=[do not exclude patterns listed in file]:file:_files' \ - '--version[print version number]' \ - '--daemon[run as a rsync daemon]' \ - '--no-detach[do not detach from the parent]' \ - '--address=[bind to the specified address]:address:_hosts' \ - '--config=[specify alternate rsyncd.conf file]:file:_files' \ - '--port=[specify alternate rsyncd port number]:port:' \ - '--blocking-io[use blocking IO for the remote shell]' \ - '--stats[give some file transfer stats]' \ - '--progress[show progress during transfer]' \ - '--log-format=[log file transfers using specified format]:format:' \ - '--password-file=[get password from file]:file:_files' \ - '--bwlimit=[limit bandwidth]:kbytes per second:' \ - '--read-batch=[read batch file]:ext:' \ - '--write-batch[write batch file]' \ - '(--help)-h[help]' \ - '(-h)--help[help]' \ - '-4[prefer IPv4]' \ - '-6[prefer IPv6]' \ - -- '*=COMMAND*:command:_command' \ - '*=FILE*:file:_files' \ - '*=DIR*:directory:_files -/' +_arguments -s \ + '*: :_rsync_files' \ + '*'{-v,--verbose}'[increase verbosity]' \ + '(-q --quiet)'{-q,--quiet}'[show less information during transfer]' \ + '(-c --checksum)'{-c,--checksum}'[always checksum]' \ + '(-a --archive)'{-a,--archive}'[archive mode]' \ + '(-r --recursive)'{-r,--recursive}'[recurse into directories]' \ + '(-E --relative)'{-R,--relative}'[use relative path names]' \ + '(-b --backup)'{-b,--backup}'[make backups]' \ + '--backup-dir[make backups into specified directory]:backup directory:_directories' \ + '--suffix=[override backup suffix]:suffix' \ + '(-u --update)'{-u,--update}'[update only]' \ + '(-l --links)'{-l,--links}'[copy symlinks as symlinks]' \ + '(-L --copy-links)'{-L,--copy-links}'[treat soft links like regular files]' \ + '--copy-unsafe-links[copy links outside the source tree]' \ + '--safe-links[ignore links outside the destination tree]' \ + '(-H --hard-links)'{-H,--hard-links}'[preserve hard links]' \ + '(-p --perms)'{-p,--perms}'[preserve permissions]' \ + '(-o --owner)'{-o,--owner}'[preserve owner]' \ + '(-g --group)'{-g,--group}'[preserve group]' \ + '(-D --devices)'{-D,--devices}'[preserve devices]' \ + '(-t --times)'{-t,--times}'[preserve times]' \ + '(-S --sparse)'{-S,--sparse}'[handle sparse files efficiently]' \ + '(-n --dry-run)'{-n,--dry-run}'[show what would have been transferred]' \ + '(-W --whole-file --no-whole-file)'{-W,--whole-file}'[copy whole files]' \ + '(-W --whole-file)--no-whole-file[always use incremental rsync algorithm]' \ + '(-x --one-file-system)'{-x,--one-file-system}'[do not cross filesystem boundaries]' \ + '(-B --block-size)'{-B,--block-size=}'[checksum blocking size]:block size' \ + '(-e --rsh)'{-e,--rsh}'[rsh command]:remote command:(rsh ssh)' \ + '--rsync-path=[specify path to rsync on the remote machine]:remote command:' \ + '(-C --cvs-exclude)'{-C,--cvs-exclude}'[autoignore files in the same way as CVS]' \ + '--existing[only update files that already exist]' \ + '--ignore-existing[ignore files that already exist on the receiving side]' \ + '--delete[delete files that do not exist on the sending side]' \ + '--delete-excluded[also delete excluded files on the receiving side]' \ + '--delete-after[perform delete after transferring]' \ + '--ignore-errors[delete even if there are IO errors]' \ + '--max-delete=[do not delete more than NUM files]:number:' \ + '(-P)--partial[keep partially transferred files]' \ + '--force[force deletion of directories even if not empty]' \ + '--numeric-ids[do not map uid/gid values by user/group name]' \ + '--timeout=[set IO timeout in seconds]:seconds:' \ + '(-I --ignore-times)'{-I,--ignore-times}'[do not exclude files that match length and time]' \ + '--size-only[only use file size when determining if a file should be transferred]' \ + '--modify-window=[timestamp window for file match]:seconds:' \ + '(-T --temp-dir)'{-T,--temp-dir=}'[create temporary files in specified directory]:directory:_files -/' \ + '--compare-dest=[also compare destination files relative to specified directory]:directory:_files -/' \ + '(--partial --progress)-P[equivalent to --partial --progress]' \ + '(-z --compress)'{-z,--compress}'[compress file data]' \ + '--exclude=[exclude files matching pattern]:pattern:' \ + '--exclude-from=[exclude patterns listed in file]:file:_files' \ + '--include=[do not exclude files matching pattern]:pattern:' \ + '--include-from=[do not exclude patterns listed in file]:file:_files' \ + '--version[print version number]' \ + '--daemon[run as a rsync daemon]' \ + '--no-detach[do not detach from the parent]' \ + '--address=[bind to the specified address]:address:_hosts' \ + '--config=[specify alternate rsyncd.conf file]:file:_files' \ + '--port=[specify alternate rsyncd port number]:port:' \ + '--blocking-io[use blocking IO for the remote shell]' \ + '--no-blocking-io[turn off blocking IO when it is the default]' \ + '--stats[give some file transfer stats]' \ + '(-P)--progress[show progress during transfer]' \ + '--log-format=[log file transfers using specified format]:format:' \ + '--password-file=[get password from file]:file:_files' \ + '--bwlimit=[limit bandwidth]:kbytes per second:' \ + '--read-batch=[read batch file]:ext:' \ + '--write-batch[write batch file]' \ + '(-)'{-h,--help}'[display help information]' \ + '-4[prefer IPv4]' \ + '-6[prefer IPv6]' \ + -- '*=COMMAND*:command:_command' \ + '*=FILE*:file:_files' \ + '*=DIR*:directory:_files -/' diff --git a/Completion/Unix/Command/_slrn b/Completion/Unix/Command/_slrn new file mode 100644 index 000000000..299b2a743 --- /dev/null +++ b/Completion/Unix/Command/_slrn @@ -0,0 +1,25 @@ +#compdef slrn + +_arguments \ + '-n[do not check for new groups]' \ + '-h[NNTP host]:NNTP host:_hosts' \ + '-p[NNTP port]:NNTP port:_ports' \ + '-f[name of the newsrc file to use]:newsrc file:_files' \ + '(-C\-)-C[use colors]' \ + "(-C)-C\-[don't use colors]" \ + '-d[get new text descriptions of each group from server]' \ + '-i[specify initialization file to use]:config file:_files' \ + '-D-[add predefined preprocessing token]' \ + '-k[do not process score file]' \ + '-k0[process score file but inhibit expensive scores]' \ + '-a[use active file for getting new news]' \ + '-m[force XTerm mouse reporting]' \ + '-w[wait for a key before switching to full screen mode]' \ + '--create[create a newsrc file by getting list of groups from server]' \ + '--debug[write debugging output to specified file]:debug file:_files' \ + '(-)--help[show help information]' \ + '--inews[use an external inews program to post articles]' \ + '--kill-log[keep a log of articles killed by the scorefile]:log file:_files' \ + '--nntp[use builtin NNTP support]' \ + '--pull[spool outgoing articles locally]' \ + '--spool[read directly from spool]' \ diff --git a/Completion/Unix/Command/_user_admin b/Completion/Unix/Command/_user_admin index bf0908372..4e7c1d487 100644 --- a/Completion/Unix/Command/_user_admin +++ b/Completion/Unix/Command/_user_admin @@ -7,7 +7,7 @@ redhat=$? if [[ $service = user* ]]; then if [[ -r /etc/shells ]]; then - shells=( $(