diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-01-04 21:12:06 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-01-04 21:19:34 +0200 |
commit | f65d6ea0d7ca7de7a6c7538612731b11889086fb (patch) | |
tree | b459e38149232f098bdc6fff322b95d2c4e462bf /src/main.cpp | |
parent | PKGBUILD: add install stage for debug symbols (diff) | |
download | smolbote-f65d6ea0d7ca7de7a6c7538612731b11889086fb.tar.xz |
Fix configuration not being read unless explicitly specified
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/src/main.cpp b/src/main.cpp index f6a5b17..be6a559 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -38,14 +38,6 @@ inline std::string join_keys(const command_map &map, const std::string sep = ", return k; } -#if defined(CONFIG_USEPLASMA) && !defined(PLASMA) -#error "You have enabled Plasma integration, but Frameworks was not found." -#endif - -#if defined(CONFIG_USEBREAKPAD) && !defined(BREAKPAD) -#error "You have enabled Breakpad integration, but Breakpad was not found." -#endif - int main(int argc, char **argv) { // change log pattern @@ -54,20 +46,14 @@ int main(int argc, char **argv) spdlog::set_level(spdlog::level::debug); // Set global log level to debug #endif - const std::vector<std::string> args(argv + 1, argv + argc); - args::ArgumentParser parser("smolbote: yet another no-frills browser", -#ifdef Q_OS_UNIX - "For more information on usage, refer to the manual page." -#else - "For more information on usage, refer to the manual." -#endif - ); - parser.Prog(argv[0]); - const command_map commands{ { "configuration", builtins::configuration } }; + const std::vector<std::string> args(argv + 1, argv + argc); + args::ArgumentParser parser("smolbote: yet another no-frills browser", "Subcommands: " + join_keys(commands)); + parser.Prog(argv[0]); + args::HelpFlag cmd_help(parser, "help", "Display this help message.", { 'h', "help" }); args::Flag cmd_version(parser, "version", "Display version information.", { 'v', "version" }); args::Flag cmd_build(parser, "build", "Display build commit.", { 'b', "build" }); @@ -91,7 +77,7 @@ int main(int argc, char **argv) return builtins::build(); // create and load configuration - init_conf(args::get(cmd_config)); + spdlog::info("Loading configuration {}", init_conf(args::get(cmd_config))); if(cmd_args) { const auto front = args::get(cmd_args).front(); @@ -101,10 +87,8 @@ int main(int argc, char **argv) } } - } catch(args::Help &e) { + } catch(args::Help &) { std::cout << parser; - Q_UNUSED(e); - std::cout << "Available subcommands: " << join_keys(commands) << std::endl; return 0; } catch(args::Error &e) { @@ -113,13 +97,6 @@ int main(int argc, char **argv) return -1; } - // Disable Chromium's crash handler so breakpad can capture crashes instead. - // This has to be done before QtWebEngine gets initialized. - const auto chromiumFlags = qgetenv("QTWEBENGINE_CHROMIUM_FLAGS"); - if(!chromiumFlags.contains("disable-in-process-stack-traces")) { - qputenv("QTWEBENGINE_CHROMIUM_FLAGS", chromiumFlags + " --disable-in-process-stack-traces"); - } - QVector<QPluginLoader *> plugins; CommandHash_t pluginCommands; |