39 log::error(
"Usage: q3_utility [--log-level <level>] <subcommand> [arguments]");
40 log::error(
" interpolate <input.yml> evaluate a saved interpolation record");
41 log::error(
" convert <save-directory> re-export a saved record, or import Wannier90 files "
42 "(--from wannier90)");
43 log::error(
" volumetric <input.yml> a saved density, potential or band as {}",
45 log::error(
" <subcommand> --help that subcommand's arguments");
50int main(
int argc,
char* argv[]) {
53 std::vector<std::string> arguments(argv + 1, argv + argc);
54 if (arguments.size() >= 2 && arguments[0] ==
"--log-level") {
56 arguments.erase(arguments.begin(), arguments.begin() + 2);
58 if (arguments.empty()) {
62 const std::string subcommand = arguments.front();
63 if (subcommand ==
"-h" || subcommand ==
"--help") {
67 const std::vector<std::string> rest(arguments.begin() + 1, arguments.end());
69 if (subcommand ==
"interpolate") {
72 if (subcommand ==
"convert") {
75 if (subcommand ==
"volumetric") {
78 log::error(
"Unknown subcommand '{}'", subcommand);
88 for (
const std::string& line : error.diagnostic_lines()) {
92 }
catch (
const std::exception& error) {
static int run(const std::vector< std::string > &arguments)
Returns the process exit code; argument errors print usage, everything else throws.
static int run(const std::vector< std::string > &arguments)
Returns the process exit code; argument errors print usage, everything else throws.
static int run(const std::vector< std::string > &arguments)
Returns the process exit code; argument errors print usage, everything else throws.
int main(int argc, char *argv[])
void register_all()
No add-on is compiled in, so there is nothing to register.
void print_usage(const std::string &binary_name)
void init(const std::string &log_file="")
void error(spdlog::format_string_t< Args... > fmt, Args &&... args)
void set_level(const std::string &level)
Set log level: "trace", "debug", "info", "warn", "error", "off".
Registry< NamedFactory< VolumetricFieldWriter > > & volumetric_field_writer_registry()
The registry create_volumetric_field_writer() builds writers from.