22 fs::path _default =
"ALL";
28 bool required =
false;
46 virtual int help()
const;
48 virtual int desc()
const;
50 virtual int run()
const;
68 log() <<
"Update calculation data for configurations specified by "
71 "Calculated structures are mapped to the closest matching "
73 "consistent with the primitive crystal structure. \n\n"
75 "For complete update options description for a particular config "
77 "--desc along with '--type <typename>'.\n\n";
83 err_log() <<
"ERROR: No --type\n";
97 template <
typename DataObject>
102 int help()
const override;
104 int desc()
const override;
106 int run()
const override;
109 template <
typename DataObject>
113 << m_cmd.opt().desc() << std::endl
114 <<
"For complete options description for a particular config type, use:\n"
120 template <
typename DataObject>
126 template <
typename DataObject>
153 if (!
opt().configtype_opts().
count(
opt().configtype())) {
154 std::stringstream msg;
155 msg <<
"--type " <<
opt().
configtype() <<
" is not allowed for 'casm "
164 m_impl = notstd::make_unique<UpdateCommandImplBase>(*
this);
171 sout <<
"The allowed types are:\n";
173 for (
const auto &configtype :
opt().configtype_opts()) {
174 sout <<
" " << configtype << std::endl;
179 if (
count(
"settings")) {
181 }
else if (
count(
"input")) {
const OptionType & opt() const
const po::variables_map & vm() const
int count(std::string s) const
void add_input_suboption(bool required=true)
const po::options_description & desc()
Get the program options, filled with the initialized values.
void add_settings_suboption(bool required=true)
void add_help_suboption()
Add a plain –help and –desc suboptions.
void add_configlist_suboption(const fs::path &_default="MASTER")
Add –config suboption (defaults to MASTER)
void add_configtype_suboption(std::string _default, std::set< std::string > _configtype_opts)
Add –type suboption (default, set of short_name of allowed ConfigTypes)
std::string configtype() const
const fs::path settings_path() const
Returns the path corresponding to add_settings_suboption.
void initialize() override
Fill in the options descriptions accordingly.
int help() const override
int vm_count_check() const override
static const std::string name
int desc() const override
void print_names(std::ostream &sout) const
UpdateCommandImplBase & impl() const
std::unique_ptr< UpdateCommandImplBase > m_impl
UpdateCommand(const CommandArgs &_args, Completer::UpdateOption &_opt)
Defaults used if DataObject type doesn't matter or not given.
const UpdateCommand & m_cmd
UpdateCommandImplBase(const UpdateCommand &cmd)
virtual ~UpdateCommandImplBase()
int help() const override
int desc() const override
UpdateCommandImpl(const UpdateCommand &cmd)
static jsonParser parse(const std::string &str)
Construct a jsonParser from a string containing JSON data.
void for_config_type_short(std::string short_name, F f)
const std::set< std::string > & config_types_short()
std::set of all QueryTraits<ConfigType>::short_name
Data structure holding basic CASM command info.