Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH 09/25] Make *all* helpers functions begin with __luarocks.
- X-seq: zsh-workers 42836
- From: doron.behar@xxxxxxxxx
- To: zsh-workers@xxxxxxx
- Subject: [PATCH 09/25] Make *all* helpers functions begin with __luarocks.
- Date: Sat, 26 May 2018 18:06:18 +0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=ewwk+xZ2/752nGhimoJ8FG4AJDjfGYjdovE34j5k6qc=; b=Njjeg6eDMKkOHZJ/NS7j9JzKBtvJ6uicgpvwqoxxDSPxWlsYGiT/bvNfJ55oBCyRdo nzSx3iys0Uas1qTjzZmWEVtvzg1xqqOJXWJubJjyiKFrCXKWBcKqiFy+Hy760rFpCRkQ g6QvfB3XSCp6v28b/4ugLBXOJ7ndV4pj4fYksyZ/H2jLFKCZWTwZOhOrGf5xwmbmWGiI DulC6gFxVQd2wisWGqQv3q2/WwT0+1ATjFO28BcLEYMM5SbtB+zpXqPRIQCqtVe616pi lzLuXLJQtwA/VOKxi73jfoWmTOWaVLetv8rMffOWkyCICvNbpA6J1FuKddSc3wRCDsXp UXrA==
- In-reply-to: <20180526150634.15683-1-doron.behar@gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20180526150634.15683-1-doron.behar@gmail.com>
From: Doron Behar <doron.behar@xxxxxxxxx>
---
Completion/Unix/Command/_luarocks | 57 ++++++++++++++++---------------
1 file changed, 29 insertions(+), 28 deletions(-)
diff --git a/Completion/Unix/Command/_luarocks b/Completion/Unix/Command/_luarocks
index acbc16cb4..de296a084 100644
--- a/Completion/Unix/Command/_luarocks
+++ b/Completion/Unix/Command/_luarocks
@@ -1,5 +1,31 @@
#compdef luarocks
+# {{{ helper: luarocks commands
+__luarocks_command(){
+ local -a commands=(
+ build:'Build/compile a rock'
+ config:'Query information about the LuaRocks configuration'
+ doc:'Show documentation for an installed rock'
+ download:'Download a specific rock file from a rocks server'
+ help:'Help on commands'
+ install:'Install a rock'
+ lint:'Check syntax of a rockspec'
+ list:'List currently installed rocks'
+ make:'Compile package in current directory using a rockspec'
+ new_version:'Auto-write a rockspec for a new version of a rock'
+ pack:'Create a rock, packing sources or binaries'
+ path:'Return the currently configured package path'
+ purge:'Remove all installed rocks from a tree'
+ remove:'Uninstall a rock'
+ search:'Query the LuaRocks servers'
+ show:'Show information about an installed rock'
+ unpack:'Unpack the contents of a rock'
+ upload:'Upload a rockspec to the public rocks repository'
+ write_rockspec:'Write a template for a rockspec file'
+ )
+ _describe -t commands 'command' commands "$@"
+}
+# }}}
# {{{ helper: dependencies mode
local option_deps_mode='--deps-mode=[How to handle dependencies]:MODE:__luarocks_deps_mode'
__luarocks_deps_mode(){
@@ -24,7 +50,7 @@ __luarocks_rock_version(){
}
# }}}
# {{{ helper: list of libraries that C files need to link to
-_luarocks_write_rockspec_lib(){
+__luarocks_c_libs(){
}
# }}}
# {{{ helper: lua versions
@@ -255,38 +281,13 @@ local write_rockspec_command_options=(
'--lua-version=[Supported Lua versions]:LUA_VER:__luarocks_version'
'--rockspec-format=[Rockspec format version, such as "1.0" or "1.1"]:VER: '
'--tag=[Tag to use. Will attempt to extract version number from it]:TAG:__git_tag'
- '--lib=[A comma-separated list of libraries that C files need to link to]:_luarocks_write_rockspec_lib'
+ '--lib=[A comma-separated list of libraries that C files need to link to]:__luarocks_c_libs'
)
_luarocks_write_rockspec(){
}
# }}}
# The real thing
-_luarocks_command(){
- local -a commands=(
- build:'Build/compile a rock'
- config:'Query information about the LuaRocks configuration'
- doc:'Show documentation for an installed rock'
- download:'Download a specific rock file from a rocks server'
- help:'Help on commands'
- install:'Install a rock'
- lint:'Check syntax of a rockspec'
- list:'List currently installed rocks'
- make:'Compile package in current directory using a rockspec'
- new_version:'Auto-write a rockspec for a new version of a rock'
- pack:'Create a rock, packing sources or binaries'
- path:'Return the currently configured package path'
- purge:'Remove all installed rocks from a tree'
- remove:'Uninstall a rock'
- search:'Query the LuaRocks servers'
- show:'Show information about an installed rock'
- unpack:'Unpack the contents of a rock'
- upload:'Upload a rockspec to the public rocks repository'
- write_rockspec:'Write a template for a rockspec file'
- )
- _describe -t commands 'command' commands "$@"
-}
-
_arguments -C \
'(--server --only-server)--server=[Fetch rocks/rockspecs from this server]:HOST:_hosts' \
'(--server --only-server)--only-server=[Fetch rocks/rockspecs from this server only]:HOST:_hosts' \
@@ -295,7 +296,7 @@ _arguments -C \
'--local[Use the tree in the user'"'"'s home directory]' \
'--verbose[Display verbose output of commands executed]' \
'--timeout=[Timeout on network operations]:SECONDS:{_message "timeout (seconds)"}' \
- '1: :_luarocks_command' \
+ '1: :__luarocks_command' \
'*::arg:->args'
case "$state" in
--
2.17.0
Messages sorted by:
Reverse Date,
Date,
Thread,
Author