D port of docopt

Bob Tolbert via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Mon Jun 16 06:31:12 PDT 2014


On Monday, 16 June 2014 at 06:51:41 UTC, Jacob Carlborg wrote:
>
> Pretty cool idea. Are you aware of that in D you can, at 
> compile time, parse the doc string and generate a command line 
> parser for that particular documentation.

I wondered about that, after looking at the compile-time regex
stuff, which is pretty darn cool.

>
> Looking at the git example [1], it seems a bit complicated and 
> verbose to use after parsing. To determine which arguments was 
> passed to the application.
>
> [1] 
> https://github.com/rwtolbert/docopt.d/blob/master/examples/git/gitD.d

While that is true, I'd argue that if you are writing an app with
a command line that complicated, then you have your work cut out
for you no matter what the system is you use.

Bob


More information about the Digitalmars-d-announce mailing list