29 m_desc.add_options()(
"data,d",
"Remove calculation data only.")(
31 "Force remove including data and dependent objects (for --type=scel).");
75 virtual int help()
const;
77 virtual int desc()
const;
79 virtual int run()
const;
97 log() <<
"Erase objects specified by --names or --selection, and data if "
100 "Calculated structures are mapped to the closest matching "
102 "consistent with the primitive crystal structure. \n\n"
104 "For complete update options description for a particular config "
106 "--desc along with '--type <typename>'.\n\n";
112 err_log() <<
"ERROR: No --type\n";
125 template <
typename DataObject>
130 int help()
const override;
132 int desc()
const override;
134 int run()
const override;
137 template <
typename DataObject>
141 << m_cmd.opt().desc() << std::endl
142 <<
"For complete options description for a particular config type, use:\n"
148 template <
typename DataObject>
154 template <
typename DataObject>
191 std::stringstream msg;
192 msg <<
"--type " <<
opt().
db_type() <<
" is not allowed for 'casm "
198 m_impl = notstd::make_unique<RmCommandImplBase>(*
this);
205 sout <<
"The allowed types are:\n";
207 for (
const auto &db_type :
opt().db_type_opts()) {
208 sout <<
" " << db_type << std::endl;
213 sout <<
"The allowed types with --data option are:\n";
215 for (
const auto &db_type :
opt().db_type_opts()) {
217 sout <<
" " << db_type << std::endl;
const OptionType & opt() const
int count(std::string s) const
void add_names_suboption()
Add a –names suboption.
const po::options_description & desc()
Get the program options, filled with the initialized values.
po::variables_map & vm()
Get the variables map.
void add_help_suboption()
Add a plain –help and –desc suboptions.
po::options_description m_desc
void add_db_type_suboption(std::string _default, std::set< std::string > _configtype_opts)
void add_dry_run_suboption(std::string msg=default_dry_run_msg())
void add_selection_suboption(const fs::path &_default="MASTER")
Add –selection suboption (defaults to MASTER)
void initialize() override
Fill in the options descriptions accordingly.
std::string db_type() const
static int run(const PrimClex &, const Completer::RmOption &opt)
void error(const std::string &what)
RmCommandImplBase & impl() const
int desc() const override
int help() const override
static const std::string name
void print_config_names(std::ostream &sout) const
void print_names(std::ostream &sout) const
RmCommand(const CommandArgs &_args, Completer::RmOption &_opt)
int vm_count_check() const override
std::unique_ptr< RmCommandImplBase > m_impl
Defaults used if DataObject type doesn't matter or not given.
virtual ~RmCommandImplBase()
RmCommandImplBase(const RmCommand &cmd)
int help() const override
int desc() const override
RmCommandImpl(const RmCommand &cmd)
void for_type_short(std::string short_name, F f)
const std::set< std::string > & types_short()
std::set of all QueryTraits<DataObject>::short_name
const std::set< std::string > & config_types_short()
std::set of all QueryTraits<ConfigType>::short_name
Data structure holding basic CASM command info.