Re: Patch to improve generation of edition and validation tool for /etc/LCDd.conf
Markus Dolze <[email protected]>
| Newsgroups | gmane.comp.sysutils.lcdproc |
|---|---|
| Message-ID | <[email protected]> |
On 23.10.2011 17:58, Dominique Dumont wrote: > Le Thursday 21 July 2011 22:45:23, Markus Dolze a écrit : >> On 20.07.2011 18:38, Dominique Dumont wrote: >>> Can I propose patches to improve LCDd.conf comments in this way ? >> Hello, >> >> yes, please do so. > Hello > > Here are 2 patches against CVS head to improve the generation of a > configuration editor for lcdproc. [1] > > The first patch (comments) modifies a few comments to: > - put documentation before the lines used to generate parameters. > - avoid parameter duplication in configurartion tools > > The second patch (fix-square-brackets) modifies the content of doc declared > between square brackets to make them usable by the configuration > generator. Unparsable user information was moved outside the brackets. > I've taken care not to remove information. > > Except in the following ambiguous line: > > [default: true (= pixel addressable); legal: yes, no] > > In this case, "true" is not in the list of legal parameters. So I've removed > "legal: yes, no". I hope this is right > > All the best > > Dominique > Hello Dominique, while working on lcdproc today I thought about your ideas and your config editor (which I think is great) and how we can help you. I don't like the idea of putting regex code into LCDd.conf as the file still is hand-edited by many users. I believe regular expression may confuse our users even more. One idea I had was to generate LCDd.conf from another file that could be easily parsed by Config::model upon 'make'. But this requires some tool that can easily be integrated into the autotools chain without adding too 'heavy' external programs / libraries (e.g. Perl or Python). I admit that I don't have enough knowledge about this. If the patches you sent help you with config editor I'm happy to commit them (probably changing the lastline stuff). One thing to keep in mind is that "yes", "true", "y", "on" and "1" all have the same meaning within LCDd.conf. Instead of "lastline=true" we can also write "lastline=yes" or "lastline=on" and all are valid. The same accounts for "no", "false", "n", "off" and "0". Your parser should account for that, especially if it reads an already existing file. Are the spaces between "#" and the key really required as seen in "comments" patch? Regards Markus