[augeas-devel] Re: Multiline values in INI Files
Raphaël Pinson
raphink at gmail.com
Fri Aug 29 15:44:30 UTC 2008
On Fri, Aug 29, 2008 at 5:37 PM, Free Ekanayaka <free at 64studio.com> wrote:
> Hi Raphaël,
>
> |--==> On Fri, 29 Aug 2008 13:42:05 +0200, "Raphaël Pinson" <
> raphink at gmail.com> said:
>
> >>
> >>If introducing ugly _noindent declarations is the only viable way at
> >>the moment, but it makes inifile.aug enough flexible to deal with all
> >>kind of INI files, then I would go for it. Of course Better
> >>alternatives are welcome.
> >>
>
> RP> Just saw another reason for not introducing indent in inifile.aug :
> some
> RP> inifiles use indentation for multi-line values, like
>
>
> RP> key = this is a long
> RP> text that belongs
> RP> to the same field
>
>
> RP> This kind of entries are very tricky to deal with (this is why I
> haven't put
> RP> my hands on it yet) because ideally we would like to get
>
> RP> { "key" = "this is a long\ntext that belongs\nto the same field" }
>
>
> RP> but all I can think of getting is
>
> RP> { "key"
> RP> { "1" = "this is a long" }
> RP> { "2" = "text that belongs" }
> RP> { "3" = "to the same field" } }
>
> RP> or
>
> RP> { "key" = "this is a long\n text taht belongs\n to the same field"
> }
>
>
> RP> which forces users to indent their value in a not very useful way.
> RP> Furthermore, I believe adding a line to such a field should use the
> same
> RP> indentation as the previous lines, which is currently not possible in
> RP> augeas.
>
> I see your point, I think I have no other option than cloning
> inifile.aug then, and possibly wait for this kind of issues to get
> eventually fixed.
>
Well you can clone the minimal parts of the lenses that you need to refine.
This is what I do in mysql.aug for example (see patch from a few hours ago)
since I need to support flags aswell as key/value pairs.
++
Raphaël
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20080829/b54a8ef4/attachment.htm>
More information about the augeas-devel
mailing list