On 8/31/13 4:21 AM, Jacob Carlborg wrote:
On 2013-08-30 20:19, Ramon wrote:

Thanks for the information and your thoughts. I'd like to ask one
more question on that, as I happened to work a little with
phobos' getopt and looked at your code and happened to notice
(your use of) tangos arg parsing/handling:
Why do you consider tangos arg parsing being better? Could you
kindly elaborate that somewhat? (Because I, possibly due to my
newbness, failed to see striking advantages in tangos arg parsing
when looking at Dstep).

I think the Tango version is more flexible and has more features.

With the Tango argument parser you can:

* Restrict values
* Specify the min and max number of arguments a given flag need to have
* Aliases
* Default value
* Conflict handling

Haven't seen Tango's arguments parser, but it's a given getopt can be improved in any number of ways. Yet the way I see it, with command line parsing, the margin between a good enough argument parser and a terrific one is razor thin. One parses arguments by definition once in every program, and things like checking against limits and constraints across multiple arguments can be easily done after basic parsing.

The Phobos version accepts weird syntax's like:

--t 4

Only if you tell it to!


Andrei

Reply via email to