Re: [PATCH] config: Add --quoted option to produce machine-parsable output
- From
Frank Lichtenheld <frank@lichtenheld.de>
- Date
- May 21, 2007, 20:58 UTC
- Message-ID
- <20070521205812.GO4085@planck.djpig.de>
- In-Reply-To
- <20070521195423.GC5082@efreet.light.src>
On Mon, May 21, 2007 at 09:54:23PM +0200, Jan Hudec wrote:
Show 10 quoted lines
> On Mon, May 21, 2007 at 19:46:59 +0200, Frank Lichtenheld wrote:
> > This option will enclose key names in quotes (") if they
> > contain a subsection and then escape " and \. It will also
> > escape line breaks in values. Together this should produce
> > an easily parsable output.
>
> That will lead to either eval (which runs perl parser and probably won't win
> anything) or regexps (which is not big win over parsing the .ini directly
> with them) on the perl side. IMHO only thing that would actually be faster is
> NUL-separated entries.Show 5 quoted lines
> Either: > KEY <NUL> VALUE <NUL> > > or: > KEY <TAB> VALUE <NUL>
Both subsection names and values can contain <TAB> characters, so the latter isn't possible.
Gruesse,
-- Frank Lichtenheld <frank@lichtenheld.de> www: http://www.djpig.de/