www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Command Line Parsing

reply Russel Winder via Digitalmars-d-learn <digitalmars-d-learn puremagic.com> writes:
Are Argon https://github.com/markuslaker/Argon or darg  https://github.
com/jasonwhite/darg getting traction as the default command line
handling system for D or are they just peripheral and everyone just
uses std.getopt https://dlang.org/phobos/std_getopt.html ?


--=20
Russel.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder ekiga.n=
et
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
Apr 12 2017
next sibling parent rikki cattermole <rikki cattermole.co.nz> writes:
On 12/04/2017 10:51 AM, Russel Winder via Digitalmars-d-learn wrote:
 Are Argon https://github.com/markuslaker/Argon or darg  https://github.
 com/jasonwhite/darg getting traction as the default command line
 handling system for D or are they just peripheral and everyone just
 uses std.getopt https://dlang.org/phobos/std_getopt.html ?
std.getopt is a little clunky, but it is what I would prefer most of the time. They are basically just different ways to do the same exact thing. So most of the time it is simply a preference thing.
Apr 12 2017
prev sibling next sibling parent reply Nicholas Wilson <iamthewilsonator hotmail.com> writes:
On Wednesday, 12 April 2017 at 09:51:34 UTC, Russel Winder wrote:
 Are Argon https://github.com/markuslaker/Argon or darg  
 https://github. com/jasonwhite/darg getting traction as the 
 default command line handling system for D or are they just 
 peripheral and everyone just uses std.getopt 
 https://dlang.org/phobos/std_getopt.html ?
there is also Vladimir Panteleev's ae.funopt https://blog.thecybershadow.net/2014/08/05/ae-utils-funopt/ https://github.com/CyberShadow/ae/blob/master/utils/funopt.d
Apr 12 2017
parent ChrisPiker <fake noplace.org> writes:
On Wednesday, 12 April 2017 at 10:58:07 UTC, Nicholas Wilson 
wrote:
 On Wednesday, 12 April 2017 at 09:51:34 UTC, Russel Winder 
 wrote:
 Are Argon https://github.com/markuslaker/Argon or darg  
 https://github. com/jasonwhite/darg getting traction as the 
 default command line handling system for D or are they just 
 peripheral and everyone just uses std.getopt 
 https://dlang.org/phobos/std_getopt.html ?
there is also Vladimir Panteleev's ae.funopt https://blog.thecybershadow.net/2014/08/05/ae-utils-funopt/ https://github.com/CyberShadow/ae/blob/master/utils/funopt.d
Thanks for mentioning this, looks to be just what the doctor ordered. Coming in from python I've been disappointed by getopt and frustrated by Argon. This looks like it might fit the bill. Meta-names for option arguments ( ex: --index=FILE ) are an efficient way to communicate intent to users, nice to see them included. Thanks,
Jan 26 2018
prev sibling next sibling parent Basile B. <b2.temp gmx.com> writes:
On Wednesday, 12 April 2017 at 09:51:34 UTC, Russel Winder wrote:
 Are Argon https://github.com/markuslaker/Argon or darg  
 https://github. com/jasonwhite/darg getting traction as the 
 default command line handling system for D or are they just 
 peripheral and everyone just uses std.getopt 
 https://dlang.org/phobos/std_getopt.html ?
std.getopt always, also since a few weeks i think that a better version could be done. The expected options are defined in a run-time parameters. This can definitively be some template parameters, which would allow complex static checks and more optimal code. Now: GetOptResult r = getopt(args, "o|option", &o, "p|param", &param); The future: GetOptResult r = getopt!("o|option", o, "p|param", param))(args);
Apr 12 2017
prev sibling parent Jon Degenhardt <jond noreply.com> writes:
On Wednesday, 12 April 2017 at 09:51:34 UTC, Russel Winder wrote:
 Are Argon https://github.com/markuslaker/Argon or darg  
 https://github. com/jasonwhite/darg getting traction as the 
 default command line handling system for D or are they just 
 peripheral and everyone just uses std.getopt 
 https://dlang.org/phobos/std_getopt.html ?
I use std.getopt in my tools. Overall it's pretty good, and the reliability of a package in the standard library has value. That said, I've bumped up against it's limits, and looking at the code, it's not clear to how extend it to more advanced use cases. There may be a case for introducing a next generation package. --Jon
Apr 15 2017