On Fri, Apr 15, 2005 at 03:38:08PM +0200, Martin Quinson wrote:
On Fri, Apr 15, 2005 at 01:18:51PM +0200, Jordi Vilalta wrote:
> Hi,
>
> while trying to translate the new website proposal I found the need to add
> module options in the config files (a longstanding limitation of the po4a
> script). A posible solution came to my mind: we could define "module
> aliases". For example, we could define po4aweb to be an alias to the xml
> module with some options:
>
> [po4a_alias: po4aweb] xml -o inline="<a>"
> [type: po4aweb] index.xml $lang:index.xml.$lang
>
> Would it be so difficult to implement it?
What about
[type: xml] index.xml $lang:index.xml.$lang modopt:inline="<a>"
?
It looks a little bit easier to implement.
It has the little drawback that modopt needs to be the last parameter
(it's only a potential drawback for future extension)
It sounds rather simple to implement, too. It would solve the module
option
issue, as long as you don't want to pass different module options for the
different languages.
Passing different module options for the different languages may raise the
same issue as the with_non-breking_spaces option: there is a risk that the
POT will differ from one language to the other.
The schema could be extended a bit for the other cases:
- language specific module option: modopt_fr and friends?
- non-module option such as -k to po4a-translate: no idea. Maybe directly:
[type: xml] index.xml $lang:index.xml.$lang modopt:inline="<a>" -k 40
The attached implementation is really basic. It does not deal with
non-module options. It will also fail if you want to use quotes to specify
a parameter with a space (my_option="parameter with spaces")
Also, modopt has to be the last parameter.
but that's just an idea, I'd prefere to let this simple case
work, play a
bit with it and add other features afterward, when we really need them.
So, lets get it complicated.
Does anybody know about a command line arguments parser in perl?
(I'm not willing to mess with quotes, apostrophes, escaped quotes, ...)
I will give the non-module options a try.
--
Nekral