X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/7766e753fefb962209f1898a234053f8c7bbe59d..f7795445d9e0dd2282b336c89ebe117a2b71a88e:/projects/sgconf/corps.cpp diff --git a/projects/sgconf/corps.cpp b/projects/sgconf/corps.cpp index b48a7c71..82673377 100644 --- a/projects/sgconf/corps.cpp +++ b/projects/sgconf/corps.cpp @@ -29,6 +29,13 @@ std::cout << Indent(level, true) << "name: " << info.name << "\n" << Indent(level) << "cash: " << info.cash << "\n"; } +std::vector GetCorpParams() +{ +std::vector params; +params.push_back(SGCONF::API_ACTION::PARAM("cash", "", "\tcorporation's cash")); +return params; +} + void SimpleCallback(bool result, const std::string & reason, void * /*data*/) @@ -124,10 +131,11 @@ return false; void SGCONF::AppendCorpsOptionBlock(COMMANDS & commands, OPTION_BLOCKS & blocks) { +std::vector params(GetCorpParams()); blocks.Add("Corporation management options") .Add("get-corps", SGCONF::MakeAPIAction(commands, GetCorpsFunction), "\tget corporation list") - .Add("get-corp", SGCONF::MakeAPIAction(commands, "", true, GetCorpFunction), "get corporation") - .Add("add-corp", SGCONF::MakeAPIAction(commands, "", true, AddCorpFunction), "add corporation") - .Add("del-corp", SGCONF::MakeAPIAction(commands, "", true, DelCorpFunction), "del corporation") - .Add("chg-corp", SGCONF::MakeAPIAction(commands, "", true, ChgCorpFunction), "change corporation"); + .Add("get-corp", SGCONF::MakeAPIAction(commands, "", GetCorpFunction), "get corporation") + .Add("add-corp", SGCONF::MakeAPIAction(commands, "", params, AddCorpFunction), "add corporation") + .Add("del-corp", SGCONF::MakeAPIAction(commands, "", DelCorpFunction), "del corporation") + .Add("chg-corp", SGCONF::MakeAPIAction(commands, "", params, ChgCorpFunction), "change corporation"); }