flags
flags copied to clipboard
Argument validation + shortcuts
Now that there are some basic unit tests, flag validation and multiple arguments should be added.
Currently thinking of a syntax similar to:
const flags::args args(argc, argv);
if (const auto opt = args.get_multiple<bool>("flag", "f", "no-flag", "other")) {
const auto [argument, value] = *opt;
// do something -- *argument will be the first of "flag", "f", or "no-flag" that matched
// and *value will be its value.
}
for multiple arguments.
Great library! Any update on defining short and long flags at the same get method? Currently I do:
const auto help = args.get
would be nice to replace that like so:
const auto help = args.get
Anyway great work! Small executables and not much overhead!