summaryrefslogtreecommitdiffstats
path: root/Completion/Unix/Command/_subversion
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2003-11-14 11:56:52 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2003-11-14 11:56:52 +0000
commitb58339667420ef41df027ce400979d602082072e (patch)
treefb332866dca1f0a6095f6ba3292b49837a035420 /Completion/Unix/Command/_subversion
parentunposted: fix typo in _w3m (diff)
downloadzsh-b58339667420ef41df027ce400979d602082072e.tar
zsh-b58339667420ef41df027ce400979d602082072e.tar.gz
zsh-b58339667420ef41df027ce400979d602082072e.tar.bz2
zsh-b58339667420ef41df027ce400979d602082072e.tar.lz
zsh-b58339667420ef41df027ce400979d602082072e.tar.xz
zsh-b58339667420ef41df027ce400979d602082072e.tar.zst
zsh-b58339667420ef41df027ce400979d602082072e.zip
19244: various completion function fixes and updates
Diffstat (limited to 'Completion/Unix/Command/_subversion')
-rw-r--r--Completion/Unix/Command/_subversion85
1 files changed, 63 insertions, 22 deletions
diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion
index 4fea4f72e..baccb7c94 100644
--- a/Completion/Unix/Command/_subversion
+++ b/Completion/Unix/Command/_subversion
@@ -3,15 +3,37 @@
_svn () {
_arguments -s \
+ '(-)--help[print help information]' \
+ '(- *)--version[print client version information]' \
'*::svn command:_svn_command'
}
_svnadmin () {
_arguments -s \
+ '(-)--help[print help information]' \
+ '(- *)--version[print client version information]' \
'*::svnadmin command:_svnadmin_command'
}
+(( $+functions[_svn_controlled] )) ||
+_svn_controlled() {
+ [[ -f ${(M)REPLY##*/}.svn/text-base/${REPLY##*/}.svn-base ]]
+}
+
+(( $+functions[_svn_urls] )) ||
+_svn_urls() {
+ local expl
+
+ if [[ -prefix *: ]]; then
+ _urls
+ else
+ compset -S '[^:]*'
+ _wanted url-schemas expl 'URL schema' compadd -S '' - \
+ file:// http:// https:// svn:// svn+ssh://
+ fi
+}
+
(( $+functions[_svn_command] )) ||
_svn_command () {
local cmd
@@ -19,12 +41,12 @@ _svn_command () {
if (( ! $+_svn_cmds )); then
typeset -gA _svn_cmds
_svn_cmds=(
- ${=${(f)${${"$(svn help)"#l#*Available subcommands:}%%Subversion is a tool*}}/(#s)[[:space:]]#(#b)([a-z]##)[[:space:]]#(\([a-z, ?]##\))#/$match[1] :$match[1]${match[2]:+:${${match[2]//[(),]}// /:}}:}
+ ${=${(f)${${"$(_call_program commands svn help)"#l#*Available subcommands:}%%Subversion is a tool*}}/(#s)[[:space:]]#(#b)([a-z]##)[[:space:]]#(\([a-z, ?]##\))#/$match[1] :$match[1]${match[2]:+:${${match[2]//[(),]}// /:}}:}
)
fi
if (( CURRENT == 1 )); then
- _tags commands && { compadd "$@" -k _svn_cmds || compadd "$@" ${_svn_cmds} }
+ _tags commands && { compadd "$@" -k _svn_cmds || compadd "$@" ${(s.:.)_svn_cmds} }
else
local curcontext="$curcontext"
@@ -42,36 +64,56 @@ _svn_command () {
_svn_subcommand () {
local subcmd _svn_subcmds _svn_subcmd_usage
- _svn_subcmd_usage=${${(M)${(f)"$(svn help $1)"}:#usage:*}#usage: $1 }
+ _svn_subcmd_usage=${${(M)${(f)"$(_call_program options svn help $1)"}:#usage:*}#usage: $1 }
_svn_subcmds=(
- ${${=${${${(M)${(f)"$(svn help $1)"##*Valid options:}:#*:*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}[2,-1]}
+ ${${=${${${(M)${(f)"$(_call_program options svn help $1)"##*Valid options:}:#*:*}%% #:*}/ arg/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]}[2,-1]}
)