CASM
1.1.0
A Clusters Approach to Statistical Mechanics
|
#include <Complete.hh>
A typical casm command takes 3 types of arguments: Option: Things like "super", "enum", "monte", etc Suboption: Anything that starts with "--" or "-", such as "--max" or "-z" Argument: The argument you pass to the suboption, such as an integer or filename
The Option class has a string that identifies it (e.g. "enum"), as well as a list of Suboptions that it can take.
Definition at line 96 of file Complete.hh.
Public Member Functions | |
Option (const std::string &init_tag, const po::options_description &init_premade_descs) | |
Construct with program options. More... | |
std::string | tag () const |
Return the identifying name of *this (e.g. "super", "monte", etc) More... | |
std::vector< std::string > | probe_suboptions () const |
Return what the suboptions (–long format) for *this are. More... | |
ARG_TYPE | probe_argument_type (const std::string &suboption_tag) const |
void | push_back (const Suboption &new_suboption) |
Append a new suboption to the option. More... | |
bool | matches (const std::string &test_tag) const |
Check if the given string corresponds to the tag of *this. More... | |
Private Types | |
typedef std::size_t | size_type |
typedef ArgHandler::ARG_TYPE | ARG_TYPE |
Private Member Functions | |
Option (const std::string &init_tag, const std::vector< Suboption > &init_allowed_subopts) | |
Construct manually passing all values needed. More... | |
Private Attributes | |
std::string | m_tag |
Name that identifies this casm option (e.g. "monte", "init", etc) More... | |
std::vector< Suboption > | m_avail_suboptions |
List of all the available –suboptions this option has. More... | |
|
private |
Definition at line 98 of file Complete.hh.
|
private |
Definition at line 97 of file Complete.hh.
CASM::Completer::Option::Option | ( | const std::string & | init_tag, |
const po::options_description & | init_premade_descs | ||
) |
Construct with program options.
Definition at line 102 of file Complete.cc.
|
private |
Construct manually passing all values needed.
Definition at line 98 of file Complete.cc.
bool CASM::Completer::Option::matches | ( | const std::string & | test_tag | ) | const |
Check if the given string corresponds to the tag of *this.
Definition at line 148 of file Complete.cc.
ARG_TYPE CASM::Completer::Option::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-stripped.
Runs through all the available Suboptions trying to match the provided suboption_tag. If the suboption_tag matches, then return the expected type of arguments of that suboption, if the provided tag doesn't match anything, then default to returning VOID, i.e. no completion should be done by bash.
Definition at line 137 of file Complete.cc.
std::vector< std::string > CASM::Completer::Option::probe_suboptions | ( | ) | const |
Return what the suboptions (–long format) for *this are.
Runs through all the stored Suboptions and creates a list of each –long tag they have. The list of strings is then returned.
Definition at line 120 of file Complete.cc.
void CASM::Completer::Option::push_back | ( | const Suboption & | new_suboption | ) |
Append a new suboption to the option.
std::string CASM::Completer::Option::tag | ( | ) | const |
Return the identifying name of *this (e.g. "super", "monte", etc)
Definition at line 113 of file Complete.cc.
|
private |
List of all the available –suboptions this option has.
Definition at line 131 of file Complete.hh.
|
private |
Name that identifies this casm option (e.g. "monte", "init", etc)
Definition at line 127 of file Complete.hh.