Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH 09/25] Make *all* helpers functions begin with __luarocks.



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