|
| virtual | ~OptionGroup ()=default |
| |
| | OptionGroup (const std::string &heading) |
| | Make an option group woith the given heading.
|
| |
| virtual TickChainLink & | chain (TickChainLink &next) |
| | Chain through all options.
|
| |
| template<typename T , typename Spec = ValueArgSpec<T, Receiver>> |
| void | add_option (const std::string &name, char short_option, T Receiver::*dest, T default_value, const std::string &help, const ValidatorFunction< T > &validator=[](const T &ignored) {}) |
| | Add a new option that goes to the given field, with the given default.
|
| |
| template<typename T , typename Spec = ValueArgSpec<T, Receiver>> |
| void | add_option (const std::string &name, T Receiver::*dest, T default_value, const std::string &help, const ValidatorFunction< T > &validator=[](const T &ignored) {}) |
| | Add a new option that goes to the given field, with the given default.
|
| |
| template<typename T > |
| void | add_range (const std::string &name, char short_option, T Receiver::*dest, T default_value, const std::string &help, const ValidatorFunction< T > &validator=[](const T &ignored) {}) |
| | Add a new option that handles range values.
|
| |
| template<typename T > |
| void | add_range (const std::string &name, T Receiver::*dest, T default_value, const std::string &help, const ValidatorFunction< T > &validator=[](const T &ignored) {}) |
| | Add a new option that handles range values.
|
| |
| void | add_flag (const std::string &name, char short_option, bool Receiver::*dest, bool default_value, const std::string &help, const ValidatorFunction< bool > &validator=[](const bool &ignored) {}) |
| | Add a new option that is a boolean flag.
|
| |
| void | add_flag (const std::string &name, bool Receiver::*dest, bool default_value, const std::string &help, const ValidatorFunction< bool > &validator=[](const bool &ignored) {}) |
| | Add a new option that is a boolean flag.
|
| |
| virtual bool | parse (int option_id, const char *optarg) |
| |
| virtual bool | preset (const BaseValuation &entry) |
| |
| virtual bool | set (const BaseValuation &entry) |
| |
| virtual bool | query (BaseValuation &entry) const |
| |
| virtual void | print_options (ostream &out, bool slug=false) const |
| | Print all options set, one per line.
|
| |
| void | apply (Receiver &receiver) const |
| | Apply all flags to the receiver.
|
| |
| virtual std::vector< std::pair< std::string, std::string > > | get_help () const |
| |
| virtual void | make_long_options (std::vector< struct option > &dest) const |
| | Add to non-null-terminated input for getopt_long.
|
| |
| virtual void | make_short_options (std::string &dest) const |
| | Add to string input for getopt_long.
|
| |
Public Member Functions inherited from vg::subcommand::BaseOptionGroup |
| virtual | ~BaseOptionGroup ()=default |
| |
| template<typename T > |
| T | get_option_value (const std::string &option) const |
| |
| template<typename T > |
| void | set_option_value (const std::string &option, const T &value) |
| | Allow the user to manually set an option value.
|
| |
Public Member Functions inherited from vg::subcommand::TickChainLink |
| virtual void | reset_chain () |
| | Reset the chain to its initial values.
|
| |
| virtual bool | tick_chain () |
| |
| virtual std::function< void(const std::function< void(void)> &)> | get_iterator () |
| |
|
| std::string | heading |
| | Heading we will appear under in the help.
|
| |
| std::vector< std::unique_ptr< BaseArgSpec< Receiver > > > | args |
| | Holds the argument definitions and parsing destinations.
|
| |
| std::unordered_map< int, size_t > | id_to_index |
| | Map from option ID to option index.
|
| |
| std::unordered_map< std::string, size_t > | option_to_index |
| | Map from long option to option index, to allow applying presets.
|
| |
Public Attributes inherited from vg::subcommand::TickChainLink |
| std::function< void(void)> | reset_chain_parent |
| | This will be called when we want to reset_chain what we are chained onto.
|
| |
| std::function< bool(void)> | tick_chain_parent |
| | This will be called when we need to tick_chain our parent.
|
| |
template<typename Receiver>
struct vg::subcommand::OptionGroup< Receiver >
Represents a set of command-line options that can be applied to an object. Internal values can be ranges that can be ticked. Comes with a heading.