Command line arguments. Changes while the function is running.
Parameter with "--".
Synonym for the flat. By default, empty.
array of values after the flag.
string[] args = "app -a value1 value2 -b parameter --nothing".split; assert(["value1", "value2"] == getOptionRange(args, "-a")); assert(["parameter"] == getOptionRange(args, "-b")); string[] nothing = getOptionRange(args, "--nothing"); assert(nothing.empty); args = "app --alt value1 value2 -b parameter --nothing".split; assert(["value1", "value2"] == getOptionRange(args, "-a", "--alt")); args = "app -a -b thing".split; string[] vacuum = getOptionRange(args, "-a"); assert(vacuum.empty); args = "app -a value1 value2 -b parameter --nothing".split; assert("value1 value2".split == extractOptionRange(args, "-a")); assert("app -b parameter --nothing".split == args); args = "-a value1 value2 -b parameter --nothing".split; assert("value1 value2".split == extractOptionRange(args, "-a")); assert("-b parameter --nothing".split == args);
Function for extracting of value as array by flag. Unlike getOptionRange(), this function changes the passed arguments (args), removing the flag with a value.