![]() |
MaCh3
2.8.0
Reference Guide
|
Extended ArgumentParser with MaCh3-specific functionality. More...
#include <CLI/API/m3argparse.hpp>
Public Member Functions | |
| virtual | ~MaCh3ArgumentParser ()=default |
| const std::string | name () const |
| Get the name of this parser/subcommand. More... | |
| const std::string & | description () const |
| Get the description of this parser/subcommand. More... | |
| const std::list< std::reference_wrapper< ArgumentParser > > & | subparsers () const |
| Get the list of registered subparsers. More... | |
| const MaCh3ArgumentParser & | get_subcommand_used () const |
| Get the subcommand that was used in parsing. More... | |
| std::vector< std::string > | get_long_option_names () const |
| Return all long option names (–xxx) registered with this parser. More... | |
| bool | option_takes_value (const std::string &name) const |
| Return true if the named option expects a value (not a flag) More... | |
| std::vector< std::string > | get_completions (const std::string &prefix, const std::vector< std::string > &context) const |
| Complete subcommands or long options at any depth without parsing incomplete arguments. More... | |
| void | set_default_subcommand (const std::string &name) |
| Set a subcommand to use when none of the registered subcommands is given. More... | |
| void | insert_default_subcommands (std::vector< std::string > &args, std::size_t pos=0) const |
| Insert default subcommands into args where no explicit subcommand was given. More... | |
Private Attributes | |
| std::string | m_default_subcommand |
Extended ArgumentParser with MaCh3-specific functionality.
This class extends the standard ArgumentParser to provide additional methods for accessing parser name, subparsers, and tracking which subcommand was used.
Definition at line 17 of file m3argparse.hpp.
|
virtualdefault |
|
inline |
Get the description of this parser/subcommand.
Definition at line 30 of file m3argparse.hpp.
|
inline |
Complete subcommands or long options at any depth without parsing incomplete arguments.
Definition at line 75 of file m3argparse.hpp.
|
inline |
Return all long option names (–xxx) registered with this parser.
Definition at line 56 of file m3argparse.hpp.
|
inline |
Get the subcommand that was used in parsing.
Recursively traverses the subparser hierarchy to find the deepest subcommand that was actually invoked.
Definition at line 46 of file m3argparse.hpp.
|
inline |
Insert default subcommands into args where no explicit subcommand was given.
| args | Full argument list |
| pos | Index in args of this parser's own name (0 for the program itself) |
Definition at line 132 of file m3argparse.hpp.
|
inline |
Get the name of this parser/subcommand.
Definition at line 24 of file m3argparse.hpp.
|
inline |
Return true if the named option expects a value (not a flag)
Definition at line 66 of file m3argparse.hpp.
|
inline |
Set a subcommand to use when none of the registered subcommands is given.
| name | Name of the default subcommand |
Definition at line 125 of file m3argparse.hpp.
|
inline |
Get the list of registered subparsers.
Definition at line 36 of file m3argparse.hpp.
|
private |
Definition at line 155 of file m3argparse.hpp.