CommsParameters::CommsParameters(IEnvironmentVariables& env) : GBerryConsoleCommon::RuntimeParameters(env) { parser().setApplicationDescription("Communication manager of GBerry game platform"); parser().addVersionOption(); addBooleanOption(DISABLE_WAITAPP, new QCommandLineOption(DISABLE_WAITAPP, "Disables showing waiting application")); addBooleanOption(DISABLE_MAINUI, new QCommandLineOption(DISABLE_MAINUI, "Disables showing main application")); addValueOption(ROOT_PATH, new QCommandLineOption(ROOT_PATH, "Defines used root path", "rootpath")); addBuildTimeDefault(ROOT_PATH, xstr(GBERRY_ROOT_PATH)); addEnvironmentVariable(ROOT_PATH, "GBERRY_ROOT_PATH"); // TODO: should value options add*() have different signature? Do we need value name to anything? addValueOption(COMMS_CONFIG, new QCommandLineOption(COMMS_CONFIG, "Defines used configuration file", "commsconfig")); addEnvironmentVariable(COMMS_CONFIG, "GBERRY_COMMS_CONFIG"); }
EnvironmentVariableParser(char* envp[]) { char* env = envp[0]; for (int i = 0; env != nullptr; ++i, env = envp[i]) { addEnvironmentVariable(env); } }
ApplicationParameters::ApplicationParameters(IEnvironmentVariables& env) : GBerryConsoleCommon::RuntimeParameters(env) { // TODO: info for these should be read from appcfg.json //_parser.setApplicationDescription("Communication manager of GBerry game platform"); //_parser.addVersionOption() addValueOption(APPLICATION_CODE, new QCommandLineOption(APPLICATION_CODE, "Defines uses application code identification", "application_code")); addEnvironmentVariable(APPLICATION_CODE, "GBERRY_APPLICATION_CODE"); }