Boost logo

Boost :

From: Gary Powell (powellg_at_[hidden])
Date: 2001-11-16 16:52:17


>>
It occurs to me that even in the simplest cases, the programmer probably
needs to write the "usage" output which responds to --help or incorrect
options. A truly easy-to-use interface would read and interpret the "usage"
text, so that the programmer hardly needs to do anything else. I have no
idea how feasible that is...
<<
I have a copy of an old UNIX(tm) Review article that did this in "C", the
usage statement was part of the argument structure which was passed to the
parser. The theory being that by creating a "flag" you would specify the
prefix if any, ("-", "--" etc.), a short description, and a verbose one. And
there was a special type for "help" so that help flag gave the verbose
statement, plain "help" gave the concise description. I could dig up the
reference, but it sounds to me folks are on the same track already. (Be sure
to pass in a argument verifier callback so that users of the library can
validate the argument.)

I also had one a long time ago that could handle flag dependencies as well,
not that I would design such a user interface but it was flexible and did
fix the problem of the day. (if you specify flag "a" you must specify flag
"b", etc.)

And I agree, XML is probably overkill, but then again I need the ability to
vary the output based on locale. (ick!)

  Yours,
 -gary-


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk