Command-line arguments

Bill Baxter dnewsgroup at billbaxter.com
Thu Jul 3 18:32:09 PDT 2008


Jarrett Billingsley wrote:
> "Matt" <no-one at none.nowhere.com> wrote in message 
> news:g4jqum$269v$1 at digitalmars.com...
>> Is there an established library in D for handling command-line arguments?
>>
>> In particular:
>> - handling differences between Windows and UNIX shells (i.e. wildcard 
>> expansion)
>> - handling equivalent options such as "-n 10" === --count=10
>> - handling combination of multiple flags, e.g. "-lcf" == "-l -f -c"
>>
>> Thanks
>>
>> Matt
> 
> I don't believe there is an argument parser in either Phobos 1 or Phobos 2. 
> However, there is one in Tango. 
> 
> 

doost has one that works with Phobos. (http://dsource.org/projects/doost)

D2/Phobos2 has std.getopt.

There's a port std.getopt to D1 in the std2 project: 
http://www.dsource.org/projects/std2

There's a simple port of BSD's getopt in OpenMesh/D:
http://www.dsource.org/projects/openmeshd/browser/trunk/OpenMeshD/OpenMesh/Tools/Utils/getopt.d

--bb




More information about the Digitalmars-d mailing list