* [PATCH] Fix inaccuracies in _brace_parameter completion wording
@ 2017-10-07 7:44 dana
2017-10-07 20:50 ` Oliver Kiddle
0 siblings, 1 reply; 2+ messages in thread
From: dana @ 2017-10-07 7:44 UTC (permalink / raw)
To: zsh-workers
[-- Attachment #1: Type: text/plain, Size: 1639 bytes --]
The _brace_parameter completion function indicates that the expansion flags
B, E, M, and R can be used with the ${foo/bar/baz} syntax. According to the
documentation (zshexpn), this is not so:
The following flags are meaningful with the ${...#...} or ${...%...} forms.
> The S and I flags may also be used with the ${.../...} forms.
>
Testing and a brief glance at the source seem to confirm this, though my C
is not great — please let me know if i'm mistaken.
Credit to psprint in #zsh for discovering the wording problem.
dana
diff --git a/Completion/Zsh/Context/_brace_parameter
b/Completion/Zsh/Context/_brace_parameter
index f22db8895..b119ccd11 100644
--- a/Completion/Zsh/Context/_brace_parameter
+++ b/Completion/Zsh/Context/_brace_parameter
@@ -178,11 +178,11 @@ if [[ $PREFIX = *'${('[^\)]# ]]; then
# "_:extended flags, for future expansion"
"S:search substrings in #, %, / expressions"
"I:search <argument>th match in #, %, / expressions"
- "B:include index of beginning of match in #, %, / expressions"
- "E:include index of one past end of match in #, %, / expressions"
- "M:include matched portion in #, %, / expressions"
+ "B:include index of beginning of match in #, % expressions"
+ "E:include index of one past end of match in #, % expressions"
+ "M:include matched portion in #, % expressions"
"N:include length of match in #, % expressions"
- "R:include rest (unmatched portion) in #, %, / expressions"
+ "R:include rest (unmatched portion) in #, % expressions"
)
_describe -t flags "parameter flag" flags -Q -S ''
return
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix inaccuracies in _brace_parameter completion wording
2017-10-07 7:44 [PATCH] Fix inaccuracies in _brace_parameter completion wording dana
@ 2017-10-07 20:50 ` Oliver Kiddle
0 siblings, 0 replies; 2+ messages in thread
From: Oliver Kiddle @ 2017-10-07 20:50 UTC (permalink / raw)
To: dana; +Cc: zsh-workers
dana wrote:
> The _brace_parameter completion function indicates that the expansion flags
> B, E, M, and R can be used with the ${foo/bar/baz} syntax. According to the
> documentation (zshexpn), this is not so:
Thanks for this. I've applied the patch.
Looking at that function the description for :? also looks wrong - the
sense is inverted.
Oliver
diff --git a/Completion/Zsh/Context/_brace_parameter b/Completion/Zsh/Context/_brace_parameter
index f22db8895..e1e9adc41 100644
--- a/Completion/Zsh/Context/_brace_parameter
+++ b/Completion/Zsh/Context/_brace_parameter
@@ -195,7 +195,7 @@ elif compset -P '*:'; then
'+:substitute alternate value if parameter is non-null'
'=:substitute and assign alternate value if parameter is null'
'\:=:unconditionally assign value to parameter'
- '?:print error if parameter is set and non-null'
+ '?:print error if parameter is null'
'#:filter value matching pattern'
'/:replace whole word matching pattern'
'|:set difference'
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-10-07 20:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-07 7:44 [PATCH] Fix inaccuracies in _brace_parameter completion wording dana
2017-10-07 20:50 ` Oliver Kiddle
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).