TLINDEN / Config-General

Generic perl config file parser module
1 stars 1 forks source link

Quotation for values containing whitespace (eg. Unix shell variable assignments) #1

Open rwp0 opened 2 years ago

rwp0 commented 2 years ago

Thank you for this module, it's useful as a general-purpose config parser. I especially like the ::Extended interface.

One thing I noticed, it doesn't preserve the quotes around values even while all the values are having quotes.

For example, parsing FreeBSD rc.conf file which is basically Bourne shell value-to-variable assignments:

apache24_flags="-f /usr/local/apache/conf/httpd.conf"
static_arp_pairs="gwint gwpub"

The module removes the double quotation marks leaving this snippet as:

apache24_flags=-f /usr/local/apache/conf/httpd.conf
static_arp_pairs=gwint gwpub

Which makes the Unix shell fail to read them.

It could be useful if we had an option switch passed to the new method in order to quote all values, let's say as -QuoteValues=1.

We can also have -QuoteType as double ("") or single (''), but that's extra.

Thanks

TLINDEN commented 2 years ago

Hi,

this is indeed a great idea. I'll look into it as soon I find the time.

rwp0 commented 2 years ago

Hi,

this is indeed a great idea. I'll look into it as soon I find the time.

Thanks.

rwp0 commented 11 months ago

Has there been any progress on this since?

TLINDEN commented 11 months ago

Sorry, not yet...