diff options
Diffstat (limited to 'lib/configuration/configuration.cpp')
-rw-r--r-- | lib/configuration/configuration.cpp | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/lib/configuration/configuration.cpp b/lib/configuration/configuration.cpp index 1829a5e..def997d 100644 --- a/lib/configuration/configuration.cpp +++ b/lib/configuration/configuration.cpp @@ -45,6 +45,7 @@ Configuration::Configuration() commandLine_desc.add_options() ("help,h", "Display this help.") ("version,v", "Display version information.") + ("build", "Display build branch and commit.") ("config,c", po::value<std::string>()->default_value(defaultUserConfigLocation()), "Set the configuration file.") ("socket,s", po::value<std::string>()->default_value(defaultSocketPath()), "Local server socket") @@ -122,7 +123,7 @@ Configuration::Configuration() Configuration::~Configuration() = default; -bool Configuration::parseConfigFile(const std::string &path) +bool Configuration::parse(const std::string &path) { std::ifstream f(path, std::ifstream::in); @@ -131,7 +132,7 @@ bool Configuration::parseConfigFile(const std::string &path) return true; } -bool Configuration::parseCommandLine(int argc, char **argv) +bool Configuration::parse(int argc, char **argv) { try { auto cmd = po::command_line_parser(argc, argv); @@ -145,20 +146,6 @@ bool Configuration::parseCommandLine(int argc, char **argv) return false; } - if(vm.count("help")) { - std::cout << qUtf8Printable(qApp->applicationName()) << " " << qUtf8Printable(qApp->applicationVersion()) << ": yet another no-frills browser" << std::endl; - std::cout << "Usage: " << qUtf8Printable(qApp->arguments().at(0)) << " [options] URL(s)" << std::endl; - - std::cout << std::endl << "Command-line Options: " << std::endl << commandLine_desc << std::endl; - std::cout << std::endl << "Configuration Options: " << std::endl << configuration_desc << std::endl; - exit(0); - } - - if(vm.count("version")) { - std::cout << qUtf8Printable(qApp->applicationName()) << " " << qUtf8Printable(qApp->applicationVersion()) << std::endl; - exit(0); - } - return true; } |