#include "users.h"
#include "services.h"
#include "corps.h"
+#include "info.h"
#include "api_action.h"
#include "options.h"
.Add("u", "username", SGCONF::MakeParamAction(config.userName, std::string("admin"), "<username>"), "\tadministrative login")
.Add("w", "userpass", SGCONF::MakeParamAction(config.userPass, "<password>"), "\tpassword for the administrative login")
.Add("a", "address", SGCONF::MakeParamAction(config, "<connection string>"), "connection params as a single string in format: <login>:<password>@<host>:<port>");
+blocks.Add("Debug options")
+ .Add("show-config", SGCONF::MakeParamAction(config.showConfig), "\tshow config and exit");
SGCONF::AppendXMLOptionBlock(commands, blocks);
+SGCONF::AppendServerInfoBlock(commands, blocks);
SGCONF::AppendAdminsOptionBlock(commands, blocks);
SGCONF::AppendTariffsOptionBlock(commands, blocks);
SGCONF::AppendUsersOptionBlock(commands, blocks);
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)