CASM
1.1.0
A Clusters Approach to Statistical Mechanics
|
#include <Handlers.hh>
Handle the value type names of po::option_description. This class determines what the keywords mean, and translates them into the ARG_TYPE enum as appropriate.
If you want bash completion for your boost program options, never specify option_description::value_name manually (e.g. raw string), always request the string through this class.
When the Engine class isn't returning strings corresponding to options or suboptions that bash should complete, then the user is in the process of writing out an argument. By printing out keywords, the bash completer script can know what kind of arguments are needed for the casm command:
VOID: Don't complete anything PATH: Suggest path completions to a file or directory COMMAND: Suggest executables within the environment PATH SCELNAME: Run through the PrimClex and suggest the enumerated supercell names QUERY: Suggest the available query options OPERATORS: Suggest the available operators casm knows how to use (TODO: This one might be tricky to implement)
Definition at line 39 of file Handlers.hh.
Public Types | |
enum | ARG_TYPE { VOID , PATH , COMMAND , SCELNAME , QUERY , OPERATOR , CONFIGNAME , COORDTYPE , DBTYPE , ENUMMETHOD , CONFIGTYPE , CALCTYPE , BSET , CLEX , REF , ECI , PROPERTY , DOF , INFOMETHOD } |
Static Public Member Functions | |
static ARG_TYPE | determine_type (const po::option_description &boost_option) |
static std::string | path () |
Get value_type string for path completion. More... | |
static std::string | command () |
Get value_type string for command completion (i.e. stuff in your $PATH) More... | |
static std::string | supercell () |
Get value_type string for supercell completion. More... | |
static std::string | query () |
Get value_type string for query completion. More... | |
static std::string | operation () |
Get value_type string for operation completion. More... | |
static std::string | configname () |
Get value_type string for configuration completion. More... | |
static std::string | coordtype () |
Get value_type string for coordinate mode completion. More... | |
static std::string | dbtype () |
Get value_type string for dbtype mode completion. More... | |
static std::string | enummethod () |
Get value_type string for enummethod mode completion. More... | |
static std::string | configtype () |
Get value_type string for configtype mode completion. More... | |
static std::string | calctype () |
Get value_type string for calctype mode completion. More... | |
static std::string | bset () |
Get value_type string for bset mode completion. More... | |
static std::string | clex () |
Get value_type string for clex mode completion. More... | |
static std::string | ref () |
Get value_type string for ref mode completion. More... | |
static std::string | eci () |
Get value_type string for eci mode completion. More... | |
static std::string | property () |
Get value_type string for property mode completion. More... | |
static std::string | dof () |
Get value_type string for property mode completion. More... | |
static std::string | infomethod () |
Get value_type string for infomethod mode completion. More... | |
static void | void_to_bash (std::vector< std::string > &arguments) |
static void | path_to_bash (std::vector< std::string > &arguments) |
Fill the output strings with bash completion appropriate values for PATH. More... | |
static void | command_to_bash (std::vector< std::string > &arguments) |
static void | scelname_to_bash (std::vector< std::string > &arguments) |
static void | configname_to_bash (std::vector< std::string > &arguments) |
static void | query_to_bash (std::vector< std::string > &arguments) |
Fill the output strings with bash completion appropriate values for QUERY. More... | |
static void | operator_to_bash (std::vector< std::string > &arguments) |
static void | dbtype_to_bash (std::vector< std::string > &arguments) |
Fill the output strings with bash completion appropriate values for DBTYPE. More... | |
static void | enummethod_to_bash (std::vector< std::string > &arguments) |
static void | configtype_to_bash (std::vector< std::string > &arguments) |
static void | calctype_to_bash (std::vector< std::string > &arguments) |
static void | bset_to_bash (std::vector< std::string > &arguments) |
Fill the output strings with bash completion appropriate values for BSET. More... | |
static void | clex_to_bash (std::vector< std::string > &arguments) |
Fill the output strings with bash completion appropriate values for CLEX. More... | |
static void | ref_to_bash (std::vector< std::string > &arguments) |
Fill the output strings with bash completion appropriate values for REF. More... | |
static void | eci_to_bash (std::vector< std::string > &arguments) |
Fill the output strings with bash completion appropriate values for ECI. More... | |
static void | property_to_bash (std::vector< std::string > &arguments) |
static void | dof_to_bash (std::vector< std::string > &arguments) |
Fill the output strings with bash completion appropriate values for DOF. More... | |
static void | infomethod_to_bash (std::vector< std::string > &arguments) |
Static Private Attributes | |
static const std::vector< std::pair< std::string, ARG_TYPE > > | m_argument_table |
Enumerator | |
---|---|
VOID | |
PATH | |
COMMAND | |
SCELNAME | |
QUERY | |
OPERATOR | |
CONFIGNAME | |
COORDTYPE | |
DBTYPE | |
ENUMMETHOD | |
CONFIGTYPE | |
CALCTYPE | |
BSET | |
CLEX | |
REF | |
ECI | |
PROPERTY | |
DOF | |
INFOMETHOD |
Definition at line 41 of file Handlers.hh.
|
static |
Get value_type string for bset mode completion.
Definition at line 78 of file Handlers.cc.
|
static |
Fill the output strings with bash completion appropriate values for BSET.
Definition at line 193 of file Handlers.cc.
|
static |
Get value_type string for calctype mode completion.
Definition at line 76 of file Handlers.cc.
|
static |
Fill the output strings with bash completion appropriate values for CALCTYPE
Definition at line 182 of file Handlers.cc.
|
static |
Get value_type string for clex mode completion.
Definition at line 80 of file Handlers.cc.
|
static |
Fill the output strings with bash completion appropriate values for CLEX.
Definition at line 204 of file Handlers.cc.
|
static |
Get value_type string for command completion (i.e. stuff in your $PATH)
Definition at line 58 of file Handlers.cc.
|
static |
Fill the output strings with bash completion appropriate values for COMMAND
Definition at line 99 of file Handlers.cc.
|
static |
Get value_type string for configuration completion.
Definition at line 66 of file Handlers.cc.
|
static |
Fill the output strings with bash completion appropriate values for CONFIGNAME
Definition at line 116 of file Handlers.cc.
|
static |
Get value_type string for configtype mode completion.
Definition at line 74 of file Handlers.cc.
|
static |
Fill the output strings with bash completion appropriate values for CONFIGTYPE
Definition at line 175 of file Handlers.cc.
|
static |
Get value_type string for coordinate mode completion.
Definition at line 68 of file Handlers.cc.
|
static |
Get value_type string for dbtype mode completion.
Definition at line 70 of file Handlers.cc.
|
static |
Fill the output strings with bash completion appropriate values for DBTYPE.
Definition at line 160 of file Handlers.cc.
|
static |
Translate the stored boost value_name into an ARG_TYPE for the completer engine
Definition at line 28 of file Handlers.cc.
|
static |
Get value_type string for property mode completion.
Definition at line 88 of file Handlers.cc.
|
static |
Fill the output strings with bash completion appropriate values for DOF.
Definition at line 250 of file Handlers.cc.
|
static |
Get value_type string for eci mode completion.
Definition at line 84 of file Handlers.cc.
|
static |
Fill the output strings with bash completion appropriate values for ECI.
Definition at line 226 of file Handlers.cc.
|
static |
Get value_type string for enummethod mode completion.
Definition at line 72 of file Handlers.cc.
|
static |
Fill the output strings with bash completion appropriate values for ENUMMETHOD
Definition at line 167 of file Handlers.cc.
|
static |
Get value_type string for infomethod mode completion.
Definition at line 90 of file Handlers.cc.
|
static |
Fill the output strings with bash completion appropriate values for INFOMETHOD
Definition at line 261 of file Handlers.cc.
|
static |
Get value_type string for operation completion.
Definition at line 64 of file Handlers.cc.
|
static |
Fill the output strings with bash completion appropriate values for OPERATOR
Definition at line 128 of file Handlers.cc.
|
static |
Get value_type string for path completion.
Definition at line 56 of file Handlers.cc.
|
static |
Fill the output strings with bash completion appropriate values for PATH.
Definition at line 94 of file Handlers.cc.
|
static |
Get value_type string for property mode completion.
Definition at line 86 of file Handlers.cc.
|
static |
Fill the output strings with bash completion appropriate values for PROPERTY
Definition at line 239 of file Handlers.cc.
|
static |
Get value_type string for query completion.
Definition at line 62 of file Handlers.cc.
|
static |
Fill the output strings with bash completion appropriate values for QUERY.
Definition at line 140 of file Handlers.cc.
|
static |
Get value_type string for ref mode completion.
Definition at line 82 of file Handlers.cc.
|
static |
Fill the output strings with bash completion appropriate values for REF.
Definition at line 215 of file Handlers.cc.
|
static |
Fill the output strings with bash completion appropriate values for SCELNAME
Definition at line 104 of file Handlers.cc.
|
static |
Get value_type string for supercell completion.
Definition at line 60 of file Handlers.cc.
|
static |
Fill the output strings with bash completion appropriate values for VOID (i.e. do nothing)
Definition at line 92 of file Handlers.cc.
|
staticprivate |
List of pairs relating the value type name of po::option_description to its corresponding argument type
This construction right here determines what the value_name of the boost options should be named. It is through these strings that bash completion can know which types of completions to suggest.
Definition at line 188 of file Handlers.hh.