X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/93876a5fc8231cae1e9f13caf50492985e7ae76e..9c6406d76392a55a85d3ec25586a47ab892b88fe:/projects/sgconf/main.cpp?ds=inline diff --git a/projects/sgconf/main.cpp b/projects/sgconf/main.cpp index 82372224..0667e259 100644 --- a/projects/sgconf/main.cpp +++ b/projects/sgconf/main.cpp @@ -256,6 +256,8 @@ SGCONF::OPTION_BLOCK & block = blocks.Add("Connection options") .Add("u", "username", SGCONF::MakeParamAction(config.userName, std::string("admin"), ""), "\tadministrative login") .Add("w", "userpass", SGCONF::MakeParamAction(config.userPass, ""), "\tpassword for the administrative login") .Add("a", "address", SGCONF::MakeParamAction(config, ""), "connection params as a single string in format: :@:"); +blocks.Add("Debug options") + .Add("show-config", SGCONF::MakeParamAction(config.showConfig), "\t\tshow config and exit"); SGCONF::AppendXMLOptionBlock(commands, blocks); SGCONF::AppendAdminsOptionBlock(commands, blocks); SGCONF::AppendTariffsOptionBlock(commands, blocks); @@ -302,7 +304,11 @@ else config = configOverride; -std::cerr << "Config: " << config.Serialize() << std::endl; +if (!config.showConfig.empty() && config.showConfig.data()) + { + std::cout << config.Serialize() << std::endl; + return 0; + } return commands.Execute(config) ? 0 : -1; } catch (const std::exception& ex)