Created
May 6, 2012 08:59
-
-
Save JakobOvrum/2621155 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example options | |
struct CmdOptions | |
{ | |
/// Print information during execution. | |
bool verbose = false; | |
/// Output name. | |
string outputname = "foo"; | |
} | |
void main(string[] args) | |
{ | |
auto getOptArgs = GetOptArgs(); | |
getOptArgs.programDescription = "This program does X and Y."; | |
getOptArgs.minimumArgs = 1; | |
auto options = getOpt!CmdOptions(getOptArgs, args); | |
/* use args[1], options.verbose, options.outputname etc. */ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment