4 #include <boost/program_options.hpp>
42 Suboption(
const std::string &init_longname, std::string init_short,
46 Suboption(
const po::option_description &init_boost_option);
56 bool matches(
const std::string &test_tag)
const;
75 namespace Suboption_impl {
77 std::string
pull_short(
const po::option_description &single_boost_option);
80 std::string
pull_long(
const po::option_description &single_boost_option);
102 Option(
const std::string &init_tag,
103 const po::options_description &init_premade_descs);
106 std::string
tag()
const;
119 bool matches(
const std::string &test_tag)
const;
123 Option(
const std::string &init_tag,
124 const std::vector<Suboption> &init_allowed_subopts);
160 Engine(
const std::vector<Option> &init_options);
172 const std::string &option_tag)
const;
176 const std::string &option_tag,
const std::string &suboption_tag)
const;
193 const std::string &suboption_tag)
const;
Engine()
Default constructor so you can push back your own things.
std::vector< std::string > probe_options() const
Get a list of all available options.
std::vector< std::string > probe_suboptions(const std::string &option_tag) const
For a particular option, get the available suboptions.
ARG_TYPE _probe_argument_type(const std::string &option_tag, const std::string &suboption_tag) const
std::vector< Option > m_avail_options
std::vector< std::string > probe_arguments(const std::string &option_tag, const std::string &suboption_tag) const
Return the arguments that should be bash completed.
ArgHandler::ARG_TYPE ARG_TYPE
void push_back(const Option &new_option)
Append a new option to the engine.
Option(const std::string &init_tag, const po::options_description &init_premade_descs)
Construct with program options.
ArgHandler::ARG_TYPE ARG_TYPE
ARG_TYPE probe_argument_type(const std::string &suboption_tag) const
std::vector< Suboption > m_avail_suboptions
List of all the available –suboptions this option has.
void push_back(const Suboption &new_suboption)
Append a new suboption to the option.
std::string tag() const
Return the identifying name of *this (e.g. "super", "monte", etc)
std::string m_tag
Name that identifies this casm option (e.g. "monte", "init", etc)
bool matches(const std::string &test_tag) const
Check if the given string corresponds to the tag of *this.
std::vector< std::string > probe_suboptions() const
Return what the suboptions (–long format) for *this are.
std::string short_tag() const
Return short name as char.
ARG_TYPE argument_type() const
Return the expected types of arguments that follow *this.
const ARG_TYPE m_expected_arg
Type of arguments expected.
void _sanity_throw() const
Make sure values make sense.
const std::string m_long
–long identifier (includes leading "--")
ArgHandler::ARG_TYPE ARG_TYPE
const std::string m_short
-s(hort) identifyer (includes leading '-')
Suboption(const std::string &init_longname, std::string init_short, ARG_TYPE init_expected_types)
Explicit construction. Be sure to include "--" and '-' in the tags.
bool matches(const std::string &test_tag) const
std::string long_tag() const
Return long name in string format.
std::string pull_long(const po::option_description &single_boost_option)
Get the –long tag from boost.
std::string pull_short(const po::option_description &single_boost_option)
Get the -s(hort) tag from boost, or make it "- " if it doesn't exist.
std::string strip_argument(const std::string &raw_input)