X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/e9d45351deaf9ce85a9f1ee116f1f62988322e84..7723eaf21d7d3d0d865545a890d74f3724bf23d2:/projects/sgconf/main.cpp diff --git a/projects/sgconf/main.cpp b/projects/sgconf/main.cpp index 3280e336..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); @@ -1240,7 +1251,7 @@ SGCONF::OPTION_BLOCK & block = blocks.Add("Connection options") .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::MakeConfAction(), "\t\tmake raw XML request") + .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())