Merge branch 'development' into LTS_development

This commit is contained in:
Thulinma 2015-09-03 17:55:47 +02:00
commit d8051984f2
15 changed files with 30 additions and 29 deletions

View file

@ -35,7 +35,6 @@
bool Util::Config::is_active = false;
unsigned int Util::Config::printDebugLevel = DEBUG;//
std::string Util::Config::libver = PACKAGE_VERSION;
Util::Config::Config() {
//global options here
@ -44,14 +43,10 @@ Util::Config::Config() {
vals["debug"]["arg"] = "integer";
vals["debug"]["help"] = "The debug level at which messages need to be printed.";
vals["debug"]["value"].append((long long)DEBUG);
/*capabilities["optional"]["debug level"]["name"] = "debug";
capabilities["optional"]["debug level"]["help"] = "The debug level at which messages need to be printed.";
capabilities["optional"]["debug level"]["option"] = "--debug";
capabilities["optional"]["debug level"]["type"] = "integer";*/
}
/// Creates a new configuration manager.
Util::Config::Config(std::string cmd, std::string version) {
Util::Config::Config(std::string cmd) {
vals.null();
long_count = 2;
vals["cmd"]["value"].append(cmd);
@ -61,8 +56,6 @@ Util::Config::Config(std::string cmd, std::string version) {
vals["help"]["long"] = "help";
vals["help"]["short"] = "h";
vals["help"]["help"] = "Display usage and version information, then exit.";
vals["version"]["value"].append((std::string)PACKAGE_VERSION);
vals["version"]["value"].append(version);
vals["debug"]["long"] = "debug";
vals["debug"]["short"] = "g";
vals["debug"]["arg"] = "integer";
@ -246,8 +239,17 @@ bool Util::Config::parseArgs(int & argc, char ** & argv) {
case '?':
printHelp(std::cout);
case 'v':
std::cout << "Library version: " PACKAGE_VERSION << std::endl;
std::cout << "Application version: " << getString("version") << std::endl;
std::cout << "Version: " PACKAGE_VERSION ", release " RELEASE << std::endl;
#ifdef NOCRASHCHECK
std::cout << "- Flag: No crash check. Will not attempt to detect and kill crashed processes." << std::endl;
#endif
#ifndef SHM_ENABLED
std::cout << "- Flag: Shared memory disabled. Will use shared files in stead of shared memory as IPC method." << std::endl;
#endif
#ifdef WITH_THREADNAMES
std::cout << "- Flag: With threadnames. Debuggers will show sensible human-readable thread names." << std::endl;
#endif
std::cout << "Built on " __DATE__ ", " __TIME__ << std::endl;
exit(1);
break;
default:

View file

@ -21,12 +21,11 @@ namespace Util {
static void signal_handler(int signum);
public:
//variables
static std::string libver; ///< Version number of the library as a string.
static bool is_active; ///< Set to true by activate(), set to false by the signal handler.
static unsigned int printDebugLevel;
//functions
Config();
Config(std::string cmd, std::string version);
Config(std::string cmd);
void addOption(std::string optname, JSON::Value option);
void printHelp(std::ostream & output);
bool parseArgs(int & argc, char ** & argv);