statusweather: Simplify check for required options.
This commit is contained in:
parent
f5bef72217
commit
54381155cc
@ -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>());
|
||||
|
Loading…
x
Reference in New Issue
Block a user