bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Command line parsing with genparse


From: Michael Geng
Subject: Command line parsing with genparse
Date: Tue, 18 Dec 2007 21:48:16 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

Hi,

I added a new patch which shows how to use genparse for generating the command
line parsing code for the tail, ls and wc commands. 

If you haven't heard about genparse yet, please have a look at the project home
page at http://genparse.sourceforge.net/.

This version treats the -w / --width and -T / --tabsize command line arguments
of the ls command as ulong arguments so that the string-to-integer conversion 
code is also auto generated now. These 2 arguments need some special treatment
because in the case of an error the string argument is passed to a quotearg
function before it is printed. Genparse version 0.7.3 can handle this. You 
can have a look at the genparse generated files on the examples page which
is accessible from the genparse home page.

The main effort on this genparse version was adding new tests however. I'm 
still impressed from the amout of tests in the coreutils project and I now 
added similar script based tests to genparse. Adding these tests was required 
especially because most of the extensions I added since I have been testing
genparse on the coreutils were about the usage function which had almost no
testing before.

Additionally I upgraded genparse with newer versions of automake, autoconf, 
gnulib and java tools.

The attached patch applies to the git version of the coreutils of today. I 
verified that make distcheck succeeded.

Michael

Attachment: genparse-ls-tail-wc-6.9.91.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]