From 54381155cc67b323ed650513441883053fe68e4b Mon Sep 17 00:00:00 2001 From: tastytea Date: Tue, 24 Aug 2021 16:13:15 +0200 Subject: [PATCH] statusweather: Simplify check for required options. --- statusweather.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/statusweather.cpp b/statusweather.cpp index 95c9d01..47fcd29 100644 --- a/statusweather.cpp +++ b/statusweather.cpp @@ -104,10 +104,8 @@ std::tuple 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(), vm["city"].as());