moved config file parameters to [Telegram] section

This commit is contained in:
Michael Mandl 2018-03-30 21:22:39 +02:00
parent 9fa3f1cc27
commit b192808a67

View file

@ -34,13 +34,16 @@ Settings::Settings(int argc, char **argv)
po::options_description fileOptions;
fileOptions.add_options()
("token", po::value<std::string>(&token))
("users", po::value<std::vector<std::string>>(&users)->multitoken())
("Telegram.token", po::value<std::string>(&token))
("Telegram.users", po::value<std::vector<std::string>>(&users)->multitoken())
;
try
{
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)
{