Skip to content

Commit

Permalink
Make --debug be settable from config file
Browse files Browse the repository at this point in the history
  • Loading branch information
venkatesh-prasad-v committed Feb 28, 2023
1 parent 20df661 commit 19f8689
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions garb/garb_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ Config::Config (int argc, char* argv[])
other.add_options()
("version,v", "Print version & exit")
("help,h", "Show help message & exit")
("debug", "Enable debug prints")
;

// only these are read from cfg file
Expand All @@ -74,7 +73,8 @@ Config::Config (int argc, char* argv[])
("options,o", po::value<std::string>(&options_), "GCS/GCOMM option list")
("log,l", po::value<std::string>(&log_), "Log file")
("recv-script", po::value<std::string>(&recv_script_), "SST request receive script")
("workdir,w",po::value<std::string>(&workdir_), "Daemon working directory")
("workdir,w", po::value<std::string>(&workdir_), "Daemon working directory")
("debug", po::value<bool>(&debug_), "Enable debug prints")
;

po::options_description cfg_opt;
Expand Down Expand Up @@ -110,12 +110,6 @@ Config::Config (int argc, char* argv[])
return;
}

if (vm.count("debug"))
{
debug_ = true;
gu_conf_debug_on();
}

if (vm.count("cfg"))
{
std::ifstream ifs(cfg_.c_str());
Expand All @@ -135,6 +129,12 @@ Config::Config (int argc, char* argv[])
notify(vm);
}

if (vm.count("debug"))
{
if (debug_)
gu_conf_debug_on();
}

if (!vm.count("address"))
{
gu_throw_error(EDESTADDRREQ) << "Group address not specified";
Expand Down

0 comments on commit 19f8689

Please sign in to comment.