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:
parent
3497b4841c
commit
c3b4d582a0
2
_adb
2
_adb
|
@ -43,10 +43,10 @@
|
|||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_adb() {
|
||||
typeset -A opt_args
|
||||
local context state line curcontext="$curcontext" adb_args
|
||||
|
||||
_adb() {
|
||||
local ret=1
|
||||
|
||||
_arguments -C \
|
||||
|
|
2
_android
2
_android
|
@ -43,10 +43,10 @@
|
|||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_android() {
|
||||
typeset -A opt_args
|
||||
local context state line curcontext="$curcontext"
|
||||
|
||||
_android() {
|
||||
local ret=1
|
||||
|
||||
_arguments -C -A "-*" \
|
||||
|
|
4
_debuild
4
_debuild
|
@ -44,7 +44,6 @@
|
|||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_debuild() {
|
||||
# FIXME --noconf is only allowed in first position
|
||||
_arguments \
|
||||
'(- 1 *)'{-h,--help}'[show help]' \
|
||||
|
@ -59,6 +58,3 @@ _debuild() {
|
|||
'(-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 "$@"
|
||||
|
|
6
_ditz
6
_ditz
|
@ -19,9 +19,9 @@
|
|||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
ME=ditz
|
||||
COMMANDS=--commands
|
||||
OPTIONS='<options>'
|
||||
local ME=ditz
|
||||
local COMMANDS=--commands
|
||||
local OPTIONS='<options>'
|
||||
|
||||
if (($CURRENT == 2)); then
|
||||
# We're completing the first word after the tool: the command.
|
||||
|
|
|
@ -46,8 +46,6 @@
|
|||
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
|
||||
|
@ -134,6 +132,3 @@ _emulator() {
|
|||
'-qemu[pass arguments to qemu]:arguments' \
|
||||
'-verbose[same as '\''-debug-init'\'']' \
|
||||
'*'{-debug,-debug-,-debug-no-}'[enable/disable specific debug messages]:tag'
|
||||
}
|
||||
|
||||
_emulator "$@"
|
||||
|
|
4
_gem
4
_gem
|
@ -19,6 +19,9 @@
|
|||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_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]"
|
||||
|
@ -28,7 +31,6 @@ gem_general_flags=("(-h --help)"{-h,--help}"[Get help on this command]"
|
|||
$nul_arg
|
||||
)
|
||||
|
||||
_gem() {
|
||||
if (( CURRENT > 2 )); then
|
||||
(( CURRENT-- ))
|
||||
shift words
|
||||
|
|
8
_genlop
8
_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
|
||||
|
|
|
@ -42,10 +42,10 @@
|
|||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_git-pulls() {
|
||||
typeset -A opt_args
|
||||
local context state line curcontext="$curcontext"
|
||||
|
||||
_git-pulls() {
|
||||
local ret=1
|
||||
|
||||
_arguments -C \
|
||||
|
|
4
_git-wtf
4
_git-wtf
|
@ -42,7 +42,6 @@
|
|||
# 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]' \
|
||||
|
@ -52,6 +51,3 @@ _git-wtf () {
|
|||
'(--relations)'{-r,--relations}'[show relation to features / integration branches]' \
|
||||
'(--dump-config)--dump-config[print out current configuration and exit]' \
|
||||
'*: :__git_branch_names'
|
||||
}
|
||||
|
||||
_git-wtf "$@"
|
||||
|
|
2
_github
2
_github
|
@ -42,10 +42,10 @@
|
|||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_github() {
|
||||
typeset -A opt_args
|
||||
local context state line curcontext="$curcontext"
|
||||
|
||||
_github() {
|
||||
local ret=1
|
||||
|
||||
_arguments -C \
|
||||
|
|
2
_gradle
2
_gradle
|
@ -44,10 +44,10 @@
|
|||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_gradle() {
|
||||
typeset -A opt_args
|
||||
local context state line
|
||||
|
||||
_gradle() {
|
||||
local curcontext="$curcontext"
|
||||
|
||||
_arguments \
|
||||
|
|
7
_knife
7
_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'\
|
||||
|
|
22
_manage.py
22
_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 "$@"
|
||||
|
|
2
_mvn
2
_mvn
|
@ -73,10 +73,10 @@
|
|||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_mvn() {
|
||||
typeset -A opt_args
|
||||
local context state line
|
||||
|
||||
_mvn() {
|
||||
local curcontext="$curcontext" maven_version excl_opts
|
||||
|
||||
excl_opts=(-h --help -v --version -ep --encrypt-password -emp --encrypt-master-password)
|
||||
|
|
8
_optirun
8
_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
|
||||
|
|
2
_perf
2
_perf
|
@ -42,10 +42,10 @@
|
|||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_perf() {
|
||||
local context curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_perf() {
|
||||
local ret=1
|
||||
|
||||
_arguments -C \
|
||||
|
|
9
_pip
9
_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"
|
||||
)
|
||||
|
|
4
_pkcon
4
_pkcon
|
@ -39,7 +39,6 @@
|
|||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_pkcon() {
|
||||
local -a options
|
||||
options=(
|
||||
'--version[Show the program version and exit]'
|
||||
|
@ -131,6 +130,3 @@ _pkcon() {
|
|||
;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
|
||||
_pkcon "$@"
|
||||
|
|
2
_play
2
_play
|
@ -43,10 +43,10 @@
|
|||
# ------------------------------------------------------------------------------
|
||||
|
||||
|
||||
_play() {
|
||||
local context curcontext="$curcontext" state line
|
||||
typeset -A opt_args
|
||||
|
||||
_play() {
|
||||
local ret=1
|
||||
|
||||
_arguments -C \
|
||||
|
|
10
_port
10
_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
|
||||
|
|
1
_portage
1
_portage
|
@ -319,6 +319,7 @@ _tbz2tool () {
|
|||
}
|
||||
|
||||
|
||||
local -A Args
|
||||
zparseopts -D -E -A Args -- -emerge
|
||||
if (( ${+Args[--emerge]} ));then
|
||||
_emerge "$@" && return 0
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
#<app-portage/portage-utils-0.19>
|
||||
#
|
||||
|
||||
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}`"
|
||||
|
|
|
@ -41,9 +41,9 @@
|
|||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_pygmentize() {
|
||||
local context state line
|
||||
|
||||
_pygmentize() {
|
||||
_arguments -s -S \
|
||||
'-h[prints help]:' \
|
||||
'-V[prints the package version]:' \
|
||||
|
|
4
_sbt
4
_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
|
||||
|
|
24
_scala
24
_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>]:phase name:phases"
|
||||
"-Xprint\:-[Print out program after <phase>]: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 <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-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>]:phase name:phases"
|
||||
"-Ycheck\:-[Check the tree at the end of <phase>]:phase name:phases"
|
||||
"-Ylog\:-[Log operations during <phase>]:phase name:phases"
|
||||
"-Yprofile\:-[Profile CPU usage of given phases (requires jgpagent on JVM -agentpath)]:phase name:phases"
|
||||
"-Yskip\:-[Skip <phase>]:phase name:phases"
|
||||
"-Ystop-after\:-[Stop after given phase <phase>]:phase name:phases"
|
||||
"-Ystop-before\:-[Stop before given phase <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:_scala_phases"
|
||||
"-Ylog\:-[Log operations during <phase>]:phase name:_scala_phases"
|
||||
"-Yprofile\:-[Profile CPU usage of given phases (requires jgpagent on JVM -agentpath)]:phase name:_scala_phases"
|
||||
"-Yskip\:-[Skip <phase>]:phase name:_scala_phases"
|
||||
"-Ystop-after\:-[Stop after given phase <phase>]:phase name:_scala_phases"
|
||||
"-Ystop-before\:-[Stop before given phase <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 <string> as if entered in the repl]:string" \
|
||||
"-howtorun+[what to run (default\: guess)]:execution mode:(script object jar guess)" \
|
||||
|
|
|
@ -16,10 +16,10 @@
|
|||
# vim: ft=zsh sw=2 ts=2 et
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
_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 "$@"
|
||||
|
|
6
_srm
6
_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})
|
||||
|
|
|
@ -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 "-*" \
|
||||
|
|
6
_vagrant
6
_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' \
|
||||
|
|
208
_yaourt
208
_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 "$@"
|
||||
|
|
36
_zargs
36
_zargs
|
@ -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'
|
||||
|
Loading…
Reference in New Issue