X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/7766e753fefb962209f1898a234053f8c7bbe59d..c00e81f9f50c4fe50ee32b02a689d68c9bc595b6:/projects/sgconf/services.cpp diff --git a/projects/sgconf/services.cpp b/projects/sgconf/services.cpp index ba490467..f5d73742 100644 --- a/projects/sgconf/services.cpp +++ b/projects/sgconf/services.cpp @@ -31,6 +31,15 @@ std::cout << Indent(level, true) << "name: " << info.name << "\n" << Indent(level) << "comment: " << info.comment << "\n"; } +std::vector GetServiceParams() +{ +std::vector params; +params.push_back(SGCONF::API_ACTION::PARAM("cost", "", "\tcost of the service")); +params.push_back(SGCONF::API_ACTION::PARAM("pay-day", "", "payment day")); +params.push_back(SGCONF::API_ACTION::PARAM("comment", "", "comment")); +return params; +} + void SimpleCallback(bool result, const std::string & reason, void * /*data*/) @@ -126,10 +135,11 @@ return false; void SGCONF::AppendServicesOptionBlock(COMMANDS & commands, OPTION_BLOCKS & blocks) { +std::vector params(GetServiceParams()); blocks.Add("Service management options") .Add("get-services", SGCONF::MakeAPIAction(commands, GetServicesFunction), "\tget service list") - .Add("get-service", SGCONF::MakeAPIAction(commands, "", true, GetServiceFunction), "get service") - .Add("add-service", SGCONF::MakeAPIAction(commands, "", true, AddServiceFunction), "add service") - .Add("del-service", SGCONF::MakeAPIAction(commands, "", true, DelServiceFunction), "del service") - .Add("chg-service", SGCONF::MakeAPIAction(commands, "", true, ChgServiceFunction), "change service"); + .Add("get-service", SGCONF::MakeAPIAction(commands, "", GetServiceFunction), "get service") + .Add("add-service", SGCONF::MakeAPIAction(commands, "", params, AddServiceFunction), "add service") + .Add("del-service", SGCONF::MakeAPIAction(commands, "", DelServiceFunction), "del service") + .Add("chg-service", SGCONF::MakeAPIAction(commands, "", params, ChgServiceFunction), "change service"); }