zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Zsh workers <zsh-workers@zsh.org>
Subject: PATCH: complete subversion change lists
Date: Fri, 10 Feb 2012 16:38:48 +0100	[thread overview]
Message-ID: <22654.1328888328@thecus.kiddle.eu> (raw)

This updates subversion completion for one of the newer subversion
features.

Oliver

Index: Completion/Unix/Command/_subversion
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_subversion,v
retrieving revision 1.34
diff -u -r1.34 _subversion
--- Completion/Unix/Command/_subversion	16 Dec 2011 09:18:34 -0000	1.34
+++ Completion/Unix/Command/_subversion	10 Feb 2012 15:36:45 -0000
@@ -31,7 +31,7 @@
       _wanted commands expl 'svn command' _svn_commands && ret=0
     ;;
     args)
-      local cmd args usage
+      local cmd args usage idx
       typeset -gHA _cache_svn_status _cache_svn_mtime
 
       cmd="${${(k)_svn_cmds[(R)*:$words[1]:*]}:-${(k)_svn_cmds[(i):$words[1]:]}}"
@@ -50,6 +50,9 @@
 	  args=(
 	    ${=${${${(M)${(f)"$(LC_ALL=C _call_program options svn help $cmd)"#(*Valid options:|(#e))}:#* :*}%% #:*}/ (arg|ARG)/:arg:}/(#b)(-##)([[:alpha:]]##) \[--([a-z-]##)\](:arg:)#/(--$match[3])$match[1]$match[2]$match[4] ($match[1]$match[2])--$match[3]$match[4]}
 	  )
+          while (( idx=$args[(I)*--c(l|hangelist):arg:] )); do
+            args[(I)*--c(l|hangelist):arg:]=( \*{--cl,--changelist}':change list:_svn_changelists' )
+          done
 	  _store_cache svn-${cmd}-args args
 	fi
 
@@ -309,6 +312,14 @@
   compadd "$@" -a properties && return 0
 }
 
+(( $+functions[_svn_changelists] )) ||
+_svn_changelists() {
+  local cls
+
+  cls=( ${${${(M)${(f)"$(LC_ALL=C _call_program changelists svn status 2>/dev/null)"}:#--- Changelist*}%??}##*\'} )
+  compadd "$@" -a cls && return 0
+}
+
 _subversion () {
   case $service in
     (svn) _svn "$@" ;;


             reply	other threads:[~2012-02-10 15:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-10 15:38 Oliver Kiddle [this message]
2012-02-11  1:08 ` Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=22654.1328888328@thecus.kiddle.eu \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).