statusweather: Simplify check for required options.

This commit is contained in:
tastytea 2021-08-24 16:13:15 +02:00
parent f5bef72217
commit 54381155cc
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 2 additions and 4 deletions

View File

@ -104,10 +104,8 @@ std::tuple<std::string, std::string> get_options()
std::ifstream configfile(path);
po::store(po::parse_config_file(configfile, options, true), vm);
configfile.close();
if ((vm.count("api_key") == 0) || (vm.count("city") == 0))
{
throw std::runtime_error{"api_key or city not configured."};
}
po::notify(vm);
return std::make_tuple(vm["api_key"].as<std::string>(),
vm["city"].as<std::string>());