Command-line arguments

Sean Kelly sean at invisibleduck.org
Fri Jul 4 07:52:51 PDT 2008


== Quote from Jarrett Billingsley (kb3ctd2 at yahoo.com)'s article
> "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.

Tango actually has two right now.  tango.util.ArgParser is the original one,
which uses callbacks to process arguments.  There's also a newer one at
tango.util.Arguments which is a bit simple to use.  It basically just exposes
the arguments via opIndex, much like an AA.


Sean



More information about the Digitalmars-d mailing list