The array of arguments provided in main().
Optional option formatter.
std.getopt.GetoptException if parsing fails.
struct MyOptions { @ShortName( 'v' ) bool verbose; } void main( string[] args ) { import std.stdio; auto parsed = args.parseArgs!MyOptions; writelfn( "is verbose? %s", parsed.verbose ? "yes" : "no" ); }
Copyright © 2019, Tony J. Hudgins
MIT
Use std.getopt.getopt to parse command-line arguments into a class or struct.
This function automatically invokes the constructor for the class or struct and requires a public, parameterless constructor to work. Does not take opCall() into account for classes.
The caller can optionally provide an OptionFormatter delegate to format options into a prett-printed string to display on the help screen. If no delegate is provided the default std.getopt.defaultGetoptFormatter function will be used as a fallback.
Automatically prints the help text and exits the process when help is requested.