Filename of the config file
Command line arguments provided through main(string[] args)
Config exclusive argument array
struct MyConfig { @Desc("My cool number.") int number; @Desc("Print verbose messages.") bool verbose = false; } int main(string[] args) { string[] configArgs = getConfigArguments!MyConfig("myconfig.conf", args); import std.stdio : writeln; writeln(configArgs); }
Assume we have a myconfig.conf file that contains the following options:
; My cool number. number=5 ; Print verbose messages. verbose=true
alling the above program without any arguments: ./myapp will print: ["--number", "5", "--verbose", "true"].
Calling the program with a given argument: ./myapp --number=12 will print: ["--verbose", "true"]. You can see that our provided --number=12 has been excluded.
Creates an argument array that contains the options provided in the config file.
The resulting array contains all provided and valid options excluding ones that were provided through the command line. The template ConfigType is the plain old data struct that describes the options that are read from the config filename.