|
| C_EZArgs (const std::string &description={}) |
|
| C_EZArgs (const C_EZArgs &)=delete |
|
C_EZArgs & | operator= (const C_EZArgs &)=delete |
|
C_EZArgs & | add_flag (std::string_view name, char short_name, std::string_view description, std::invocable<> auto &&trigger, std::invocable< std::string_view > auto &&parse) |
|
C_EZArgs & | add_flag (std::string_view name, char short_name, std::string_view description, std::invocable<> auto &&trigger) |
|
C_EZArgs & | add_flag (std::string_view name, char short_name, std::string_view description, std::invocable< std::string_view > auto &&parse) |
|
C_EZArgs & | add_flag (std::string_view name, std::string_view description, std::invocable<> auto trigger, std::invocable< std::string_view > auto &&parse) |
|
C_EZArgs & | add_flag (std::string_view name, std::string_view description, std::invocable<> auto &&trigger) |
|
C_EZArgs & | add_flag (std::string_view name, std::string_view description, std::invocable< std::string_view > auto &&parse) |
|
C_EZArgs & | add_flag (char short_name, std::string_view description, std::invocable<> auto &&trigger, std::invocable< std::string_view > auto &&parse) |
|
C_EZArgs & | add_flag (char short_name, std::string_view description, std::invocable<> auto &&trigger) |
|
C_EZArgs & | add_flag (char short_name, std::string_view description, std::invocable< std::string_view > auto &&parse) |
|
C_EZArgs & | add_subcommand (const std::string &name, std::invocable<> auto onParsed, const std::string &description={}) |
|
void | details (std::string_view s) |
|
C_EZArgs & | position_args (const std::ranges::forward_range auto &arg_names, const std::ranges::forward_range auto &count_optionals, bool unlimited=false) |
|
C_EZArgs & | position_args (const std::ranges::forward_range auto &arg_names, bool unlimited=false) |
|
C_ErrorOrIndex | parse (std::integral auto argc, const char *const argv[]) const |
|
auto | parsed_position_argc () const |
|
C_EZArgs
is an argument parser which lays out either subcommands or positional arguments, but not both.
- Every subcommand is again an argument parser, and hence follows rule 1.
- Rules about flags:
- Flags (-x, –xxx) always come after all subcommands and positional arguments. (This one may be loosen in the future)
- Flag with value may be given as either
–flag=value
or –flag value
- Adding a flag with both
trigger
and parse
callbacks means the flag has an optional value.
- The 9
add_flag()
overloaded methods facilitate defining new flags without any optional arguments:
- It is ok to call without either
name
or short_name
, but not both;
- It is ok to call without either
trigger
or parse
, but not both;
- Always call with
description
- Behaviour of adding duplicate subcommands or flags of the same name is undefined.
- Examples
- parsergen/ParserGen/GrammarStrip.cpp, parsergen/ParserGen/main.cpp, parsergen/ScannerGen/main.cpp, test/smoke_ezargs.cpp, and test/test_ezargs.cpp.
Definition at line 37 of file EZArgs.h.