From c3b4d582a0f768ed6359fcbd295a49a67d1816f6 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sun, 10 Jun 2012 02:39:41 +0200 Subject: [PATCH] Various fixes, remove _zargs already upstream Many movings of local inside the actual functions. Add many missing local and remove -g(!). Fix namespacing of some parameters and functions, phases() in _scala was nice. --- _adb | 6 +- _android | 6 +- _debuild | 32 ++++---- _ditz | 6 +- _emulator | 177 ++++++++++++++++++++--------------------- _gem | 20 ++--- _genlop | 8 +- _git-pulls | 6 +- _git-wtf | 22 +++--- _github | 6 +- _gradle | 6 +- _knife | 7 +- _manage.py | 22 +++--- _mvn | 6 +- _optirun | 8 +- _perf | 6 +- _pip | 9 ++- _pkcon | 174 ++++++++++++++++++++--------------------- _play | 6 +- _port | 10 +-- _portage | 3 +- _portage_utils | 2 +- _pygmentize | 4 +- _sbt | 4 +- _scala | 24 +++--- _setup.py | 8 +- _srm | 6 +- _ssh-copy-id | 2 +- _vagrant | 6 +- _yaourt | 208 +++++++++++++++++++++++++------------------------ _zargs | 36 --------- 31 files changed, 406 insertions(+), 440 deletions(-) delete mode 100644 _zargs diff --git a/_adb b/_adb index f2d835e..e8a378a 100644 --- a/_adb +++ b/_adb @@ -43,10 +43,10 @@ # ------------------------------------------------------------------------------ -typeset -A opt_args -local context state line curcontext="$curcontext" adb_args - _adb() { + typeset -A opt_args + local context state line curcontext="$curcontext" adb_args + local ret=1 _arguments -C \ diff --git a/_android b/_android index 482498b..920b3f8 100644 --- a/_android +++ b/_android @@ -43,10 +43,10 @@ # ------------------------------------------------------------------------------ -typeset -A opt_args -local context state line curcontext="$curcontext" - _android() { + typeset -A opt_args + local context state line curcontext="$curcontext" + local ret=1 _arguments -C -A "-*" \ diff --git a/_debuild b/_debuild index a5981c3..73e3704 100644 --- a/_debuild +++ b/_debuild @@ -44,21 +44,17 @@ # ------------------------------------------------------------------------------ -_debuild() { - # FIXME --noconf is only allowed in first position - _arguments \ - '(- 1 *)'{-h,--help}'[show help]' \ - '(- 1 *)--version[show version and copyright information]' \ - {--no-conf,--noconf}'[don'\''t read devscripts config files]' \ - {-r-,--rootcmd=}'[command used to become root if debuild not setuid root (default: fakeroot)]: :_command_names' \ - '*'{-e-,--preserve-envvar=}'[preserve environment variable]: :_vars' \ - '(-e --preserve-envvar)--preserve-env[preserve all environment vars (except PATH)]' \ - '*'{-e-,--set-envvar=}'[preserve environment variable]: :_vars -qS=' \ - '--prepend-path=[prepend to the sanitised PATH]: :_files -/' \ - '(-D)-d[skip checking of build dependencies]' \ - '(-d)-D[force checking of build dependencies]' \ - '--check-dirname-level[how much to check directory names]:level:((0\:never 1\:only\ if\ program\ changes\ directory\ \(default\) 2\:always))' \ - '--check-dirname-regex[Perl regex defining matching directory names, the string PACKAGE will be replaced by the package name (default: '\''PACKAGE(-.+)?'\'')]:regex' -} - -_debuild "$@" +# FIXME --noconf is only allowed in first position +_arguments \ + '(- 1 *)'{-h,--help}'[show help]' \ + '(- 1 *)--version[show version and copyright information]' \ + {--no-conf,--noconf}'[don'\''t read devscripts config files]' \ + {-r-,--rootcmd=}'[command used to become root if debuild not setuid root (default: fakeroot)]: :_command_names' \ + '*'{-e-,--preserve-envvar=}'[preserve environment variable]: :_vars' \ + '(-e --preserve-envvar)--preserve-env[preserve all environment vars (except PATH)]' \ + '*'{-e-,--set-envvar=}'[preserve environment variable]: :_vars -qS=' \ + '--prepend-path=[prepend to the sanitised PATH]: :_files -/' \ + '(-D)-d[skip checking of build dependencies]' \ + '(-d)-D[force checking of build dependencies]' \ + '--check-dirname-level[how much to check directory names]:level:((0\:never 1\:only\ if\ program\ changes\ directory\ \(default\) 2\:always))' \ + '--check-dirname-regex[Perl regex defining matching directory names, the string PACKAGE will be replaced by the package name (default: '\''PACKAGE(-.+)?'\'')]:regex' diff --git a/_ditz b/_ditz index 744d5ac..b96f111 100644 --- a/_ditz +++ b/_ditz @@ -19,9 +19,9 @@ # ------------------------------------------------------------------------------ -ME=ditz -COMMANDS=--commands -OPTIONS='' +local ME=ditz +local COMMANDS=--commands +local OPTIONS='' if (($CURRENT == 2)); then # We're completing the first word after the tool: the command. diff --git a/_emulator b/_emulator index 71e2349..c9945c4 100644 --- a/_emulator +++ b/_emulator @@ -46,94 +46,89 @@ typeset -A opt_args local context state line curcontext="$curcontext" -_emulator() { - - # TODO All image options are contextual to -sysdir value - # TODO All skin options are contextual to -skindir value - # TODO snapshot options are mutually exclusive - # TODO Use '-snapshot-list' output for snapshot names - # TODO Complete -avd with avd names ? - # TODO -logcat: use completer from _adb - # TODO Complete options with device values - # TODO Complete -prop - _arguments \ - '(- : *)-version[display emulator version number]' \ - '(- : *)-help[display help information]' \ - '(- : *)-help-disk-images[about disk images]' \ - '(- : *)-help-keys[supported key bindings]' \ - '(- : *)-help-debug-tags[debug tags for -debug ]' \ - '(- : *)-help-char-devices[character specification]' \ - '(- : *)-help-environment[environment variables]' \ - '(- : *)-help-keyset-file[key bindings configuration file]' \ - '(- : *)-help-virtual-device[virtual device management]' \ - '(- : *)-help-sdk-images[about disk images when using the SDK]' \ - '(- : *)-help-build-images[about disk images when building Android]' \ - '(- : *)-help-all[prints all help content]' \ - '(- : *)-help-'{version,sysdir,system,image,datadir,kernel,ramdisk,initdata,data,partition-size,cache,no-cache,nocache,sdcard,snapstorage,no-snapstorage,snapshot,no-snapshot,no-snapshot-save,no-snapshot-load,snapshot-list,no-snapshot-update-time,wipe-data,avd,skindir,skin,noskin,no-skin,memory,netspeed,netdelay,netfast,trace,show-kernel,shell,no-jni,nojni,logcat,noaudio,no-audio,audio,raw-keys,radio,port,ports,onion,onion-alpha,onion-rotation,scale,dpi-device,http-proxy,timezone,dns-server,cpu-delay,no-boot-anim,no-window,report-console,gps,keyset,shell-serial,tcpdump,bootchart,charmap,prop,shared-net-id,nand-limits,memcheck,qemu,verbose}'[print option-specific help]' \ - '-sysdir[search for system disk images in the directory]: :_files -/' \ - '(-system -image)'{-system,-image}'[read initial system image from the file]: :_files -g "*.img"' \ - '-datadir[write user data into the directory]: :_files -/' \ - '-kernel[use specific emulated kernel]: :_files' \ - '-ramdisk[ramdisk image (default /ramdisk.img]: :_files -g "*.img"' \ - '-initdata[same as '\''-init-data '\'']: :_files' \ - '-data[data image (default /userdata-qemu.img]: :_files -g "*.img"' \ - '-partition-size[system/data partition size]:size (in MBs)' \ - '(-no-cache -nocache)-cache[cache partition image (default is temporary file)]: :_files -g "*.img"' \ - '(-cache -no-cache -nocache)'{-no-cache,-nocache}'[disable the cache partition]' \ - '-sdcard[SD card image (default /sdcard.img]: :_files -g "*.img"' \ - '(-no-snapstorage)-snapstorage[file that contains all state snapshots (default /snapshots.img)]: :_files -g "*.img"' \ - '(-snapstorage)-no-snapstorage[do not mount a snapshot storage file (this disables all snapshot functionality)]' \ - '-snapshot[name of snapshot within storage file for auto-start and auto-save (default '\''default-boot'\'')]:snapshot name' \ - '-no-snapshot[perform a full boot and do not do not auto-save, but qemu vmload and vmsave operate on snapstorage]' \ - '-no-snapshot-save[do not auto-save to snapshot on exit: abandon changed state]' \ - '-no-snapshot-load[do not auto-start from snapshot: perform a full boot]' \ - '-snapshot-list[show a list of available snapshots]' \ - '-no-snapshot-update-time[do not do try to correct snapshot time on restore]' \ - '-wipe-data[reset the user data image (copy it from initdata)]' \ - '-avd[use a specific android virtual device]:android virtual device name' \ - '-skindir[search skins in (default /skins)]: :_files -/' \ - '-skin[select a given skin]' \ - '(-noskin -no-skin)'{-noskin,-no-skin}'[don'\''t use any emulator skin]' \ - '-memory[physical RAM size in MBs]:size (in MBs)' \ - '-netspeed[maximum network download/upload speeds]:speed' \ - '-netdelay[network latency emulation]:delay' \ - '-netfast[disable network shaping]' \ - '-trace[enable code profiling (F9 to start)]:trace name' \ - '-show-kernel[display kernel messages]' \ - '-shell[enable root shell on current terminal]' \ - {-no-jni,-nojni}'[disable JNI checks in the Dalvik runtime]' \ - '-logcat[enable logcat output with given tags]:logcat tags' \ - '(-audio -noaudio -no-audio)'{-noaudio,-no-audio}'[disable audio support]' \ - '(-noaudio -no-audio)-audio[use specific audio backend]:audio backend' \ - '-raw-keys[disable Unicode keyboard reverse-mapping]' \ - '-radio[redirect radio modem interface to character device]:device' \ - '-port[TCP port that will be used for the console]:port number' \ - '-ports[TCP ports used for the console and adb bridge]:console port,adb port' \ - '-onion[use overlay PNG image over screen]: :_files -g "*.(png|PNG)"' \ - '-onion-alpha[specify onion-skin translucency]:percentage' \ - '-onion-rotation[specify onion-skin rotation]:rotation:((1 2 3 4))' \ - '-scale[scale emulator window]:scale' \ - '-dpi-device[specify device'\''s resolution in dpi (default 165)]:dpi' \ - '-http-proxy[make TCP connections through a HTTP/HTTPS proxy]:proxy' \ - '-timezone[use this timezone instead of the host'\''s default]:timezone' \ - '-dns-server[use this DNS server(s) in the emulated system]:DNS servers' \ - '-cpu-delay[throttle CPU emulation]:CPU delay' \ - '-no-boot-anim[disable animation for faster boot]' \ - '-no-window[disable graphical window display]' \ - '-report-console[report console port to remote socket]: :_socket' \ - '-gps[redirect NMEA GPS to character device]:device' \ - '-keyset[specify keyset file name]: :_files' \ - '-shell-serial[specific character device for root shell]:device' \ - '-tcpdump[capture network packets to file]: :_files' \ - '-bootchart[enable bootcharting]:timeout' \ - '-charmap[use specific key character map]: :_files' \ - '*-prop[set system property on boot]:name=value' \ - '-shared-net-id[join the shared network, using IP address 10.1.2.]:number' \ - '-nand-limits[enforce NAND/Flash read/write thresholds]:limits' \ - '-memcheck[enable memory access checking]:flags' \ - '-qemu[pass arguments to qemu]:arguments' \ - '-verbose[same as '\''-debug-init'\'']' \ - '*'{-debug,-debug-,-debug-no-}'[enable/disable specific debug messages]:tag' -} - -_emulator "$@" +# TODO All image options are contextual to -sysdir value +# TODO All skin options are contextual to -skindir value +# TODO snapshot options are mutually exclusive +# TODO Use '-snapshot-list' output for snapshot names +# TODO Complete -avd with avd names ? +# TODO -logcat: use completer from _adb +# TODO Complete options with device values +# TODO Complete -prop +_arguments \ + '(- : *)-version[display emulator version number]' \ + '(- : *)-help[display help information]' \ + '(- : *)-help-disk-images[about disk images]' \ + '(- : *)-help-keys[supported key bindings]' \ + '(- : *)-help-debug-tags[debug tags for -debug ]' \ + '(- : *)-help-char-devices[character specification]' \ + '(- : *)-help-environment[environment variables]' \ + '(- : *)-help-keyset-file[key bindings configuration file]' \ + '(- : *)-help-virtual-device[virtual device management]' \ + '(- : *)-help-sdk-images[about disk images when using the SDK]' \ + '(- : *)-help-build-images[about disk images when building Android]' \ + '(- : *)-help-all[prints all help content]' \ + '(- : *)-help-'{version,sysdir,system,image,datadir,kernel,ramdisk,initdata,data,partition-size,cache,no-cache,nocache,sdcard,snapstorage,no-snapstorage,snapshot,no-snapshot,no-snapshot-save,no-snapshot-load,snapshot-list,no-snapshot-update-time,wipe-data,avd,skindir,skin,noskin,no-skin,memory,netspeed,netdelay,netfast,trace,show-kernel,shell,no-jni,nojni,logcat,noaudio,no-audio,audio,raw-keys,radio,port,ports,onion,onion-alpha,onion-rotation,scale,dpi-device,http-proxy,timezone,dns-server,cpu-delay,no-boot-anim,no-window,report-console,gps,keyset,shell-serial,tcpdump,bootchart,charmap,prop,shared-net-id,nand-limits,memcheck,qemu,verbose}'[print option-specific help]' \ + '-sysdir[search for system disk images in the directory]: :_files -/' \ + '(-system -image)'{-system,-image}'[read initial system image from the file]: :_files -g "*.img"' \ + '-datadir[write user data into the directory]: :_files -/' \ + '-kernel[use specific emulated kernel]: :_files' \ + '-ramdisk[ramdisk image (default /ramdisk.img]: :_files -g "*.img"' \ + '-initdata[same as '\''-init-data '\'']: :_files' \ + '-data[data image (default /userdata-qemu.img]: :_files -g "*.img"' \ + '-partition-size[system/data partition size]:size (in MBs)' \ + '(-no-cache -nocache)-cache[cache partition image (default is temporary file)]: :_files -g "*.img"' \ + '(-cache -no-cache -nocache)'{-no-cache,-nocache}'[disable the cache partition]' \ + '-sdcard[SD card image (default /sdcard.img]: :_files -g "*.img"' \ + '(-no-snapstorage)-snapstorage[file that contains all state snapshots (default /snapshots.img)]: :_files -g "*.img"' \ + '(-snapstorage)-no-snapstorage[do not mount a snapshot storage file (this disables all snapshot functionality)]' \ + '-snapshot[name of snapshot within storage file for auto-start and auto-save (default '\''default-boot'\'')]:snapshot name' \ + '-no-snapshot[perform a full boot and do not do not auto-save, but qemu vmload and vmsave operate on snapstorage]' \ + '-no-snapshot-save[do not auto-save to snapshot on exit: abandon changed state]' \ + '-no-snapshot-load[do not auto-start from snapshot: perform a full boot]' \ + '-snapshot-list[show a list of available snapshots]' \ + '-no-snapshot-update-time[do not do try to correct snapshot time on restore]' \ + '-wipe-data[reset the user data image (copy it from initdata)]' \ + '-avd[use a specific android virtual device]:android virtual device name' \ + '-skindir[search skins in (default /skins)]: :_files -/' \ + '-skin[select a given skin]' \ + '(-noskin -no-skin)'{-noskin,-no-skin}'[don'\''t use any emulator skin]' \ + '-memory[physical RAM size in MBs]:size (in MBs)' \ + '-netspeed[maximum network download/upload speeds]:speed' \ + '-netdelay[network latency emulation]:delay' \ + '-netfast[disable network shaping]' \ + '-trace[enable code profiling (F9 to start)]:trace name' \ + '-show-kernel[display kernel messages]' \ + '-shell[enable root shell on current terminal]' \ + {-no-jni,-nojni}'[disable JNI checks in the Dalvik runtime]' \ + '-logcat[enable logcat output with given tags]:logcat tags' \ + '(-audio -noaudio -no-audio)'{-noaudio,-no-audio}'[disable audio support]' \ + '(-noaudio -no-audio)-audio[use specific audio backend]:audio backend' \ + '-raw-keys[disable Unicode keyboard reverse-mapping]' \ + '-radio[redirect radio modem interface to character device]:device' \ + '-port[TCP port that will be used for the console]:port number' \ + '-ports[TCP ports used for the console and adb bridge]:console port,adb port' \ + '-onion[use overlay PNG image over screen]: :_files -g "*.(png|PNG)"' \ + '-onion-alpha[specify onion-skin translucency]:percentage' \ + '-onion-rotation[specify onion-skin rotation]:rotation:((1 2 3 4))' \ + '-scale[scale emulator window]:scale' \ + '-dpi-device[specify device'\''s resolution in dpi (default 165)]:dpi' \ + '-http-proxy[make TCP connections through a HTTP/HTTPS proxy]:proxy' \ + '-timezone[use this timezone instead of the host'\''s default]:timezone' \ + '-dns-server[use this DNS server(s) in the emulated system]:DNS servers' \ + '-cpu-delay[throttle CPU emulation]:CPU delay' \ + '-no-boot-anim[disable animation for faster boot]' \ + '-no-window[disable graphical window display]' \ + '-report-console[report console port to remote socket]: :_socket' \ + '-gps[redirect NMEA GPS to character device]:device' \ + '-keyset[specify keyset file name]: :_files' \ + '-shell-serial[specific character device for root shell]:device' \ + '-tcpdump[capture network packets to file]: :_files' \ + '-bootchart[enable bootcharting]:timeout' \ + '-charmap[use specific key character map]: :_files' \ + '*-prop[set system property on boot]:name=value' \ + '-shared-net-id[join the shared network, using IP address 10.1.2.]:number' \ + '-nand-limits[enforce NAND/Flash read/write thresholds]:limits' \ + '-memcheck[enable memory access checking]:flags' \ + '-qemu[pass arguments to qemu]:arguments' \ + '-verbose[same as '\''-debug-init'\'']' \ + '*'{-debug,-debug-,-debug-no-}'[enable/disable specific debug messages]:tag' diff --git a/_gem b/_gem index 2ea2729..56550a0 100644 --- a/_gem +++ b/_gem @@ -19,16 +19,18 @@ # ------------------------------------------------------------------------------ -gem_general_flags=("(-h --help)"{-h,--help}"[Get help on this command]" - "(-V --verbose)"{-V,--verbose}"[Set the verbose level of output]" - "(-q --quiet)"{-q,--quiet}"[Silence commands]" - "--config-file[Use this config file instead of default]:file:_files" - "--backtrace[Show stack backtrace on errors]" - "--debug[Turn on Ruby debugging]" - $nul_arg -) - _gem() { + local -a gem_general_flags + + gem_general_flags=("(-h --help)"{-h,--help}"[Get help on this command]" + "(-V --verbose)"{-V,--verbose}"[Set the verbose level of output]" + "(-q --quiet)"{-q,--quiet}"[Silence commands]" + "--config-file[Use this config file instead of default]:file:_files" + "--backtrace[Show stack backtrace on errors]" + "--debug[Turn on Ruby debugging]" + $nul_arg + ) + if (( CURRENT > 2 )); then (( CURRENT-- )) shift words diff --git a/_genlop b/_genlop index 25ae74f..8243154 100644 --- a/_genlop +++ b/_genlop @@ -80,7 +80,7 @@ single=( --current -c --pretend -p --help -h --version -v ) _values '' \ last yesterday 1st 2nd 3rd 4th 5th _alternative \ - '*:*:_days' '*:*:_months' && return 0 + '*:*:_genlop_days' '*:*:_genlop_months' && return 0 ;; --file|-f) _arguments '*:logfile:_files' && return 0 @@ -113,13 +113,13 @@ single=( --current -c --pretend -p --help -h --version -v ) _values '' \ last yesterday 1st 2nd 3rd 4th 5th _alternative \ - ':*:_days' ':*:_months' && return 0 + ':*:_genlop_days' ':*:_genlop_months' && return 0 ;; esac done } -_days() { +_genlop_days() { local m="monday" t="tuesday" w="wednesday" T="thursday" f="friday" s="saturday" S="sunday" local day=$(date +%u) if [[ ${day} == 1 ]] then compadd $m @@ -131,7 +131,7 @@ _days() { elif [[ ${day} == 7 ]] then compadd $m $t $w $T $f $s $S fi } -_months() { +_genlop_months() { local j="january" f="february" m="march" a="april" M="may" ju="june" J="july" A="august" s="september" o="october" n="november" d="december" local month=$(date +%m) if [[ ${month} == 01 ]] then compadd $j diff --git a/_git-pulls b/_git-pulls index 7f6a105..36a9a50 100644 --- a/_git-pulls +++ b/_git-pulls @@ -42,10 +42,10 @@ # ------------------------------------------------------------------------------ -typeset -A opt_args -local context state line curcontext="$curcontext" - _git-pulls() { + typeset -A opt_args + local context state line curcontext="$curcontext" + local ret=1 _arguments -C \ diff --git a/_git-wtf b/_git-wtf index 1ad685d..e2d57c4 100644 --- a/_git-wtf +++ b/_git-wtf @@ -42,16 +42,12 @@ # vim: ft=zsh sw=2 ts=2 et # ------------------------------------------------------------------------------ -_git-wtf () { - _arguments -w -C -s \ - '(--long --short)'{-l,--long}'[include author info and date for each commit]' \ - '(--long --short)'{-s,--short}'[do not show commits]' \ - '(--all)'{-a,--all}'[show all branches across all remote repos, not just those from origin]' \ - '(--all-commits)'{-A,--all-commits}'[show all commits, not just the first 5]' \ - '(--key)'{-k,--key}'[show key]' \ - '(--relations)'{-r,--relations}'[show relation to features / integration branches]' \ - '(--dump-config)--dump-config[print out current configuration and exit]' \ - '*: :__git_branch_names' -} - -_git-wtf "$@" +_arguments -w -C -s \ + '(--long --short)'{-l,--long}'[include author info and date for each commit]' \ + '(--long --short)'{-s,--short}'[do not show commits]' \ + '(--all)'{-a,--all}'[show all branches across all remote repos, not just those from origin]' \ + '(--all-commits)'{-A,--all-commits}'[show all commits, not just the first 5]' \ + '(--key)'{-k,--key}'[show key]' \ + '(--relations)'{-r,--relations}'[show relation to features / integration branches]' \ + '(--dump-config)--dump-config[print out current configuration and exit]' \ + '*: :__git_branch_names' diff --git a/_github b/_github index 92a9a66..f27190b 100644 --- a/_github +++ b/_github @@ -42,10 +42,10 @@ # ------------------------------------------------------------------------------ -typeset -A opt_args -local context state line curcontext="$curcontext" - _github() { + typeset -A opt_args + local context state line curcontext="$curcontext" + local ret=1 _arguments -C \ diff --git a/_gradle b/_gradle index fc34bb7..7f7442a 100644 --- a/_gradle +++ b/_gradle @@ -44,10 +44,10 @@ # ------------------------------------------------------------------------------ -typeset -A opt_args -local context state line - _gradle() { + typeset -A opt_args + local context state line + local curcontext="$curcontext" _arguments \ diff --git a/_knife b/_knife index 3e468e9..989e892 100644 --- a/_knife +++ b/_knife @@ -19,9 +19,6 @@ # ------------------------------------------------------------------------------ -# These flags should be available everywhere according to man knife -knife_general_flags=( --help --server-url --key --config --editor --format --log_level --logfile --no-editor --user --print-after --version --yes ) - # knife has a very special syntax, some example calls are: # knife status # knife cookbook list @@ -34,6 +31,10 @@ knife_general_flags=( --help --server-url --key --config --editor --format --log _knife() { local curcontext="$curcontext" state line typeset -A opt_args + + # These flags should be available everywhere according to man knife + knife_general_flags=( --help --server-url --key --config --editor --format --log_level --logfile --no-editor --user --print-after --version --yes ) + cloudproviders=(bluebox ec2 rackspace slicehost terremark) _arguments \ '1: :->knifecmd'\ diff --git a/_manage.py b/_manage.py index 93b15e2..4d28099 100644 --- a/_manage.py +++ b/_manage.py @@ -19,15 +19,6 @@ # ------------------------------------------------------------------------------ -typeset -ga nul_args -nul_args=( - '--settings=-[the Python path to a settings module.]:file:_files' - '--pythonpath=-[a directory to add to the Python path.]::directory:_directories' - '--traceback[print traceback on exception.]' - "--version[show program's version number and exit.]" - {-h,--help}'[show this help message and exit.]' -) - _managepy-adminindex(){ _arguments -s : \ $nul_args \ @@ -224,7 +215,16 @@ _applist() { _values 'Application' $apps && ret=0 } -_managepy() { +_manage.py() { + local -a nul_args + nul_args=( + '--settings=-[the Python path to a settings module.]:file:_files' + '--pythonpath=-[a directory to add to the Python path.]::directory:_directories' + '--traceback[print traceback on exception.]' + "--version[show program's version number and exit.]" + {-h,--help}'[show this help message and exit.]' + ) + local curcontext=$curcontext ret=1 if ((CURRENT == 2)); then @@ -237,4 +237,4 @@ _managepy() { fi } -_managepy "$@" +_manage.py "$@" diff --git a/_mvn b/_mvn index 1462482..1d10689 100644 --- a/_mvn +++ b/_mvn @@ -73,10 +73,10 @@ # ------------------------------------------------------------------------------ -typeset -A opt_args -local context state line - _mvn() { + typeset -A opt_args + local context state line + local curcontext="$curcontext" maven_version excl_opts excl_opts=(-h --help -v --version -ep --encrypt-password -emp --encrypt-master-password) diff --git a/_optirun b/_optirun index 18430ca..26f8db5 100644 --- a/_optirun +++ b/_optirun @@ -45,7 +45,9 @@ local curcontext="$curcontext" state line typeset -A opt_args -args=( +local -a arguments + +arguments=( '--version[output version information]' '(-h --help)'{-h,--help}'[show help]' '(-c --vgl-compress)'{-c,--vgl-compress}'[image transport method]:method:(proxy jpeg rgb xb yuv)' @@ -59,7 +61,7 @@ args=( '(-C --config)'{-C,--config}'[retrieve settings for Bumblebee from FILE]:file:_files' '(-l --ldpath)'{-l,--ldpath}'[PATH the libraries like libGL.so are searched in]:file:_files' '(-s --socket)'{-s,--socket}'[use FILE for communication with the daemon]:file:_files' - '*::arguments: _normal' + '*::arguments: _files' ) -_arguments $args +_arguments $arguments diff --git a/_perf b/_perf index c569625..7790bbf 100644 --- a/_perf +++ b/_perf @@ -42,10 +42,10 @@ # ------------------------------------------------------------------------------ -local context curcontext="$curcontext" state line -typeset -A opt_args - _perf() { + local context curcontext="$curcontext" state line + typeset -A opt_args + local ret=1 _arguments -C \ diff --git a/_pip b/_pip index f8e9637..46fc486 100644 --- a/_pip +++ b/_pip @@ -21,7 +21,7 @@ local ret=1 state -declare -ga common_ops +local -a common_ops common_ops=( "--version[display version number]" {-h,--help}"[show help]" @@ -46,6 +46,7 @@ _arguments \ case $state in subcommand) + local -a subcommands subcommands=( "bundle:create pybundle" "freeze:put all currently installed packages" @@ -61,17 +62,17 @@ case $state in ;; options) - declare -a args + local -a args args=( $common_ops ) - declare -a requirement + local -a requirement requirement=( {-r,--requirement=}"[install all the packages listed in the given requirements file]:filename:_files" ) - declare -a findlink + local -a findlink findlink=( {-f,--find-links=}"[URL to look for packages at]:url" ) diff --git a/_pkcon b/_pkcon index 08e2ecc..5f2235a 100644 --- a/_pkcon +++ b/_pkcon @@ -39,98 +39,94 @@ # ------------------------------------------------------------------------------ -_pkcon() { - local -a options - options=( - '--version[Show the program version and exit]' - '--filter[Set the filter, e.g. installed]' - "--root[Set the install root, e.g. '/' or '/mnt/ltsp']" - '(-n --nowait)'{-n,--nowait}'[Exit without waiting for actions to complete]' - '(-y --noninteractive)'{-g,--noninteractive}'[Install the packages without asking for confirmation]' - '--background[Run the command using idle network bandwidth and also using less power]' - '(-p --plain)'{-p,--plain}'[Print to screen a machine readable output, rather than using animated widgets]' - '(-c --cache-age)'{-c,--cache-age}"[The maximum metadata cache age. Use -1 for 'never'.]" - '(-h --help)'{-h,--help}'[Show help options.]' - '(-v --verbose)'{-v,--verbose}'[Show debugging information for all files]' - ) +local -a options +options=( + '--version[Show the program version and exit]' + '--filter[Set the filter, e.g. installed]' + "--root[Set the install root, e.g. '/' or '/mnt/ltsp']" + '(-n --nowait)'{-n,--nowait}'[Exit without waiting for actions to complete]' + '(-y --noninteractive)'{-g,--noninteractive}'[Install the packages without asking for confirmation]' + '--background[Run the command using idle network bandwidth and also using less power]' + '(-p --plain)'{-p,--plain}'[Print to screen a machine readable output, rather than using animated widgets]' + '(-c --cache-age)'{-c,--cache-age}"[The maximum metadata cache age. Use -1 for 'never'.]" + '(-h --help)'{-h,--help}'[Show help options.]' + '(-v --verbose)'{-v,--verbose}'[Show debugging information for all files]' +) - local -a actions - actions=( - 'accept-eula' - 'get-roles' - 'get-distro-upgrades' - 'get-categories' - 'get-actions' - 'get-groups' - 'get-filters' - 'get-transactions' - 'get-time' - 'search' - 'install' - 'install-local' - 'download' - 'remove' - 'update' - 'refresh' - 'resolve' - 'get-updates' - 'get-depends' - 'get-requires' - 'get-details' - 'get-files' - 'get-update-detail' - 'get-packages' - 'repo-list' - 'repo-enable' - 'repo-disable' - 'repo-set-data' - 'what-provides' - 'upgrade-system' - ) +local -a actions +actions=( + 'accept-eula' + 'get-roles' + 'get-distro-upgrades' + 'get-categories' + 'get-actions' + 'get-groups' + 'get-filters' + 'get-transactions' + 'get-time' + 'search' + 'install' + 'install-local' + 'download' + 'remove' + 'update' + 'refresh' + 'resolve' + 'get-updates' + 'get-depends' + 'get-requires' + 'get-details' + 'get-files' + 'get-update-detail' + 'get-packages' + 'repo-list' + 'repo-enable' + 'repo-disable' + 'repo-set-data' + 'what-provides' + 'upgrade-system' +) - local context state line expl cmd - local -A opt_args +local context state line expl cmd +local -A opt_args - integer i=2 - while (( i < $#words )); do - case "$words[$i]" in - -*) - # skip option - (( i++ )) - continue - ;; - esac +integer i=2 +while (( i < $#words )); do + case "$words[$i]" in + -*) + # skip option + (( i++ )) + continue + ;; + esac - if [[ -z "$cmd" ]]; then - cmd="$words[$i]" - words[$i]=() - (( CURRENT-- )) - fi - (( i++ )) - done + if [[ -z "$cmd" ]]; then + cmd="$words[$i]" + words[$i]=() + (( CURRENT-- )) + fi + (( i++ )) +done - if [[ -z "$cmd" ]] - then - _arguments -s -w : $options \ - ":action:($actions)" - return - fi +if [[ -z "$cmd" ]] +then + _arguments -s -w : $options \ + ":action:($actions)" + return +fi - case "$cmd" in - search) - _arguments : $options \ - ':type:(name details group file)' \ - ':data: :' - ;; - refresh) - _arguments -s -w : $options \ - '--force' - ;; - *) - _arguments -s -w : $options - ;; - esac - return 1 -} - -_pkcon "$@" +case "$cmd" in + search) + _arguments : $options \ + ':type:(name details group file)' \ + ':data: :' + ;; + refresh) + _arguments -s -w : $options \ + '--force' + ;; + *) + _arguments -s -w : $options + ;; +esac +return 1 diff --git a/_play b/_play index d7f9263..d2f2951 100644 --- a/_play +++ b/_play @@ -43,10 +43,10 @@ # ------------------------------------------------------------------------------ -local context curcontext="$curcontext" state line -typeset -A opt_args - _play() { + local context curcontext="$curcontext" state line + typeset -A opt_args + local ret=1 _arguments -C \ diff --git a/_port b/_port index 52c3716..9053f53 100644 --- a/_port +++ b/_port @@ -16,11 +16,6 @@ local subcmds -# Cache the list of ports. -if (( ! $+_port_list )); then - _port_list=($(port echo all; echo "all current active inactive installed uninstalled outdated")) -fi - subcmds=( 'activate' 'archive' @@ -97,6 +92,11 @@ case "$state" in _describe -t commands 'port commands' subcmds ;; (portname) + # Cache the list of ports. + if (( ! $+_port_list )); then + _port_list=($(port echo all; echo "all current active inactive installed uninstalled outdated")) + fi + _describe -t commands 'available ports' _port_list ;; esac diff --git a/_portage b/_portage index 95d43fa..e03f095 100644 --- a/_portage +++ b/_portage @@ -108,7 +108,7 @@ _quickpkg () { # Stuff for emerge _emerge () { - local nopkg_opts all noask_opts bopts install_args common_args profiles + local nopkg_opts all noask_opts bopts install_args common_args profiles noask_opts=(-p -a --pretend --ask --regen --info --search -s --searchdesc \ -S --version -V --help -h --metadata) @@ -319,6 +319,7 @@ _tbz2tool () { } +local -A Args zparseopts -D -E -A Args -- -emerge if (( ${+Args[--emerge]} ));then _emerge "$@" && return 0 diff --git a/_portage_utils b/_portage_utils index 86bf41b..6d892c3 100644 --- a/_portage_utils +++ b/_portage_utils @@ -49,7 +49,7 @@ # # -local common_args PORTDIR +local common_args PORTDIR var var=PORTDIR [[ -z ${(P)var} && -r /etc/make.conf ]] && local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`" diff --git a/_pygmentize b/_pygmentize index 3b10a26..6d2594f 100644 --- a/_pygmentize +++ b/_pygmentize @@ -41,9 +41,9 @@ # vim: ft=zsh sw=2 ts=2 et # ------------------------------------------------------------------------------ -local context state line - _pygmentize() { + local context state line + _arguments -s -S \ '-h[prints help]:' \ '-V[prints the package version]:' \ diff --git a/_sbt b/_sbt index 7269209..1d1b50e 100644 --- a/_sbt +++ b/_sbt @@ -38,12 +38,12 @@ # # ------------------------------------------------------------------------------ -function _tasks () { +function _sbt_tasks () { compadd clean compile console console-project console-quick doc package \ package-doc package-src publish publish-local run run-main test test-only \ test:compile test:package test:package-doc test:package-src update } -_arguments "*:task:_tasks" +_arguments "*:task:_sbt_tasks" return 0 diff --git a/_scala b/_scala index fa7b35b..73f82f6 100644 --- a/_scala +++ b/_scala @@ -41,7 +41,7 @@ typeset -A opt_args local context state line -function phases () { +_scala_phases () { compadd "parser" "namer" "packageobjects" "typer" "superaccessors" \ "pickler" "refchecks" "selectiveanf" "liftcode" "selectivecps" "uncurry" \ "tailcalls" "specialize" "explicitouter" "erasure" "lazyvals" "lambdalift" \ @@ -49,6 +49,7 @@ function phases () { "dce" "jvm" "terminal" } +local -a shared_opts shared_opts=( "-bootclasspath+[Override location of bootstrap class files]:bootstrap class directory:_files -/" "-classpath+[Specify where to find user class files]:directory:_files -/" @@ -82,6 +83,7 @@ shared_opts=( "-Y[Print a synopsis of private options]" ) +local -a X_opts X_opts=( "-Xcheck-null[Warn upon selection of nullable reference]" "-Xcheckinit[Wrap field accessors to throw an exception on uninitialized access]" @@ -98,7 +100,7 @@ X_opts=( "-Xno-forwarders[Do not generate static forwarders in mirror classes]" "-Xno-uescape[Disable handling of \u unicode escapes]" "-Xnojline[Do not use JLine for editing]" - "-Xprint\:-[Print out program after ]:phase name:phases" + "-Xprint\:-[Print out program after ]:phase name:_scala_phases" "-Xprint-icode[Log internal icode to *.icode files]" "-Xprint-pos[Print tree positions, as offsets]" "-Xprint-types[Print tree types (debugging option)]" @@ -123,6 +125,7 @@ X_opts=( "-Xplugin-require\:-[Abort unless the given plugin(s) are available]" ) +local -a Y_opts Y_opts=( "-Y[Print a synopsis of private options]" "-Ybuild-manager-debug[Generate debug information for the Refined Build Manager compiler]" @@ -155,19 +158,19 @@ Y_opts=( "-Yresolve-term-conflict\:-[Resolve term conflicts (default\: error)]:resolution strategy:(package object error)" "-Yrich-exceptions[Fancier exceptions. Set source search path with -Dscala.control.sourcepath]" "-Yself-in-annots[Include a \"self\" identifier inside of annotations]" - "-Yshow\:-[Show after (requires -Xshow-class or -Xshow-object)]:phase name:phases" + "-Yshow\:-[Show after (requires -Xshow-class or -Xshow-object)]:phase name:_scala_phases" "-Yshow-syms[Print the AST symbol hierarchy after each phase]" "-Yshow-trees[Print detailed ASTs (requires -Xprint:phase)]" "-Ystatistics[Print compiler statistics]" "-Ystruct-dispatch\:-[Structural method dispatch policy (default\: poly-cache)]:policy name:(no-cache mono-cache poly-cache invoke-dynamic)" - "-Ybrowse\:-[Browse the abstract syntax tree after ]:phase name:phases" - "-Ycheck\:-[Check the tree at the end of ]:phase name:phases" - "-Ylog\:-[Log operations during ]:phase name:phases" - "-Yprofile\:-[Profile CPU usage of given phases (requires jgpagent on JVM -agentpath)]:phase name:phases" - "-Yskip\:-[Skip ]:phase name:phases" - "-Ystop-after\:-[Stop after given phase ]:phase name:phases" - "-Ystop-before\:-[Stop before given phase ]:phase name:phases" + "-Ybrowse\:-[Browse the abstract syntax tree after ]:phase name:_scala_phases" + "-Ycheck\:-[Check the tree at the end of ]:phase name:_scala_phases" + "-Ylog\:-[Log operations during ]:phase name:_scala_phases" + "-Yprofile\:-[Profile CPU usage of given phases (requires jgpagent on JVM -agentpath)]:phase name:_scala_phases" + "-Yskip\:-[Skip ]:phase name:_scala_phases" + "-Ystop-after\:-[Stop after given phase ]:phase name:_scala_phases" + "-Ystop-before\:-[Stop before given phase ]:phase name:_scala_phases" "-Ywarn-all[Enable all -Y warnings]" "-Ywarn-dead-code[Warn when dead code is identified]" @@ -188,6 +191,7 @@ Y_opts=( "-Ytyper-debug[Trace all type assignments]" ) +local -a scala_opts scala_opts=( "-e+[execute as if entered in the repl]:string" \ "-howtorun+[what to run (default\: guess)]:execution mode:(script object jar guess)" \ diff --git a/_setup.py b/_setup.py index c6cd890..e5bbbda 100644 --- a/_setup.py +++ b/_setup.py @@ -16,10 +16,10 @@ # vim: ft=zsh sw=2 ts=2 et # ------------------------------------------------------------------------------ -typeset -A opt_args -local context state line +_setup.py() { + typeset -A opt_args + local context state line -_setuppy() { _arguments -s -S \ "--verbose[run verbosely (default)]" \ "-v[run verbosely (default)]" \ @@ -700,4 +700,4 @@ _setuppy_upload_docs() { "*::setup.py commands:_setuppy" } -_setuppy "$@" +_setup.py "$@" diff --git a/_srm b/_srm index d4b762d..49e6579 100644 --- a/_srm +++ b/_srm @@ -15,7 +15,7 @@ # # ------------------------------------------------------------------------------ -declare -a opts args +local -a opts args args=( '(-f --force)'{-f,--force}'[ignore nonexistent files, never prompt]' '(-r --interactive)'{-i,--interactive}'[prompt before any removal]' @@ -43,14 +43,14 @@ else fi local curcontext=$curcontext state line ret=1 -declare -A opt_args +local -A opt_args _arguments -s -S -C $opts \ $args && ret=0 case $state in (file) - declare -a ignored + local -a ignored ignored=() ((CURRENT > 1)) && ignored+=(${line[1,CURRENT-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH}) diff --git a/_ssh-copy-id b/_ssh-copy-id index 4015dbb..bea9225 100644 --- a/_ssh-copy-id +++ b/_ssh-copy-id @@ -42,7 +42,7 @@ # ------------------------------------------------------------------------------ -# FIXME This completes "user@host" and not "[user@]host" ("user@" is optionnal), +# FIXME This completes "user@host" and not "[user@]host" ("user@" is optional), # should be merged in _ssh. _arguments -A "-*" \ diff --git a/_vagrant b/_vagrant index fede01e..af4f3dd 100644 --- a/_vagrant +++ b/_vagrant @@ -50,7 +50,7 @@ _box_arguments=( __task_list () { local expl - declare -a tasks + local -a tasks tasks=(box destroy halt init package provision reload resume ssh ssh_config status suspend up version) @@ -70,7 +70,7 @@ __vm_list () __vagrant-box () { local curcontext="$curcontext" state line - typeset -A opt_args + local -A opt_args _arguments -C \ ':command:->command' \ @@ -99,7 +99,7 @@ local expl local -a boxes installed_boxes local curcontext="$curcontext" state line -typeset -A opt_args +local -A opt_args _arguments -C \ ':command:->command' \ diff --git a/_yaourt b/_yaourt index ae94926..ae5fcbf 100644 --- a/_yaourt +++ b/_yaourt @@ -4,104 +4,6 @@ # copy this file to /usr/share/zsh/site-functions/_pacman -typeset -A opt_args - -# options for passing to _arguments: main pacman commands -_yaourt_opts_commands=( - '-Q[Query the package database]' - '-R[Remove a package from the system]' - '-S[Synchronize packages]' - '-U[Upgrade a package]' - '-V[Display version and exit]' - '-h[Display usage]' - '-B[backup pacman database]' - '-G[Get PKGBUILD]' - '-C[Clean backup files]' - '--stats[Package Statistics]' -) - -# options for passing to _arguments: options common to all commands -_yaourt_opts_common=( - '-b[Alternate database location]:database_location:_files -/' - '-h[Display syntax for the given operation]' - '-r[Set alternate installation root]:installation root:_files -/' - '-v[Be more verbose]' - '--cachedir[Alternate package cache location]:cache_location:_files -/' - '--config[An alternate configuration file]:config file:_files' - '--logfile[An alternate log file]:config file:_files' - '--noconfirm[Do not ask for confirmation]' - '--noprogressbar[Do not show a progress bar when downloading files]' - '--noscriptlet[Do not execute the install scriptlet if one exists]' - '--print[Only print the targets instead of performing the operation]' -) - -# options for passing to _arguments: options for --upgrade commands -_yaourt_opts_pkgfile=( - '-d[Skip dependency checks]' - '-f[Overwrite conflicting files]' - '*:package file:_files -g "*.pkg.tar.*(.)"' -) - -# options for passing to _arguments: subactions for --query command -_yaourt_opts_query_actions=( - '-g[View all members of a package group]:*:package groups:->query_group' - '-o[Query the package that owns a file]:file:_files' - '-p[Package file to query]:*:package file:->query_file' - '-s[Search package names and descriptions]:*:search text:->query_search' -) - -# options for passing to _arguments: options for --query and subcommands -_yaourt_opts_query_modifiers=( - '-c[List package changelog]' - '-d[List packages installed as dependencies]' - '-e[List packages explicitly installed]' - '-i[View package information]' - '-ii[View package information including backup files]' - '-k[Check package files]' - '-l[List package contents]' - '-m[List installed packages not found in sync db(s)]' - '-t[List packages not required by any package]' - '-u[List packages that can be upgraded]' - '--aur[Install packages from aur, even if they are in community, or, with the -u option, update packages installed from aur]' - '--devel[Used with -u updates all cvs/svn/git/hg/bzr packages]' -) - -# options for passing to _arguments: options for --remove command -_yaourt_opts_remove=( - '-c[Remove all dependent packages]' - '-d[Skip dependency checks]' - '-k[Only remove database entry, do not remove files]' - '-n[Remove protected configuration files]' - '-s[Remove dependencies not required by other packages]' - '*:installed package:_yaourt_completions_installed_packages' -) - -# options for passing to _arguments: options for --sync command -_yaourt_opts_sync_actions=( - '*-c[Remove old packages from cache]:*:clean:->sync_clean' - '*-cc[Remove all packages from cache]:*:clean:->sync_clean' - '-g[View all members of a package group]:*:package groups:->sync_group' - '-s[Search package names and descriptions]:*:search text:->sync_search' -) - -# options for passing to _arguments: options for --sync command -_yaourt_opts_sync_modifiers=( - '-d[Skip dependency checks]' - '-f[Overwrite conflicting files]' - '-i[View package information]' - '-l[List all packages in a repository]' - '-p[Print download URIs for each package to be installed]' - '-u[Upgrade all out-of-date packages]' - '-w[Download packages only]' - '-y[Download fresh package databases]' - '*--ignore[Ignore a package upgrade]:package: - _yaourt_completions_all_packages' - '*--ignoregroup[Ignore a group upgrade]:package group: - _yaourt_completions_all_groups' - '--asdeps[Install packages as non-explicitly installed]' - '--asexplicit[Install packages as explicitly installed]' -) - # handles --help subcommand _yaourt_action_help() { _arguments -s : \ @@ -288,7 +190,113 @@ _yaourt_get_command() { } # main dispatcher -_pacman() { +_yaourt() { + typeset -A opt_args + + # options for passing to _arguments: main pacman commands + typeset -a _yaourt_opts_commands + _yaourt_opts_commands=( + '-Q[Query the package database]' + '-R[Remove a package from the system]' + '-S[Synchronize packages]' + '-U[Upgrade a package]' + '-V[Display version and exit]' + '-h[Display usage]' + '-B[backup pacman database]' + '-G[Get PKGBUILD]' + '-C[Clean backup files]' + '--stats[Package Statistics]' + ) + + # options for passing to _arguments: options common to all commands + typeset -a _yaourt_opts_common + _yaourt_opts_common=( + '-b[Alternate database location]:database_location:_files -/' + '-h[Display syntax for the given operation]' + '-r[Set alternate installation root]:installation root:_files -/' + '-v[Be more verbose]' + '--cachedir[Alternate package cache location]:cache_location:_files -/' + '--config[An alternate configuration file]:config file:_files' + '--logfile[An alternate log file]:config file:_files' + '--noconfirm[Do not ask for confirmation]' + '--noprogressbar[Do not show a progress bar when downloading files]' + '--noscriptlet[Do not execute the install scriptlet if one exists]' + '--print[Only print the targets instead of performing the operation]' + ) + + # options for passing to _arguments: options for --upgrade commands + typeset -a _yaourt_opts_pkgfile + _yaourt_opts_pkgfile=( + '-d[Skip dependency checks]' + '-f[Overwrite conflicting files]' + '*:package file:_files -g "*.pkg.tar.*(.)"' + ) + + # options for passing to _arguments: subactions for --query command + typeset -a _yaourt_opts_query_actions + _yaourt_opts_query_actions=( + '-g[View all members of a package group]:*:package groups:->query_group' + '-o[Query the package that owns a file]:file:_files' + '-p[Package file to query]:*:package file:->query_file' + '-s[Search package names and descriptions]:*:search text:->query_search' + ) + + # options for passing to _arguments: options for --query and subcommands + typeset -a _yaourt_opts_query_modifiers + _yaourt_opts_query_modifiers=( + '-c[List package changelog]' + '-d[List packages installed as dependencies]' + '-e[List packages explicitly installed]' + '-i[View package information]' + '-ii[View package information including backup files]' + '-k[Check package files]' + '-l[List package contents]' + '-m[List installed packages not found in sync db(s)]' + '-t[List packages not required by any package]' + '-u[List packages that can be upgraded]' + '--aur[Install packages from aur, even if they are in community, or, with the -u option, update packages installed from aur]' + '--devel[Used with -u updates all cvs/svn/git/hg/bzr packages]' + ) + + # options for passing to _arguments: options for --remove command + typeset -a _yaourt_opts_remove + _yaourt_opts_remove=( + '-c[Remove all dependent packages]' + '-d[Skip dependency checks]' + '-k[Only remove database entry, do not remove files]' + '-n[Remove protected configuration files]' + '-s[Remove dependencies not required by other packages]' + '*:installed package:_yaourt_completions_installed_packages' + ) + + # options for passing to _arguments: options for --sync command + typeset -a _yaourt_opts_sync_actions + _yaourt_opts_sync_actions=( + '*-c[Remove old packages from cache]:*:clean:->sync_clean' + '*-cc[Remove all packages from cache]:*:clean:->sync_clean' + '-g[View all members of a package group]:*:package groups:->sync_group' + '-s[Search package names and descriptions]:*:search text:->sync_search' + ) + + # options for passing to _arguments: options for --sync command + typeset -a _yaourt_opts_sync_modifiers + _yaourt_opts_sync_modifiers=( + '-d[Skip dependency checks]' + '-f[Overwrite conflicting files]' + '-i[View package information]' + '-l[List all packages in a repository]' + '-p[Print download URIs for each package to be installed]' + '-u[Upgrade all out-of-date packages]' + '-w[Download packages only]' + '-y[Download fresh package databases]' + '*--ignore[Ignore a package upgrade]:package: + _yaourt_completions_all_packages' + '*--ignoregroup[Ignore a group upgrade]:package group: + _yaourt_completions_all_groups' + '--asdeps[Install packages as non-explicitly installed]' + '--asexplicit[Install packages as explicitly installed]' + ) + case $words[2] in -Q*g*) # ipkg groups _arguments -s : \ @@ -335,4 +343,4 @@ _pacman() { } # run the main dispatcher -_pacman "$@" +_yaourt "$@" diff --git a/_zargs b/_zargs deleted file mode 100644 index cacb631..0000000 --- a/_zargs +++ /dev/null @@ -1,36 +0,0 @@ -#compdef zargs -# ------------------------------------------------------------------------------ -# Description -# ----------- -# -# Completion script for zargs. -# -# Source: http://smasher.org/tmp/_zargs.gz -# -# ------------------------------------------------------------------------------ -# Authors -# ------- -# -# * Atom Smasher -# * Sorin Ionescu -# -# ------------------------------------------------------------------------------ - - -_arguments -s -S \ - '(--eof -e)'{--eof=,-e+}'[Change the end-of-input-args string from "--" to eof-str]:string' \ - '(--exit -x)'{--exit,-x}'[Exit if the size (see --max-chars) is exceeded]' \ - '(--interactive -p)'{--interactive,-p}'[Prompt before executing each command line]' \ - '--help[Print this summary and exit]' \ - '(--max-args -n)'{--max-args=,-n+}'[Use at most max-args arguments per command line]:integer' \ - '(--max-chars -s)'{--max-chars=,-s+}'[Use at most max-chars characters per command line]:integer' \ - '(--max-lines -l)'{--max-lines=,-l+}'[Use at most max-lines of the input-args per command line]:integer' \ - '(--max-procs -P)'{--max-procs=,-P+}'[Run up to max-procs command lines in the background at once]:integer' \ - '(--no-run-if-empty, -r)'{--no-run-if-empty,-r}'[Do nothing if there are no input arguments before the eof-str]' \ - '(--null -0)'{--null,-0}'[Split each input-arg at null bytes, for xargs compatibility]' \ - '(--replace -i)'{--replace=,-i+}'[Substitute replace-str in the initial-args by each initial-arg]:string' \ - '(--verbose -t)'{--verbose,-t}'[Print each command line to stderr before executing it]' \ - '--version[Print the version number and exit]' \ - '(-):command: _command_names -e' \ - '*::args: _normal' -