Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Getting original words after _arguments



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



Messages sorted by: Reverse Date, Date, Thread, Author