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.
This commit is contained in:
Mikael Magnusson 2012-06-10 02:39:41 +02:00
parent 3497b4841c
commit c3b4d582a0
31 changed files with 406 additions and 440 deletions

6
_adb
View File

@ -43,10 +43,10 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
typeset -A opt_args
local context state line curcontext="$curcontext" adb_args
_adb() { _adb() {
typeset -A opt_args
local context state line curcontext="$curcontext" adb_args
local ret=1 local ret=1
_arguments -C \ _arguments -C \

View File

@ -43,10 +43,10 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
typeset -A opt_args
local context state line curcontext="$curcontext"
_android() { _android() {
typeset -A opt_args
local context state line curcontext="$curcontext"
local ret=1 local ret=1
_arguments -C -A "-*" \ _arguments -C -A "-*" \

View File

@ -44,21 +44,17 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
_debuild() { # FIXME --noconf is only allowed in first position
# FIXME --noconf is only allowed in first position _arguments \
_arguments \ '(- 1 *)'{-h,--help}'[show help]' \
'(- 1 *)'{-h,--help}'[show help]' \ '(- 1 *)--version[show version and copyright information]' \
'(- 1 *)--version[show version and copyright information]' \ {--no-conf,--noconf}'[don'\''t read devscripts config files]' \
{--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' \
{-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 environment variable]: :_vars' \ '(-e --preserve-envvar)--preserve-env[preserve all environment vars (except PATH)]' \
'(-e --preserve-envvar)--preserve-env[preserve all environment vars (except PATH)]' \ '*'{-e-,--set-envvar=}'[preserve environment variable]: :_vars -qS=' \
'*'{-e-,--set-envvar=}'[preserve environment variable]: :_vars -qS=' \ '--prepend-path=[prepend to the sanitised PATH]: :_files -/' \
'--prepend-path=[prepend to the sanitised PATH]: :_files -/' \ '(-D)-d[skip checking of build dependencies]' \
'(-D)-d[skip checking of build dependencies]' \ '(-d)-D[force 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-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'
'--check-dirname-regex[Perl regex defining matching directory names, the string PACKAGE will be replaced by the package name (default: '\''PACKAGE(-.+)?'\'')]:regex'
}
_debuild "$@"

6
_ditz
View File

@ -19,9 +19,9 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
ME=ditz local ME=ditz
COMMANDS=--commands local COMMANDS=--commands
OPTIONS='<options>' local OPTIONS='<options>'
if (($CURRENT == 2)); then if (($CURRENT == 2)); then
# We're completing the first word after the tool: the command. # We're completing the first word after the tool: the command.

177
_emulator
View File

@ -46,94 +46,89 @@
typeset -A opt_args typeset -A opt_args
local context state line curcontext="$curcontext" 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 All image options are contextual to -sysdir value # TODO snapshot options are mutually exclusive
# TODO All skin options are contextual to -skindir value # TODO Use '-snapshot-list' output for snapshot names
# TODO snapshot options are mutually exclusive # TODO Complete -avd with avd names ?
# TODO Use '-snapshot-list' output for snapshot names # TODO -logcat: use completer from _adb
# TODO Complete -avd with avd names ? # TODO Complete options with device values
# TODO -logcat: use completer from _adb # TODO Complete -prop
# TODO Complete options with device values _arguments \
# TODO Complete -prop '(- : *)-version[display emulator version number]' \
_arguments \ '(- : *)-help[display help information]' \
'(- : *)-version[display emulator version number]' \ '(- : *)-help-disk-images[about disk images]' \
'(- : *)-help[display help information]' \ '(- : *)-help-keys[supported key bindings]' \
'(- : *)-help-disk-images[about disk images]' \ '(- : *)-help-debug-tags[debug tags for -debug <tags>]' \
'(- : *)-help-keys[supported key bindings]' \ '(- : *)-help-char-devices[character <device> specification]' \
'(- : *)-help-debug-tags[debug tags for -debug <tags>]' \ '(- : *)-help-environment[environment variables]' \
'(- : *)-help-char-devices[character <device> specification]' \ '(- : *)-help-keyset-file[key bindings configuration file]' \
'(- : *)-help-environment[environment variables]' \ '(- : *)-help-virtual-device[virtual device management]' \
'(- : *)-help-keyset-file[key bindings configuration file]' \ '(- : *)-help-sdk-images[about disk images when using the SDK]' \
'(- : *)-help-virtual-device[virtual device management]' \ '(- : *)-help-build-images[about disk images when building Android]' \
'(- : *)-help-sdk-images[about disk images when using the SDK]' \ '(- : *)-help-all[prints all help content]' \
'(- : *)-help-build-images[about disk images when building Android]' \ '(- : *)-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]' \
'(- : *)-help-all[prints all help content]' \ '-sysdir[search for system disk images in the directory]: :_files -/' \
'(- : *)-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]' \ '(-system -image)'{-system,-image}'[read initial system image from the file]: :_files -g "*.img"' \
'-sysdir[search for system disk images in the directory]: :_files -/' \ '-datadir[write user data into the directory]: :_files -/' \
'(-system -image)'{-system,-image}'[read initial system image from the file]: :_files -g "*.img"' \ '-kernel[use specific emulated kernel]: :_files' \
'-datadir[write user data into the directory]: :_files -/' \ '-ramdisk[ramdisk image (default <system>/ramdisk.img]: :_files -g "*.img"' \
'-kernel[use specific emulated kernel]: :_files' \ '-initdata[same as '\''-init-data <file>'\'']: :_files' \
'-ramdisk[ramdisk image (default <system>/ramdisk.img]: :_files -g "*.img"' \ '-data[data image (default <datadir>/userdata-qemu.img]: :_files -g "*.img"' \
'-initdata[same as '\''-init-data <file>'\'']: :_files' \ '-partition-size[system/data partition size]:size (in MBs)' \
'-data[data image (default <datadir>/userdata-qemu.img]: :_files -g "*.img"' \ '(-no-cache -nocache)-cache[cache partition image (default is temporary file)]: :_files -g "*.img"' \
'-partition-size[system/data partition size]:size (in MBs)' \ '(-cache -no-cache -nocache)'{-no-cache,-nocache}'[disable the cache partition]' \
'(-no-cache -nocache)-cache[cache partition image (default is temporary file)]: :_files -g "*.img"' \ '-sdcard[SD card image (default <system>/sdcard.img]: :_files -g "*.img"' \
'(-cache -no-cache -nocache)'{-no-cache,-nocache}'[disable the cache partition]' \ '(-no-snapstorage)-snapstorage[file that contains all state snapshots (default <datadir>/snapshots.img)]: :_files -g "*.img"' \
'-sdcard[SD card image (default <system>/sdcard.img]: :_files -g "*.img"' \ '(-snapstorage)-no-snapstorage[do not mount a snapshot storage file (this disables all snapshot functionality)]' \
'(-no-snapstorage)-snapstorage[file that contains all state snapshots (default <datadir>/snapshots.img)]: :_files -g "*.img"' \ '-snapshot[name of snapshot within storage file for auto-start and auto-save (default '\''default-boot'\'')]:snapshot name' \
'(-snapstorage)-no-snapstorage[do not mount a snapshot storage file (this disables all snapshot functionality)]' \ '-no-snapshot[perform a full boot and do not do not auto-save, but qemu vmload and vmsave operate on snapstorage]' \
'-snapshot[name of snapshot within storage file for auto-start and auto-save (default '\''default-boot'\'')]:snapshot name' \ '-no-snapshot-save[do not auto-save to snapshot on exit: abandon changed state]' \
'-no-snapshot[perform a full boot and do not do not auto-save, but qemu vmload and vmsave operate on snapstorage]' \ '-no-snapshot-load[do not auto-start from snapshot: perform a full boot]' \
'-no-snapshot-save[do not auto-save to snapshot on exit: abandon changed state]' \ '-snapshot-list[show a list of available snapshots]' \
'-no-snapshot-load[do not auto-start from snapshot: perform a full boot]' \ '-no-snapshot-update-time[do not do try to correct snapshot time on restore]' \
'-snapshot-list[show a list of available snapshots]' \ '-wipe-data[reset the user data image (copy it from initdata)]' \
'-no-snapshot-update-time[do not do try to correct snapshot time on restore]' \ '-avd[use a specific android virtual device]:android virtual device name' \
'-wipe-data[reset the user data image (copy it from initdata)]' \ '-skindir[search skins in <dir> (default <system>/skins)]: :_files -/' \
'-avd[use a specific android virtual device]:android virtual device name' \ '-skin[select a given skin]' \
'-skindir[search skins in <dir> (default <system>/skins)]: :_files -/' \ '(-noskin -no-skin)'{-noskin,-no-skin}'[don'\''t use any emulator skin]' \
'-skin[select a given skin]' \ '-memory[physical RAM size in MBs]:size (in MBs)' \
'(-noskin -no-skin)'{-noskin,-no-skin}'[don'\''t use any emulator skin]' \ '-netspeed[maximum network download/upload speeds]:speed' \
'-memory[physical RAM size in MBs]:size (in MBs)' \ '-netdelay[network latency emulation]:delay' \
'-netspeed[maximum network download/upload speeds]:speed' \ '-netfast[disable network shaping]' \
'-netdelay[network latency emulation]:delay' \ '-trace[enable code profiling (F9 to start)]:trace name' \
'-netfast[disable network shaping]' \ '-show-kernel[display kernel messages]' \
'-trace[enable code profiling (F9 to start)]:trace name' \ '-shell[enable root shell on current terminal]' \
'-show-kernel[display kernel messages]' \ {-no-jni,-nojni}'[disable JNI checks in the Dalvik runtime]' \
'-shell[enable root shell on current terminal]' \ '-logcat[enable logcat output with given tags]:logcat tags' \
{-no-jni,-nojni}'[disable JNI checks in the Dalvik runtime]' \ '(-audio -noaudio -no-audio)'{-noaudio,-no-audio}'[disable audio support]' \
'-logcat[enable logcat output with given tags]:logcat tags' \ '(-noaudio -no-audio)-audio[use specific audio backend]:audio backend' \
'(-audio -noaudio -no-audio)'{-noaudio,-no-audio}'[disable audio support]' \ '-raw-keys[disable Unicode keyboard reverse-mapping]' \
'(-noaudio -no-audio)-audio[use specific audio backend]:audio backend' \ '-radio[redirect radio modem interface to character device]:device' \
'-raw-keys[disable Unicode keyboard reverse-mapping]' \ '-port[TCP port that will be used for the console]:port number' \
'-radio[redirect radio modem interface to character device]:device' \ '-ports[TCP ports used for the console and adb bridge]:console port,adb port' \
'-port[TCP port that will be used for the console]:port number' \ '-onion[use overlay PNG image over screen]: :_files -g "*.(png|PNG)"' \
'-ports[TCP ports used for the console and adb bridge]:console port,adb port' \ '-onion-alpha[specify onion-skin translucency]:percentage' \
'-onion[use overlay PNG image over screen]: :_files -g "*.(png|PNG)"' \ '-onion-rotation[specify onion-skin rotation]:rotation:((1 2 3 4))' \
'-onion-alpha[specify onion-skin translucency]:percentage' \ '-scale[scale emulator window]:scale' \
'-onion-rotation[specify onion-skin rotation]:rotation:((1 2 3 4))' \ '-dpi-device[specify device'\''s resolution in dpi (default 165)]:dpi' \
'-scale[scale emulator window]:scale' \ '-http-proxy[make TCP connections through a HTTP/HTTPS proxy]:proxy' \
'-dpi-device[specify device'\''s resolution in dpi (default 165)]:dpi' \ '-timezone[use this timezone instead of the host'\''s default]:timezone' \
'-http-proxy[make TCP connections through a HTTP/HTTPS proxy]:proxy' \ '-dns-server[use this DNS server(s) in the emulated system]:DNS servers' \
'-timezone[use this timezone instead of the host'\''s default]:timezone' \ '-cpu-delay[throttle CPU emulation]:CPU delay' \
'-dns-server[use this DNS server(s) in the emulated system]:DNS servers' \ '-no-boot-anim[disable animation for faster boot]' \
'-cpu-delay[throttle CPU emulation]:CPU delay' \ '-no-window[disable graphical window display]' \
'-no-boot-anim[disable animation for faster boot]' \ '-report-console[report console port to remote socket]: :_socket' \
'-no-window[disable graphical window display]' \ '-gps[redirect NMEA GPS to character device]:device' \
'-report-console[report console port to remote socket]: :_socket' \ '-keyset[specify keyset file name]: :_files' \
'-gps[redirect NMEA GPS to character device]:device' \ '-shell-serial[specific character device for root shell]:device' \
'-keyset[specify keyset file name]: :_files' \ '-tcpdump[capture network packets to file]: :_files' \
'-shell-serial[specific character device for root shell]:device' \ '-bootchart[enable bootcharting]:timeout' \
'-tcpdump[capture network packets to file]: :_files' \ '-charmap[use specific key character map]: :_files' \
'-bootchart[enable bootcharting]:timeout' \ '*-prop[set system property on boot]:name=value' \
'-charmap[use specific key character map]: :_files' \ '-shared-net-id[join the shared network, using IP address 10.1.2.<number>]:number' \
'*-prop[set system property on boot]:name=value' \ '-nand-limits[enforce NAND/Flash read/write thresholds]:limits' \
'-shared-net-id[join the shared network, using IP address 10.1.2.<number>]:number' \ '-memcheck[enable memory access checking]:flags' \
'-nand-limits[enforce NAND/Flash read/write thresholds]:limits' \ '-qemu[pass arguments to qemu]:arguments' \
'-memcheck[enable memory access checking]:flags' \ '-verbose[same as '\''-debug-init'\'']' \
'-qemu[pass arguments to qemu]:arguments' \ '*'{-debug,-debug-,-debug-no-}'[enable/disable specific debug messages]:tag'
'-verbose[same as '\''-debug-init'\'']' \
'*'{-debug,-debug-,-debug-no-}'[enable/disable specific debug messages]:tag'
}
_emulator "$@"

20
_gem
View File

@ -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() { _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 if (( CURRENT > 2 )); then
(( CURRENT-- )) (( CURRENT-- ))
shift words shift words

View File

@ -80,7 +80,7 @@ single=( --current -c --pretend -p --help -h --version -v )
_values '' \ _values '' \
last yesterday 1st 2nd 3rd 4th 5th last yesterday 1st 2nd 3rd 4th 5th
_alternative \ _alternative \
'*:*:_days' '*:*:_months' && return 0 '*:*:_genlop_days' '*:*:_genlop_months' && return 0
;; ;;
--file|-f) --file|-f)
_arguments '*:logfile:_files' && return 0 _arguments '*:logfile:_files' && return 0
@ -113,13 +113,13 @@ single=( --current -c --pretend -p --help -h --version -v )
_values '' \ _values '' \
last yesterday 1st 2nd 3rd 4th 5th last yesterday 1st 2nd 3rd 4th 5th
_alternative \ _alternative \
':*:_days' ':*:_months' && return 0 ':*:_genlop_days' ':*:_genlop_months' && return 0
;; ;;
esac esac
done done
} }
_days() { _genlop_days() {
local m="monday" t="tuesday" w="wednesday" T="thursday" f="friday" s="saturday" S="sunday" local m="monday" t="tuesday" w="wednesday" T="thursday" f="friday" s="saturday" S="sunday"
local day=$(date +%u) local day=$(date +%u)
if [[ ${day} == 1 ]] then compadd $m if [[ ${day} == 1 ]] then compadd $m
@ -131,7 +131,7 @@ _days() {
elif [[ ${day} == 7 ]] then compadd $m $t $w $T $f $s $S elif [[ ${day} == 7 ]] then compadd $m $t $w $T $f $s $S
fi 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 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) local month=$(date +%m)
if [[ ${month} == 01 ]] then compadd $j if [[ ${month} == 01 ]] then compadd $j

View File

@ -42,10 +42,10 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
typeset -A opt_args
local context state line curcontext="$curcontext"
_git-pulls() { _git-pulls() {
typeset -A opt_args
local context state line curcontext="$curcontext"
local ret=1 local ret=1
_arguments -C \ _arguments -C \

View File

@ -42,16 +42,12 @@
# vim: ft=zsh sw=2 ts=2 et # vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
_git-wtf () { _arguments -w -C -s \
_arguments -w -C -s \ '(--long --short)'{-l,--long}'[include author info and date for each commit]' \
'(--long --short)'{-l,--long}'[include author info and date for each commit]' \ '(--long --short)'{-s,--short}'[do not show commits]' \
'(--long --short)'{-s,--short}'[do not show commits]' \ '(--all)'{-a,--all}'[show all branches across all remote repos, not just those from origin]' \
'(--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]' \
'(--all-commits)'{-A,--all-commits}'[show all commits, not just the first 5]' \ '(--key)'{-k,--key}'[show key]' \
'(--key)'{-k,--key}'[show key]' \ '(--relations)'{-r,--relations}'[show relation to features / integration branches]' \
'(--relations)'{-r,--relations}'[show relation to features / integration branches]' \ '(--dump-config)--dump-config[print out current configuration and exit]' \
'(--dump-config)--dump-config[print out current configuration and exit]' \ '*: :__git_branch_names'
'*: :__git_branch_names'
}
_git-wtf "$@"

View File

@ -42,10 +42,10 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
typeset -A opt_args
local context state line curcontext="$curcontext"
_github() { _github() {
typeset -A opt_args
local context state line curcontext="$curcontext"
local ret=1 local ret=1
_arguments -C \ _arguments -C \

View File

@ -44,10 +44,10 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
typeset -A opt_args
local context state line
_gradle() { _gradle() {
typeset -A opt_args
local context state line
local curcontext="$curcontext" local curcontext="$curcontext"
_arguments \ _arguments \

7
_knife
View File

@ -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 has a very special syntax, some example calls are:
# knife status # knife status
# knife cookbook list # knife cookbook list
@ -34,6 +31,10 @@ knife_general_flags=( --help --server-url --key --config --editor --format --log
_knife() { _knife() {
local curcontext="$curcontext" state line local curcontext="$curcontext" state line
typeset -A opt_args 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) cloudproviders=(bluebox ec2 rackspace slicehost terremark)
_arguments \ _arguments \
'1: :->knifecmd'\ '1: :->knifecmd'\

View File

@ -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(){ _managepy-adminindex(){
_arguments -s : \ _arguments -s : \
$nul_args \ $nul_args \
@ -224,7 +215,16 @@ _applist() {
_values 'Application' $apps && ret=0 _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 local curcontext=$curcontext ret=1
if ((CURRENT == 2)); then if ((CURRENT == 2)); then
@ -237,4 +237,4 @@ _managepy() {
fi fi
} }
_managepy "$@" _manage.py "$@"

6
_mvn
View File

@ -73,10 +73,10 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
typeset -A opt_args
local context state line
_mvn() { _mvn() {
typeset -A opt_args
local context state line
local curcontext="$curcontext" maven_version excl_opts local curcontext="$curcontext" maven_version excl_opts
excl_opts=(-h --help -v --version -ep --encrypt-password -emp --encrypt-master-password) excl_opts=(-h --help -v --version -ep --encrypt-password -emp --encrypt-master-password)

View File

@ -45,7 +45,9 @@
local curcontext="$curcontext" state line local curcontext="$curcontext" state line
typeset -A opt_args typeset -A opt_args
args=( local -a arguments
arguments=(
'--version[output version information]' '--version[output version information]'
'(-h --help)'{-h,--help}'[show help]' '(-h --help)'{-h,--help}'[show help]'
'(-c --vgl-compress)'{-c,--vgl-compress}'[image transport method]:method:(proxy jpeg rgb xb yuv)' '(-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' '(-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' '(-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' '(-s --socket)'{-s,--socket}'[use FILE for communication with the daemon]:file:_files'
'*::arguments: _normal' '*::arguments: _files'
) )
_arguments $args _arguments $arguments

6
_perf
View File

@ -42,10 +42,10 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
local context curcontext="$curcontext" state line
typeset -A opt_args
_perf() { _perf() {
local context curcontext="$curcontext" state line
typeset -A opt_args
local ret=1 local ret=1
_arguments -C \ _arguments -C \

9
_pip
View File

@ -21,7 +21,7 @@
local ret=1 state local ret=1 state
declare -ga common_ops local -a common_ops
common_ops=( common_ops=(
"--version[display version number]" "--version[display version number]"
{-h,--help}"[show help]" {-h,--help}"[show help]"
@ -46,6 +46,7 @@ _arguments \
case $state in case $state in
subcommand) subcommand)
local -a subcommands
subcommands=( subcommands=(
"bundle:create pybundle" "bundle:create pybundle"
"freeze:put all currently installed packages" "freeze:put all currently installed packages"
@ -61,17 +62,17 @@ case $state in
;; ;;
options) options)
declare -a args local -a args
args=( args=(
$common_ops $common_ops
) )
declare -a requirement local -a requirement
requirement=( requirement=(
{-r,--requirement=}"[install all the packages listed in the given requirements file]:filename:_files" {-r,--requirement=}"[install all the packages listed in the given requirements file]:filename:_files"
) )
declare -a findlink local -a findlink
findlink=( findlink=(
{-f,--find-links=}"[URL to look for packages at]:url" {-f,--find-links=}"[URL to look for packages at]:url"
) )

174
_pkcon
View File

@ -39,98 +39,94 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
_pkcon() { local -a options
local -a options options=(
options=( '--version[Show the program version and exit]'
'--version[Show the program version and exit]' '--filter[Set the filter, e.g. installed]'
'--filter[Set the filter, e.g. installed]' "--root[Set the install root, e.g. '/' or '/mnt/ltsp']"
"--root[Set the install root, e.g. '/' or '/mnt/ltsp']" '(-n --nowait)'{-n,--nowait}'[Exit without waiting for actions to complete]'
'(-n --nowait)'{-n,--nowait}'[Exit without waiting for actions to complete]' '(-y --noninteractive)'{-g,--noninteractive}'[Install the packages without asking for confirmation]'
'(-y --noninteractive)'{-g,--noninteractive}'[Install the packages without asking for confirmation]' '--background[Run the command using idle network bandwidth and also using less power]'
'--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]'
'(-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'.]"
'(-c --cache-age)'{-c,--cache-age}"[The maximum metadata cache age. Use -1 for 'never'.]" '(-h --help)'{-h,--help}'[Show help options.]'
'(-h --help)'{-h,--help}'[Show help options.]' '(-v --verbose)'{-v,--verbose}'[Show debugging information for all files]'
'(-v --verbose)'{-v,--verbose}'[Show debugging information for all files]' )
)
local -a actions local -a actions
actions=( actions=(
'accept-eula' 'accept-eula'
'get-roles' 'get-roles'
'get-distro-upgrades' 'get-distro-upgrades'
'get-categories' 'get-categories'
'get-actions' 'get-actions'
'get-groups' 'get-groups'
'get-filters' 'get-filters'
'get-transactions' 'get-transactions'
'get-time' 'get-time'
'search' 'search'
'install' 'install'
'install-local' 'install-local'
'download' 'download'
'remove' 'remove'
'update' 'update'
'refresh' 'refresh'
'resolve' 'resolve'
'get-updates' 'get-updates'
'get-depends' 'get-depends'
'get-requires' 'get-requires'
'get-details' 'get-details'
'get-files' 'get-files'
'get-update-detail' 'get-update-detail'
'get-packages' 'get-packages'
'repo-list' 'repo-list'
'repo-enable' 'repo-enable'
'repo-disable' 'repo-disable'
'repo-set-data' 'repo-set-data'
'what-provides' 'what-provides'
'upgrade-system' 'upgrade-system'
) )
local context state line expl cmd local context state line expl cmd
local -A opt_args local -A opt_args
integer i=2 integer i=2
while (( i < $#words )); do while (( i < $#words )); do
case "$words[$i]" in case "$words[$i]" in
-*) -*)
# skip option # skip option
(( i++ )) (( i++ ))
continue continue
;; ;;
esac esac
if [[ -z "$cmd" ]]; then if [[ -z "$cmd" ]]; then
cmd="$words[$i]" cmd="$words[$i]"
words[$i]=() words[$i]=()
(( CURRENT-- )) (( CURRENT-- ))
fi fi
(( i++ )) (( i++ ))
done done
if [[ -z "$cmd" ]] if [[ -z "$cmd" ]]
then then
_arguments -s -w : $options \ _arguments -s -w : $options \
":action:($actions)" ":action:($actions)"
return return
fi fi
case "$cmd" in case "$cmd" in
search) search)
_arguments : $options \ _arguments : $options \
':type:(name details group file)' \ ':type:(name details group file)' \
':data: :' ':data: :'
;; ;;
refresh) refresh)
_arguments -s -w : $options \ _arguments -s -w : $options \
'--force' '--force'
;; ;;
*) *)
_arguments -s -w : $options _arguments -s -w : $options
;; ;;
esac esac
return 1 return 1
}
_pkcon "$@"

6
_play
View File

@ -43,10 +43,10 @@
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
local context curcontext="$curcontext" state line
typeset -A opt_args
_play() { _play() {
local context curcontext="$curcontext" state line
typeset -A opt_args
local ret=1 local ret=1
_arguments -C \ _arguments -C \

10
_port
View File

@ -16,11 +16,6 @@
local subcmds 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=( subcmds=(
'activate' 'activate'
'archive' 'archive'
@ -97,6 +92,11 @@ case "$state" in
_describe -t commands 'port commands' subcmds _describe -t commands 'port commands' subcmds
;; ;;
(portname) (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 _describe -t commands 'available ports' _port_list
;; ;;
esac esac

View File

@ -108,7 +108,7 @@ _quickpkg () {
# Stuff for emerge # Stuff for emerge
_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 \ noask_opts=(-p -a --pretend --ask --regen --info --search -s --searchdesc \
-S --version -V --help -h --metadata) -S --version -V --help -h --metadata)
@ -319,6 +319,7 @@ _tbz2tool () {
} }
local -A Args
zparseopts -D -E -A Args -- -emerge zparseopts -D -E -A Args -- -emerge
if (( ${+Args[--emerge]} ));then if (( ${+Args[--emerge]} ));then
_emerge "$@" && return 0 _emerge "$@" && return 0

View File

@ -49,7 +49,7 @@
#<app-portage/portage-utils-0.19> #<app-portage/portage-utils-0.19>
# #
local common_args PORTDIR local common_args PORTDIR var
var=PORTDIR var=PORTDIR
[[ -z ${(P)var} && -r /etc/make.conf ]] && [[ -z ${(P)var} && -r /etc/make.conf ]] &&
local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`" local $var="`. /etc/make.conf 2>/dev/null; echo ${(P)var}`"

View File

@ -41,9 +41,9 @@
# vim: ft=zsh sw=2 ts=2 et # vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
local context state line
_pygmentize() { _pygmentize() {
local context state line
_arguments -s -S \ _arguments -s -S \
'-h[prints help]:' \ '-h[prints help]:' \
'-V[prints the package version]:' \ '-V[prints the package version]:' \

4
_sbt
View File

@ -38,12 +38,12 @@
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
function _tasks () { function _sbt_tasks () {
compadd clean compile console console-project console-quick doc package \ compadd clean compile console console-project console-quick doc package \
package-doc package-src publish publish-local run run-main test test-only \ package-doc package-src publish publish-local run run-main test test-only \
test:compile test:package test:package-doc test:package-src update test:compile test:package test:package-doc test:package-src update
} }
_arguments "*:task:_tasks" _arguments "*:task:_sbt_tasks"
return 0 return 0

24
_scala
View File

@ -41,7 +41,7 @@
typeset -A opt_args typeset -A opt_args
local context state line local context state line
function phases () { _scala_phases () {
compadd "parser" "namer" "packageobjects" "typer" "superaccessors" \ compadd "parser" "namer" "packageobjects" "typer" "superaccessors" \
"pickler" "refchecks" "selectiveanf" "liftcode" "selectivecps" "uncurry" \ "pickler" "refchecks" "selectiveanf" "liftcode" "selectivecps" "uncurry" \
"tailcalls" "specialize" "explicitouter" "erasure" "lazyvals" "lambdalift" \ "tailcalls" "specialize" "explicitouter" "erasure" "lazyvals" "lambdalift" \
@ -49,6 +49,7 @@ function phases () {
"dce" "jvm" "terminal" "dce" "jvm" "terminal"
} }
local -a shared_opts
shared_opts=( shared_opts=(
"-bootclasspath+[Override location of bootstrap class files]:bootstrap class directory:_files -/" "-bootclasspath+[Override location of bootstrap class files]:bootstrap class directory:_files -/"
"-classpath+[Specify where to find user class files]: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]" "-Y[Print a synopsis of private options]"
) )
local -a X_opts
X_opts=( X_opts=(
"-Xcheck-null[Warn upon selection of nullable reference]" "-Xcheck-null[Warn upon selection of nullable reference]"
"-Xcheckinit[Wrap field accessors to throw an exception on uninitialized access]" "-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-forwarders[Do not generate static forwarders in mirror classes]"
"-Xno-uescape[Disable handling of \u unicode escapes]" "-Xno-uescape[Disable handling of \u unicode escapes]"
"-Xnojline[Do not use JLine for editing]" "-Xnojline[Do not use JLine for editing]"
"-Xprint\:-[Print out program after <phase>]:phase name:phases" "-Xprint\:-[Print out program after <phase>]:phase name:_scala_phases"
"-Xprint-icode[Log internal icode to *.icode files]" "-Xprint-icode[Log internal icode to *.icode files]"
"-Xprint-pos[Print tree positions, as offsets]" "-Xprint-pos[Print tree positions, as offsets]"
"-Xprint-types[Print tree types (debugging option)]" "-Xprint-types[Print tree types (debugging option)]"
@ -123,6 +125,7 @@ X_opts=(
"-Xplugin-require\:-[Abort unless the given plugin(s) are available]" "-Xplugin-require\:-[Abort unless the given plugin(s) are available]"
) )
local -a Y_opts
Y_opts=( Y_opts=(
"-Y[Print a synopsis of private options]" "-Y[Print a synopsis of private options]"
"-Ybuild-manager-debug[Generate debug information for the Refined Build Manager compiler]" "-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)" "-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]" "-Yrich-exceptions[Fancier exceptions. Set source search path with -Dscala.control.sourcepath]"
"-Yself-in-annots[Include a \"self\" identifier inside of annotations]" "-Yself-in-annots[Include a \"self\" identifier inside of annotations]"
"-Yshow\:-[Show after <phase> (requires -Xshow-class or -Xshow-object)]:phase name:phases" "-Yshow\:-[Show after <phase> (requires -Xshow-class or -Xshow-object)]:phase name:_scala_phases"
"-Yshow-syms[Print the AST symbol hierarchy after each phase]" "-Yshow-syms[Print the AST symbol hierarchy after each phase]"
"-Yshow-trees[Print detailed ASTs (requires -Xprint:phase)]" "-Yshow-trees[Print detailed ASTs (requires -Xprint:phase)]"
"-Ystatistics[Print compiler statistics]" "-Ystatistics[Print compiler statistics]"
"-Ystruct-dispatch\:-[Structural method dispatch policy (default\: poly-cache)]:policy name:(no-cache mono-cache poly-cache invoke-dynamic)" "-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>]:phase name:phases" "-Ybrowse\:-[Browse the abstract syntax tree after <phase>]:phase name:_scala_phases"
"-Ycheck\:-[Check the tree at the end of <phase>]:phase name:phases" "-Ycheck\:-[Check the tree at the end of <phase>]:phase name:_scala_phases"
"-Ylog\:-[Log operations during <phase>]:phase name:phases" "-Ylog\:-[Log operations during <phase>]:phase name:_scala_phases"
"-Yprofile\:-[Profile CPU usage of given phases (requires jgpagent on JVM -agentpath)]:phase name:phases" "-Yprofile\:-[Profile CPU usage of given phases (requires jgpagent on JVM -agentpath)]:phase name:_scala_phases"
"-Yskip\:-[Skip <phase>]:phase name:phases" "-Yskip\:-[Skip <phase>]:phase name:_scala_phases"
"-Ystop-after\:-[Stop after given phase <phase>]:phase name:phases" "-Ystop-after\:-[Stop after given phase <phase>]:phase name:_scala_phases"
"-Ystop-before\:-[Stop before given phase <phase>]:phase name:phases" "-Ystop-before\:-[Stop before given phase <phase>]:phase name:_scala_phases"
"-Ywarn-all[Enable all -Y warnings]" "-Ywarn-all[Enable all -Y warnings]"
"-Ywarn-dead-code[Warn when dead code is identified]" "-Ywarn-dead-code[Warn when dead code is identified]"
@ -188,6 +191,7 @@ Y_opts=(
"-Ytyper-debug[Trace all type assignments]" "-Ytyper-debug[Trace all type assignments]"
) )
local -a scala_opts
scala_opts=( scala_opts=(
"-e+[execute <string> as if entered in the repl]:string" \ "-e+[execute <string> as if entered in the repl]:string" \
"-howtorun+[what to run (default\: guess)]:execution mode:(script object jar guess)" \ "-howtorun+[what to run (default\: guess)]:execution mode:(script object jar guess)" \

View File

@ -16,10 +16,10 @@
# vim: ft=zsh sw=2 ts=2 et # vim: ft=zsh sw=2 ts=2 et
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
typeset -A opt_args _setup.py() {
local context state line typeset -A opt_args
local context state line
_setuppy() {
_arguments -s -S \ _arguments -s -S \
"--verbose[run verbosely (default)]" \ "--verbose[run verbosely (default)]" \
"-v[run verbosely (default)]" \ "-v[run verbosely (default)]" \
@ -700,4 +700,4 @@ _setuppy_upload_docs() {
"*::setup.py commands:_setuppy" "*::setup.py commands:_setuppy"
} }
_setuppy "$@" _setup.py "$@"

6
_srm
View File

@ -15,7 +15,7 @@
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
declare -a opts args local -a opts args
args=( args=(
'(-f --force)'{-f,--force}'[ignore nonexistent files, never prompt]' '(-f --force)'{-f,--force}'[ignore nonexistent files, never prompt]'
'(-r --interactive)'{-i,--interactive}'[prompt before any removal]' '(-r --interactive)'{-i,--interactive}'[prompt before any removal]'
@ -43,14 +43,14 @@ else
fi fi
local curcontext=$curcontext state line ret=1 local curcontext=$curcontext state line ret=1
declare -A opt_args local -A opt_args
_arguments -s -S -C $opts \ _arguments -s -S -C $opts \
$args && ret=0 $args && ret=0
case $state in case $state in
(file) (file)
declare -a ignored local -a ignored
ignored=() ignored=()
((CURRENT > 1)) && ((CURRENT > 1)) &&
ignored+=(${line[1,CURRENT-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH}) ignored+=(${line[1,CURRENT-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH})

View File

@ -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. # should be merged in _ssh.
_arguments -A "-*" \ _arguments -A "-*" \

View File

@ -50,7 +50,7 @@ _box_arguments=(
__task_list () __task_list ()
{ {
local expl local expl
declare -a tasks local -a tasks
tasks=(box destroy halt init package provision reload resume ssh ssh_config status suspend up version) tasks=(box destroy halt init package provision reload resume ssh ssh_config status suspend up version)
@ -70,7 +70,7 @@ __vm_list ()
__vagrant-box () __vagrant-box ()
{ {
local curcontext="$curcontext" state line local curcontext="$curcontext" state line
typeset -A opt_args local -A opt_args
_arguments -C \ _arguments -C \
':command:->command' \ ':command:->command' \
@ -99,7 +99,7 @@ local expl
local -a boxes installed_boxes local -a boxes installed_boxes
local curcontext="$curcontext" state line local curcontext="$curcontext" state line
typeset -A opt_args local -A opt_args
_arguments -C \ _arguments -C \
':command:->command' \ ':command:->command' \

208
_yaourt
View File

@ -4,104 +4,6 @@
# copy this file to /usr/share/zsh/site-functions/_pacman # 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 # handles --help subcommand
_yaourt_action_help() { _yaourt_action_help() {
_arguments -s : \ _arguments -s : \
@ -288,7 +190,113 @@ _yaourt_get_command() {
} }
# main dispatcher # 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 case $words[2] in
-Q*g*) # ipkg groups -Q*g*) # ipkg groups
_arguments -s : \ _arguments -s : \
@ -335,4 +343,4 @@ _pacman() {
} }
# run the main dispatcher # run the main dispatcher
_pacman "$@" _yaourt "$@"

36
_zargs
View File

@ -1,36 +0,0 @@
#compdef zargs
# ------------------------------------------------------------------------------
# Description
# -----------
#
# Completion script for zargs.
#
# Source: http://smasher.org/tmp/_zargs.gz
#
# ------------------------------------------------------------------------------
# Authors
# -------
#
# * Atom Smasher <atom@smasher.org>
# * Sorin Ionescu <sorin.ionescu@gmail.com>
#
# ------------------------------------------------------------------------------
_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'