zsh-workers
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: zsh-workers@zsh.org
Cc: Felipe Contreras <felipe.contreras@gmail.com>
Subject: Getting original words after _arguments
Date: Fri, 19 Apr 2013 03:21:08 -0500	[thread overview]
Message-ID: <CAMP44s2UnDQ2TZsWJykVN5c+gNWbQtfQ8hTy_uPk=HdQBiRbfA@mail.gmail.com> (raw)

Hi,

I have a function along these lines:

__test ()
{
	local curcontext="$curcontext" state state_descr line
	typeset -A opt_args
	local -a orig_words

	orig_words=( ${words[@]} )

	_arguments -C '--stuff' && _ret=0

	words=( ${orig_words[@]} )

	# stuff using words
}

I need to have access to the original array of words, before the
_arguments stuff is run, and so far the only I can achieve that is by
manually storing the old ones, and then restoring them.

Is there an easier way? Surely the contents of the command line must
be stored somewhere.

Cheers.

P.S. Please reply-to-all so I stay in the loop.

-- 
Felipe Contreras


             reply	other threads:[~2013-04-19  8:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-19  8:21 Felipe Contreras [this message]
2013-04-20 15:36 ` Bart Schaefer
2013-04-20 20:07   ` Peter Stephenson
2013-04-20 22:03   ` Felipe Contreras
2013-04-21 18:55     ` Bart Schaefer
2013-04-21 20:42       ` Felipe Contreras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMP44s2UnDQ2TZsWJykVN5c+gNWbQtfQ8hTy_uPk=HdQBiRbfA@mail.gmail.com' \
    --to=felipe.contreras@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).