zsh-workers
 help / color / mirror / code / Atom feed
* e subscript flag
@ 2010-05-31  9:25 Mikael Magnusson
  0 siblings, 0 replies; only message in thread
From: Mikael Magnusson @ 2010-05-31  9:25 UTC (permalink / raw)
  To: zsh workers

I noticed that e is not offered on $a[( tabcompletion, so here's a
patch for that, and this section in the man page:

  To match the value of a parameter literally in a reverse subscript,
rather than as a  pat-
  tern, use `${(q)name}' (see zshexpn(1)) to quote the expanded value.

Would it be better to offer [(e)$name] here? (or both)

diff --git a/Completion/Zsh/Context/_subscript
b/Completion/Zsh/Context/_subscript
index 39bdced..31da97e 100644
--- a/Completion/Zsh/Context/_subscript
+++ b/Completion/Zsh/Context/_subscript
@@ -59,6 +59,7 @@ elif compset -P '\('; then
       '(r R k i I)K[all values where subscript matched by key as pattern]'
       '(r R k K I)i[any one key matched by subscript as pattern]'
       '(r R k K i)I[all keys matched by subscript as pattern]'
+      'e[interpret * or @ as a single key]'
     );;
     (|scalar*)) flags=(
       'w[make subscripting work on words of scalar]'
@@ -66,6 +67,7 @@ elif compset -P '\('; then
       'p[recognise escape sequences in subsequent s flag]'
     );&
     array*) flags=($flags
+      'e[interpret * or @ as a single key and use plain string matching]'
       'n[Nth lowest/highest index with i/I/r/R flag]'
       'b[begin with specified element]'
       '(r R k K i)I[highest index of value matched by subscript]'


-- 
Mikael Magnusson


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-05-31  9:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-31  9:25 e subscript flag Mikael Magnusson

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).