[Po4a-devel]Config files enhancement

Nicolas François nicolas.francois@centraliens.net
Wed, 27 Apr 2005 22:05:06 +0200


On Wed, Apr 27, 2005 at 11:32:42AM +0200, Martin Quinson wrote:
> On Sat, Apr 23, 2005 at 03:01:43AM +0200, Nicolas François wrote:
> >    * it is not possible to specify the a value containing a space as =
the
> >      parameter for a module option.
> >      For example, users could use -o "foo=bar baz" on the command l=
ine.
> >      This wont be possible with this implementation.
> >      Any idea on how to fix this is welcome.
> 
> I'm not sure I see in the code were this comes from. I'd like to remove=
 this
> limitation, even if it's not a show stopper.

It is not really an implementation limitation, but a specification issue.
To specify -o foo=bar, an user can use opt:"-o foo=bar" (the quotes are
needed here because of the space between -o and foo=bar.
To specify -o "foo=bar baz", one would like to use opt:"-o "foo=bar baz""
or use some escape for the internal quotes (escape is not supported,
IIRC).

The second issue is that I split the opt: parameter in order to fill the
@ARGV array and simulate what the shell does when somebody specify
-o "foo=bar baz" on the command line.

These issues can/should be fixed, but we should first agree on the syntax
for such cases.
BTW, do you know any Perl module that can split the command line?
(my current split(/ /, command) is really limited;)

> I'll try to write the relevant documentation for this.

It may help: there are some examples in the test suite.

-- 
Nekral