Tuesday, January 27, 2009

Option parsing and documentation

After all this time programming, I am still dissatisfied with every command-line-option parsing and processing module/api/method available.

I've tried dozens in Perl, a handful in Python, a smattering in C, several in Java, and all fail to satisfy me in one or more ways.

The thing I find most dissatisfying is the API and usage of these option parsers. After that it's the ability (or lack thereof) to declare documentation and usage info in the same place where you define your option processing. After that, it's just that nothing seems to have all the features I want in one place.

I won't go into a tirade about everything I've tried and which system has what features and how awful or great each one is... I'll just work on explaining what I think would make up an ideal option parser and then try to lay out some ideas for API and/or implementation.

Example of usage of an option parser I'd like:



Presumably, this module would automagically generate --help output, usage docs, do basic error checking, and even output a man page or HTML or POD.

1 comment:

  1. Of *course* blogspot doesn't have any options for formatting code. /me grumbles

    ReplyDelete

Are you the brain specialist?