1 module dsemver.options; 2 3 import std.typecons : Nullable, nullable, Tuple, tuple; 4 import args; 5 6 struct Options { 7 //@Arg('p', Optional.no, 8 @Arg('p', "The path to the project the SemVer should be calculated for") 9 string projectPath; 10 11 @Arg('o') 12 string old; 13 14 @Arg('n') 15 string neu; 16 17 @Arg('t') 18 string testParse; 19 20 @Arg('l', "Compute the interface of the latest git tag as reference") 21 bool buildLastestTag; 22 23 @Arg('c', "Compute the next version number") 24 bool buildNextSemVer; 25 26 @Arg('v', "Enable verbose output") 27 bool verbose; 28 } 29 30 ref const(Options) getOptions() { 31 return getWritableOptions(); 32 } 33 34 ref Options getWritableOptions() { 35 static Options ret; 36 return ret; 37 } 38 39 void getOptOptions(ref string[] args) { 40 import core.stdc.stdlib : exit; 41 bool helpWanted = parseArgsWithConfigFile(getWritableOptions(), args); 42 if(helpWanted) { 43 printArgsHelp(getOptions(), "A text explaining the program"); 44 exit(0); 45 } 46 }