On Sat, Apr 23, 2005 at 03:01:43AM +0200, Nicolas François wrote:
Hello,
Here is an update of the patch.
It now deals with module aliases, with the ability to set global option
for this alias, or options for a language:
[po4a_alias:test] man opt="-k 0" opt_fr="-o debug -L ISO-8859-1"
Options can also be specified in a [type:...] line.
[type:test] chsh.1 fr:chsh.1.fr opt_fr:"-L UTF-8"
Limitations/known bugs:
* I don't know how options are overwritten.
(What should happen when the user specify -k 0 on the command line,
with -k 10 for the alias, -k 20 for the alias with lang=fr, -k 30 as
the file option, and -k 40 as the file option for lang=fr?)
* options have to be the last parameters on the line
(this limitation could be removed quite easily)
* 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 line.
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.
I'm considering committing it Saturday for the next release if
you don't
stop me before.
I'm glad nobody stopped you (I was away), it'a very good stuff as usual.
It should be safe when options are not used, but options did not get
a lot
of testing (and it has a great chance to have some bugs). Maybe it will
be an hidden/undocumented feature.
The patch mostly consists in:
* using an hash for the options (and a sub-hash for options passed to
the modules (-v, -d, -o).
* a function to fill this hash
* a function to separate
* aliases handling (an hash contains for each alias, the target module,
and the hash of options for this module)
I'll try to write the relevant documentation for this.
Thanks for your time,
Mt.