vg
tools for working with variation graphs
|
#include <options.hpp>
Public Member Functions | |
virtual | ~BaseOptionGroup ()=default |
virtual bool | parse (int option_id, const char *optarg)=0 |
virtual bool | preset (const BaseValuation &entry)=0 |
virtual bool | set (const BaseValuation &entry)=0 |
virtual bool | query (BaseValuation &entry) const =0 |
virtual void | print_options (ostream &out, bool slug=false) const =0 |
virtual std::vector< std::pair< std::string, std::string > > | get_help () const =0 |
virtual void | make_long_options (std::vector< struct option > &dest) const =0 |
Add options to non-null-terminated input for getopt_long. More... | |
virtual void | make_short_options (std::string &dest) const =0 |
Add options to string input for getopt_long. More... | |
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. More... | |
Public Member Functions inherited from vg::subcommand::TickChainLink | |
virtual void | reset_chain () |
Reset the chain to its initial values. More... | |
virtual bool | tick_chain () |
virtual TickChainLink & | chain (TickChainLink &next) |
virtual std::function< void(const std::function< void(void)> &)> | get_iterator () |
Additional Inherited Members | |
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. More... | |
std::function< bool(void)> | tick_chain_parent |
This will be called when we need to tick_chain our parent. More... | |
Represents a set of command-line options.
|
virtualdefault |
|
pure virtual |
Get help, in the form of pairs of options and descriptions. Headings are descriptions without options.
Implemented in vg::subcommand::GroupedOptionGroup, and vg::subcommand::OptionGroup< Receiver >.
|
inline |
Allow the user to query an option value by name. Would be simpler if we could override template methods but we can't.
|
pure virtual |
Add options to non-null-terminated input for getopt_long.
Implemented in vg::subcommand::GroupedOptionGroup, and vg::subcommand::OptionGroup< Receiver >.
|
pure virtual |
Add options to string input for getopt_long.
Implemented in vg::subcommand::GroupedOptionGroup, and vg::subcommand::OptionGroup< Receiver >.
|
pure virtual |
Parse the given option ID, with the given value if needed. Return true if we matched the ID, and false otherwise.
Implemented in vg::subcommand::GroupedOptionGroup, and vg::subcommand::OptionGroup< Receiver >.
|
pure virtual |
Apply a preset value to its option. Returns true if it was found, and false otherwies.
Implemented in vg::subcommand::GroupedOptionGroup, and vg::subcommand::OptionGroup< Receiver >.
|
pure virtual |
Print all options set. By default, prints one option per line. If slug is set, prints short options, all on one line.
Implemented in vg::subcommand::GroupedOptionGroup, and vg::subcommand::OptionGroup< Receiver >.
|
pure virtual |
Fill in entry with the value of the correspondign option, if we have that option. If so, return true.
Implemented in vg::subcommand::GroupedOptionGroup, and vg::subcommand::OptionGroup< Receiver >.
|
pure virtual |
Apply a value to its option. Returns true if it was found, and false otherwies.
Implemented in vg::subcommand::GroupedOptionGroup, and vg::subcommand::OptionGroup< Receiver >.
|
inline |
Allow the user to manually set an option value.