[Po4a-devel]Config files enhancement

Martin Quinson martin.quinson@loria.fr
Wed, 27 Apr 2005 11:32:42 +0200


--zS7rBR6csb6tI2e1
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Apr 23, 2005 at 03:01:43AM +0200, Nicolas Fran=E7ois wrote:
> Hello,
>=20
> Here is an update of the patch.
>=20
> 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=3D"-k 0" opt_fr=3D"-o debug -L ISO-8859-1"
>=20
> Options can also be specified in a [type:...] line.
> [type:test] chsh.1 fr:chsh.1.fr opt_fr:"-L UTF-8"
>=20
> 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=3Dfr, -k 30 =
as
>      the file option, and -k 40 as the file option for lang=3Dfr?)
>    * 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=3Dbar 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.
>=20
> 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.

--zS7rBR6csb6tI2e1
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFCb1w6IiC/MeFF8zQRAsYKAJ9udFVWzF0qX7aj1Zfaur6FMZV1QQCdH6D0
K1e/m9fgTB/dPIlQq/sy3lM=
=iJVD
-----END PGP SIGNATURE-----

--zS7rBR6csb6tI2e1--