www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - getopt that automatically prints usage

reply "Igor Lesik" <curoles yahoo.com> writes:
I like how boost program_options library allows to keep together options and 
the help strings and automatically generate help message. So I did something 
similar by writing a wrapper around std.getopt.getopt that automatically 
generates help/usage message; just would like to share it; may be something 
like that could be added into std.getopt in future.

here is an example and code: http://www.curoles.com/j/getoptex.html 
Feb 07 2010
parent Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> writes:
Igor Lesik wrote:
 I like how boost program_options library allows to keep together options and 
 the help strings and automatically generate help message. So I did something 
 similar by writing a wrapper around std.getopt.getopt that automatically 
 generates help/usage message; just would like to share it; may be something 
 like that could be added into std.getopt in future.
 
 here is an example and code: http://www.curoles.com/j/getoptex.html 
Beautiful. Thanks Igor. I created this report so I don't forget to add your code: http://d.puremagic.com/issues/show_bug.cgi?id=3780 When I get to it I'll integrate your code and add your name to the authors. I wanted to add such functionality for a long time, but I didn't think it will be this easy. Your solution is very elegant. Andrei
Feb 07 2010