Parse CLI args into a convenient data structure:
Example:
The schema "d#,b,l*" specifies an int arg -d, a bool arg -b, and a string arg -l
So given args -d10 -b -lINFO
- the arg
-dhas the value10 - the arg
-bhas the valuetrue - the arg
-lhas the value"INFO"
Args args = new Args("-d10 -b -lINFO", new Schema("d#,b,l*"));
// Fetch arg's value
Maybe<int> maybeIntArg = args.Integer("d")
maybeIntArg.HasValue // True
maybeIntArg.Value // 10
// Can't fetch for non existing arg
Maybe<string> maybeStringArg = args.String("p")
maybeStringArg.HasValue // False