Skip to content

Argument validation + shortcuts #4

@sailormoon

Description

@sailormoon

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.

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions