free hit counter

Monday, February 14, 2005

Parsing Command-Line Options

There's the venerable getopt and linux style getopt_long(), but popt seems to be a nicer version. For applications with argument lists that look like they're for a compiler popt lets you define aliases. However these are all GNU/POSIX routines.

In delphi land the paramlst unit is pretty good, but leads to a cluttered application program.

Seems like there's a WIN32 getopt from Chris Sells, with an attendant .NET port This also has one of my wishes- automatic usage generation.

I think the ideal solution would specify the command line arguments (and here's the big key) and their usage in a separate, spell checkable, file. You could then run a utility on this file to generate the routines for accessing the command line args.

0 Comments:

Post a Comment

<< Home