From 0389fc3a7f41e41c4aec3d6d33de7e19b63d3502 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Thu, 28 Jul 2016 15:01:00 +0000 Subject: unposted: _svnadmin: Tweak state description. --- Completion/Unix/Command/_subversion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Completion/Unix/Command/_subversion') diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion index 3cc9e8a0b..08ba0e846 100644 --- a/Completion/Unix/Command/_subversion +++ b/Completion/Unix/Command/_subversion @@ -213,7 +213,7 @@ _svnadmin () { ${=${${${(M)${(f)"$(_comp_locale; _call_program options svnadmin help $cmd)"#(*Valid options:|(#e))}:#* :*}%% #:*}/ (arg|ARG)/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]} ) if [[ $usage == *REPOS_PATH* ]]; then - args+=( ":path:_files -/" ) + args+=( ":repository path:_files -/" ) elif [[ $cmd = help ]]; then args+=( "*:subcommand:_svnadmin_commands" ) fi -- cgit v1.2.3 From eaaac9c89f2d71626e6be1a29a3e01b1c42aa5cb Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Fri, 29 Jul 2016 17:03:03 +0000 Subject: 38965: _svnadmin: Complete 'freeze' as a precommand. --- ChangeLog | 3 +++ Completion/Unix/Command/_subversion | 30 +++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command/_subversion') diff --git a/ChangeLog b/ChangeLog index bb3c16e1c..59939039b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2016-07-31 Daniel Shahaf + * 38965: Completion/Unix/Command/_subversion: _svnadmin: Complete + 'freeze' as a precommand. + * 38962: Completion/Unix/Command/_git: _git-config: Document more line noise. diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion index 08ba0e846..2c21aa740 100644 --- a/Completion/Unix/Command/_subversion +++ b/Completion/Unix/Command/_subversion @@ -183,6 +183,9 @@ _svn () { _svnadmin () { local curcontext="$curcontext" state line ret=1 + integer NORMARG + local context state_descr + typeset -A opt_args _arguments -C \ '(-)--help[print help information]' \ @@ -214,11 +217,36 @@ _svnadmin () { ) if [[ $usage == *REPOS_PATH* ]]; then args+=( ":repository path:_files -/" ) + case $cmd in + (freeze) + args+=( "*:arguments:->normal" ) + ;; + esac elif [[ $cmd = help ]]; then args+=( "*:subcommand:_svnadmin_commands" ) fi - _arguments "$args[@]" && ret=0 + _arguments -n -s -S : "$args[@]" && ret=0 + + case $state in + # Test cases: + # svnadmin freeze . rsync -- offers --file + # svnadmin freeze -- . rsync - offers rsync's options + # + # Note: the NORMARG calculations here include one positional argument + # (the '.') before the command. + (normal) + if (( ${words[(i)--]} < CURRENT )); then + words[1,NORMARG]=() + (( CURRENT -= NORMARG )) + _normal && ret=0 + elif (( NORMARG+1 == CURRENT )); then + # ### don't allow --options in this case + # TODO: this should just use '_normal -F "(-*)"', but _normal ignores its arguments. + _command_names -e && ret=0 + fi + ;; + esac else _message "unknown svnadmin command: $words[1]" fi -- cgit v1.2.3 From 625fe0fce898742ab6f14c5cc3dbfb1a89265a83 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Fri, 29 Jul 2016 17:03:04 +0000 Subject: 38966: _svnadmin: Complete positional arguments for 'hotcopy', 'setlog', 'setrevprop', 'delrevprop'. --- ChangeLog | 4 ++++ Completion/Unix/Command/_subversion | 12 ++++++++++++ 2 files changed, 16 insertions(+) (limited to 'Completion/Unix/Command/_subversion') diff --git a/ChangeLog b/ChangeLog index 59939039b..b2a7a9a5e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2016-07-31 Daniel Shahaf + * 38966: Completion/Unix/Command/_subversion: _svnadmin: Complete + positional arguments for 'hotcopy', 'setlog', 'setrevprop', + 'delrevprop'. + * 38965: Completion/Unix/Command/_subversion: _svnadmin: Complete 'freeze' as a precommand. diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion index 2c21aa740..7d15cf9e3 100644 --- a/Completion/Unix/Command/_subversion +++ b/Completion/Unix/Command/_subversion @@ -221,6 +221,18 @@ _svnadmin () { (freeze) args+=( "*:arguments:->normal" ) ;; + (hotcopy) + args+=( ":new repository:_files -/" ) + ;; + (setlog) + args+=( ": :_files" ) + ;; + (setrevprop) + args+=( ":property name" ":property value file:_files" ) + ;; + (delrevprop) + args+=( ":property name" ) + ;; esac elif [[ $cmd = help ]]; then args+=( "*:subcommand:_svnadmin_commands" ) -- cgit v1.2.3 From d8786da0cd091fa44fd5b1f11ae90f070952f0c8 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Mon, 7 Nov 2016 05:28:06 +0000 Subject: 39853: _subversion: Accept long options in the '--foo=bar' syntax. --- ChangeLog | 5 +++++ Completion/Unix/Command/_subversion | 22 ++++++++++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-) (limited to 'Completion/Unix/Command/_subversion') diff --git a/ChangeLog b/ChangeLog index 629a7a5b7..272264163 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-11-09 Daniel Shahaf + + * 39853: Completion/Unix/Command/_subversion: Accept long + options in the '--foo=bar' syntax. + 2016-11-08 Peter Stephenson * Sebastian: 39871: cut down number of strlen()s in getstrvalue(). diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion index 7d15cf9e3..b0c032024 100644 --- a/Completion/Unix/Command/_subversion +++ b/Completion/Unix/Command/_subversion @@ -65,30 +65,33 @@ _svn () { ${=${${${(M)${(f)"$(_comp_locale; _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)*--accept:arg:] )); do - args[(I)*--accept:arg:]=( --accept':automatic conflict resolution action:((working\:working base\:base '"`for i j in p postpone mc mine-conflict tc theirs-conflict mf mine-full tf theirs-full e edit l launch; do print -rn $i\\\\:$j $j\\\\:$j ""; done `"'))' ) + args[(I)*--accept:arg:]=( --accept'=:automatic conflict resolution action:((working\:working base\:base '"`for i j in p postpone mc mine-conflict tc theirs-conflict mf mine-full tf theirs-full e edit l launch; do print -rn $i\\\\:$j $j\\\\:$j ""; done `"'))' ) done while (( idx=$args[(I)*--c(l|hangelist):arg:] )); do - args[(I)*--c(l|hangelist):arg:]=( \*{--cl,--changelist}':change list:_svn_changelists' ) + args[(I)*--c(l|hangelist):arg:]=( \*{--cl,--changelist}'=:change list:_svn_changelists' ) done while (( idx=$args[(I)*--config-dir:arg:] )); do - args[(I)*--config-dir:arg:]=( --config-dir':config dir:_directories' ) + args[(I)*--config-dir:arg:]=( --config-dir'=:config dir:_directories' ) done while (( idx=$args[(I)*--depth:arg:] )); do - args[(I)*--depth:arg:]=( --depth':operation depth (how far to recurse):(empty files immediates infinity)' ) + args[(I)*--depth:arg:]=( --depth'=:operation depth (how far to recurse):(empty files immediates infinity)' ) done while (( idx=$args[(I)*(-F|--file):arg:] )); do - args[(I)*(-F|--file):arg:]=( '(-F --file)'{-F,--file}':log message file:_files' ) + args[(I)*(-F|--file):arg:]=( '(-F --file)'{-F+,--file=}':log message file:_files' ) done while (( idx=$args[(I)*--set-depth:arg:] )); do - args[(I)*--set-depth:arg:]=( --set-depth'[make working copy deeper or shallower]:new depth:(exclude empty files immediates infinity)' ) + args[(I)*--set-depth:arg:]=( --set-depth'=[make working copy deeper or shallower]:new depth:(exclude empty files immediates infinity)' ) done while (( idx=$args[(I)*--trust-server-cert-failures:arg:] )); do - args[(I)*--trust-server-cert-failures:arg:]=( --trust-server-cert-failures':failures:_values -s , "certificate failures to ignore" "unknown-ca[unknown authority]" "cn-mismatch[hostname mismatch]" "expired[certificate expired]" "not-yet-valid[certificate not yet valid]" "other[all other failures]"' ) + args[(I)*--trust-server-cert-failures:arg:]=( --trust-server-cert-failures'=:failures:_values -s , "certificate failures to ignore" "unknown-ca[unknown authority]" "cn-mismatch[hostname mismatch]" "expired[certificate expired]" "not-yet-valid[certificate not yet valid]" "other[all other failures]"' ) done while (( idx=$args[(I)*--show-item:arg:] )); do # (q) to quote the parentheses in the value - args[(I)*--show-item:arg:]=( --show-item':item key:(('"`for i j in ${(kv)show_item_keys}; do print -rn - $i\\\\:"${(q)j}" ""; done`"'))' ) + args[(I)*--show-item:arg:]=( --show-item'=:item key:(('"`for i j in ${(kv)show_item_keys}; do print -rn - $i\\\\:"${(q)j}" ""; done`"'))' ) done + # All other options get {-x+,--long-x=} + args=( ${args/(#b)(--[A-Za-z0-9-]##):arg:/$match[1]=:arg:} ) + args=( ${args/(#b)([^=]):arg:/$match[1]+:arg:} ) _store_cache svn-${cmd}-args args fi @@ -215,6 +218,9 @@ _svnadmin () { args=( ${=${${${(M)${(f)"$(_comp_locale; _call_program options svnadmin help $cmd)"#(*Valid options:|(#e))}:#* :*}%% #:*}/ (arg|ARG)/:arg:}/(#b)-([[:alpha:]]) \[--([a-z-]##)\](:arg:)#/(--$match[2])-$match[1]$match[3] (-$match[1])--$match[2]$match[3]} ) + # All options get {-x+,--long-x=} + args=( ${args/(#b)(--[A-Za-z0-9-]##):arg:/$match[1]=:arg:} ) + args=( ${args/(#b)([^=]):arg:/$match[1]+:arg:} ) if [[ $usage == *REPOS_PATH* ]]; then args+=( ":repository path:_files -/" ) case $cmd in -- cgit v1.2.3