X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/b3139bf3f37b3b0244efea8b4b5e5a7d0bc90095..69aaa0bd928ece0837c8e88441c80f1f8cf1fe38:/projects/sgconf/main.cpp?ds=sidebyside diff --git a/projects/sgconf/main.cpp b/projects/sgconf/main.cpp index a0ef89a1..2d39cb2c 100644 --- a/projects/sgconf/main.cpp +++ b/projects/sgconf/main.cpp @@ -23,6 +23,7 @@ #include "common_sg.h" #include "sg_error_codes.h" +#include "xml.h" #include "options.h" #include "actions.h" #include "config.h" @@ -134,6 +135,16 @@ array[pos] = value; return true; } +void RawXMLCallback(bool result, const std::string & reason, const std::string & response, void * data) +{ +if (!result) + { + std::cerr << "Failed to get raw XML response. Reason: '" << reason << "'." << std::endl; + return; + } +PrintXML(response); +} + void Usage(); void UsageAll(); void UsageImpl(bool full); @@ -1239,6 +1250,14 @@ 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("Raw XML") + .Add("r", "raw", SGCONF::MakeFunc1Action(), "\t\tmake raw XML request") +/*blocks.Add("Admins management options") + .Add("get-admins", SGCONF::MakeConfAction()) + .Add("get-admin", SGCONF::MakeConfAction()) + .Add("add-admin", SGCONF::MakeConfAction()) + .Add("del-admin", SGCONF::MakeConfAction()) + .Add("chg-admin", SGCONF::MakeConfAction());*/ SGCONF::PARSER_STATE state(false, argc, argv);