zsh-workers
 help / color / mirror / code / Atom feed
* _call_program (and possibly other hooks) or opt_args quoting prob lem.
@ 2002-05-16 16:32 Borsenkow Andrej
  2002-05-17 18:39 ` Bart Schaefer
  0 siblings, 1 reply; 8+ messages in thread
From: Borsenkow Andrej @ 2002-05-16 16:32 UTC (permalink / raw)
  To: 'Zsh hackers list'

_call_program evals its argument(s). It creates very interesting problem -
we want to quote word separator _but_ we do not want to quote possible
parameter expansions ... to illustrate:

trying to complete

info -d $PWD/a\ b TAB

you either do not quote value of option -d, getting

+_call_program:12> eval info -d $PWD/a b --output -

wrong because it splits filename

or you do quote value of option -d getting

+_call_program:12> eval info -d \$PWD/a\ b --output -

which is wrong as well because it does not expand $PWD.

The problem seems to actually be in how _arguments stores values of options.
It seems to remove all quotes from them, but then, we cannot quote them back
reliably. It really looks like _argument should save word(s) from command
line verbatim and left to user to decide when values need to be dequoted.

OTOH it means that user possibly must pass values via eval every time ...
horrors. Just assume we need real directory name ... [ -d ${opt_args[-d]} ]
would be totally wrong.

-andrej


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-05-23 12:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-16 16:32 _call_program (and possibly other hooks) or opt_args quoting prob lem Borsenkow Andrej
2002-05-17 18:39 ` Bart Schaefer
2002-05-18 11:24   ` Borsenkow Andrej
2002-05-20 16:40     ` Bart Schaefer
2002-05-20 17:43       ` Borsenkow Andrej
2002-05-21  8:14         ` Sven Wischnowsky
2002-05-21 16:17           ` Bart Schaefer
2002-05-23 12:20             ` Sven Wischnowsky

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