optparse module

John C johnch_atms at hotmail.com
Fri Apr 14 08:36:32 PDT 2006


Daniel Keep wrote:
> Me again :P
> 
> I found I needed something to dump a file as hex the other day, so
> naturally the first thing I wrote was a command-line argument parser :P
> 
> Here's the preliminary version, and since I can't see anything similar
> in either phobos or on dsource, I thought I'd post it up here to see if
> anyone thinks I should try getting it online somewhere.

I was looking for a command-line parser just yesterday. Searching the 
newsgroups, I found this: 
http://www.digitalmars.com/d/archives/digitalmars/D/announce/553.html

It's called ... er ... optparse ... just like yours. I guess after the 
Python library?

> 
> So comments, criticisms and suggestions all welcome.  The archive
> contains the module itself, a module to fix the problem with std.boxer,
> and a test program.  It builds just fine with either
> 
> $ build optparse_test
> 
> or
> 
> $ dmd optparse_test.d optparse.d dmdbug_std_boxer_assert.d
> 
> So let me know what you think.  And thanks for all the help with getting
> this to work :)
> 
> 	-- Daniel
> 

I'll have to try it out. Looks promising. Is there support for "/"-style 
options as well as the GNU/POSIX syntax?



More information about the Digitalmars-d mailing list