summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2017-07-27 13:38:54 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2017-07-28 15:46:00 +0000
commita6f2755448158234183ef28ed9667c27a25098d7 (patch)
tree23bdefdc68f126119049992ceeaa546dbc7d6cc8
parent4015f3cf5d5ab0c339472cf6201dab7ff5285057 (diff)
downloadzsh-a6f2755448158234183ef28ed9667c27a25098d7.tar.gz
zsh-a6f2755448158234183ef28ed9667c27a25098d7.tar.xz
zsh-a6f2755448158234183ef28ed9667c27a25098d7.zip
41471 (tweaked): _svn: Complete propvals in 'propset'.
-rw-r--r--ChangeLog3
-rw-r--r--Completion/Unix/Command/_subversion25
2 files changed, 27 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 609cf1c22..6e0a8c464 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2017-07-28  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
+	* 41471 (tweaked): Completion/Unix/Command/_subversion: _svn:
+	Complete propvals in 'propset'.
+
 	* 41458: Completion/Unix/Command/_subversion: Don't cache an
 	empty commands list when svn is not available at the first
 	invocation of _svn.
diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion
index 2f6b567ac..b4ccccfae 100644
--- a/Completion/Unix/Command/_subversion
+++ b/Completion/Unix/Command/_subversion
@@ -150,7 +150,8 @@ _svn () {
 	  ;;
 	  (propset)
 	    args=(
-	    ':propname:(svn:ignore svn:keywords svn:executable svn:eol-style svn:mime-type svn:externals svn:needs-lock)'
+	    ':propname:(svn:ignore svn:keywords svn:executable svn:eol-style svn:mime-type svn:externals svn:needs-lock svn:global-ignores svn:auto-props)'
+	    ':propval:->propset_propval'
 	    ${args/(#b)(*--file*):arg:/$match[1]:file:_files}
 	    '*:path or url: _alternative "files:file:_files" "urls:URL:_svn_urls"'
 	    )
@@ -179,6 +180,28 @@ _svn () {
         esac
 
         _arguments "$args[@]" && ret=0
+        case $state in
+          (propset_propval)
+            case $words[2] in
+              (svn:executable|svn:needs-lock) compadd yes;;
+              (svn:keywords)
+                compset -q
+                # '_values -w' only excludes words in argv[1] or later, so
+                # install a dummy argv[0].  This affects Foo in [[svn propset
+                # svn:keywords 'Foo Bar Baz <TAB>]].
+                words=( dummy $words ); (( ++CURRENT ))
+                _values -s ' ' -w "keywords (or custom)" \
+                  '(URL HeadURL)'{URL,HeadURL}'[URL for the head version of the file]' \
+                  '(Author LastChangedBy)'{Author,LastChangedBy}'[last person to modify the file]' \
+                  '(Date LastChangedDate)'{Date,LastChangedDate}'[date/time the file was last modified]' \
+                  '(Rev Revision LastChangedRevision)'{Rev,Revision,LastChangedRevision}'[last revision the file changed]' \
+                  Id'[compressed summary of URL,Revision,Date,Author]' \
+                  Header"[like 'Id' but includes the full URL]";;
+              (svn:eol-style) compadd - CR LF CRLF native;;
+              (svn:mime-type) _mime_types;;
+              (*) _message 'property value';;
+            esac
+        esac
 
       else
         _message "unknown svn command: $words[1]"