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

[PATCH 19/25] Fix git tag completion by autoloading _git



From: Doron Behar <doron.behar@xxxxxxxxx>

---
 Completion/Unix/Command/_luarocks | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/Completion/Unix/Command/_luarocks b/Completion/Unix/Command/_luarocks
index 05a1e1d38..68f38523e 100644
--- a/Completion/Unix/Command/_luarocks
+++ b/Completion/Unix/Command/_luarocks
@@ -181,6 +181,17 @@ __luarocks_rock(){
 	_alternative ${alts[@]}
 }
 # }}}
+# {{{ helper: git tags
+__luarocks_git_tags(){
+	autoload +X _git
+	local _git_def="$(whence -v _git)"
+	. ${_git_def##* }
+	type __git_tags &> /dev/null
+	if [[ $? != 1 ]]; then
+		__git_tags
+	fi
+}
+# }}}
 
 # {{{ `build` command
 # arguments:
@@ -294,7 +305,7 @@ _luarocks_make(){
 # - optional: version (unless a --tag was given)
 # - optional: URL
 local new_version_command_options=(
-	'--tag=[if no version is specified, this option'"'"'s argument is used instead]:TAG:__git_tag'
+	'--tag=[if no version is specified, this option'"'"'s argument is used instead]:TAG:__luarocks_git_tags'
 )
 _luarocks_new_version(){
 	_arguments -A "-*" \
-- 
2.17.0



Messages sorted by: Reverse Date, Date, Thread, Author