moved config file parameters to [Telegram] section

main
Michael Mandl 2018-03-30 21:22:39 +02:00
parent 9fa3f1cc27
commit b192808a67
1 changed files with 5 additions and 2 deletions

View File

@ -34,13 +34,16 @@ Settings::Settings(int argc, char **argv)
po::options_description fileOptions; po::options_description fileOptions;
fileOptions.add_options() fileOptions.add_options()
("token", po::value<std::string>(&token)) ("Telegram.token", po::value<std::string>(&token))
("users", po::value<std::vector<std::string>>(&users)->multitoken()) ("Telegram.users", po::value<std::vector<std::string>>(&users)->multitoken())
; ;
try try
{ {
po::store(po::parse_config_file(configFile, fileOptions), configuredOptions); po::store(po::parse_config_file(configFile, fileOptions), configuredOptions);
configuredOptions.insert({ "token", configuredOptions["Telegram.token"] });
configuredOptions.insert({ "users", configuredOptions["Telegram.users"] });
} }
catch (po::unknown_option &e) catch (po::unknown_option &e)
{ {