8 #include <boost/program_options.hpp>
39 Suboption(
const std::string &init_longname, std::string init_short, ARG_TYPE init_expected_types);
42 Suboption(
const po::option_description &init_boost_option);
51 bool matches(
const std::string &test_tag)
const;
71 namespace Suboption_impl {
73 std::string
pull_short(
const po::option_description &single_boost_option);
76 std::string
pull_long(
const po::option_description &single_boost_option);
99 Option(
const std::string &init_tag,
const po::options_description &init_premade_descs);
102 std::string
tag()
const;
114 bool matches(
const std::string &test_tag)
const;
119 Option(
const std::string &init_tag,
const std::vector<Suboption> &init_allowed_subopts);
156 Engine(
const std::vector<Option> &init_options);
165 std::vector<std::string>
probe_suboptions(
const std::string &option_tag)
const;
168 std::vector<std::string>
probe_arguments(
const std::string &option_tag,
const std::string &suboption_tag)
const;
182 ARG_TYPE
_probe_argument_type(
const std::string &option_tag,
const std::string &suboption_tag)
const;
std::vector< std::string > probe_suboptions(const std::string &option_tag) const
For a particular option, get the available suboptions.
std::vector< Suboption > m_avail_suboptions
List of all the available –suboptions this option has.
ARG_TYPE probe_argument_type(const std::string &suboption_tag) const
For a particular –suboption, get what kind of arguments are expected. suboption_tag should be pre-st...
Option(const std::string &init_tag, const po::options_description &init_premade_descs)
Construct with program options.
bool matches(const std::string &test_tag) const
Check if the given string corresponds to the tag of *this.
const std::string m_long
–long identifier (includes leading "--")
std::string tag() const
Return the identifying name of *this (e.g. "super", "monte", etc)
const std::string m_short
-s(hort) identifyer (includes leading '-')
std::string short_tag() const
Return short name as char.
std::string strip_argument(const std::string &raw_input)
Remove "--" or "-" from beginning of string if it exists, and return as new string.
bool matches(const std::string &test_tag) const
See if a provided string matches either the –long or -s(hort) tags. Expects leading '-' characters...
void push_back(const Suboption &new_suboption)
Append a new suboption to the option.
std::string long_tag() const
Return long name in string format.
void _sanity_throw() const
Make sure values make sense.
std::string pull_long(const po::option_description &single_boost_option)
Get the –long tag from boost.
ARG_TYPE argument_type() const
Return the expected types of arguments that follow *this.
const ARG_TYPE m_expected_arg
Type of arguments expected.
std::vector< std::string > probe_options() const
Construct by passing boost program options (eventually preferred so that it can update itself) ...
ArgHandler::ARG_TYPE ARG_TYPE
std::vector< std::string > probe_suboptions() const
Return what the suboptions (–long format) for *this are.
void push_back(const Option &new_option)
Guess what should be returned based on the current word (probably not gonna make it that smart) ...
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.
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.
ArgHandler::ARG_TYPE ARG_TYPE
std::string m_tag
Name that identifies this casm option (e.g. "monte", "init", etc)
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.
std::vector< Option > m_avail_options
List of all the available (presumably casm) options (e.g. "monte", "init", etc)
Engine()
Default constructor so you can push back your own things.
ARG_TYPE _probe_argument_type(const std::string &option_tag, const std::string &suboption_tag) const
For a particular option with suboption, get what kind of arguments are expected.
ArgHandler::ARG_TYPE ARG_TYPE