Commit bdddb08c authored by aligungr's avatar aligungr

PS establishment over CLI

parent 720e879b
......@@ -21,12 +21,14 @@
return nullptr; \
}
static opt::OptionsDescription Desc(const std::string &subCommand, const std::string &desc, const std::string &usage,
bool helpIfEmpty)
static opt::OptionsDescription DefaultDesc(const std::string &subCommand, const std::string &desc,
const std::string &usage, bool helpIfEmpty)
{
return {{}, {}, desc, {}, subCommand, {usage}, helpIfEmpty, true};
}
using DescType = decltype(&DefaultDesc);
class OptionsHandler : public opt::IOptionsHandler
{
public:
......@@ -63,6 +65,11 @@ static std::string DumpCommands(const OrderedMap<std::string, std::string> &desc
namespace app
{
static OrderedMap<std::string, DescType> g_gnbCmdToDescFunc = {
{"status", DefaultDesc}, {"info", DefaultDesc}, {"amf-list", DefaultDesc},
{"amf-info", DefaultDesc}, {"ue-list", DefaultDesc}, {"ue-count", DefaultDesc},
};
static OrderedMap<std::string, std::string> g_gnbCmdToDescription = {
{"status", "Show some status information about the gNB"},
{"info", "Show some information about the gNB"},
......@@ -80,6 +87,12 @@ static OrderedMap<std::string, bool> g_gnbCmdToHelpIfEmpty = {{"status", false},
{"amf-list", false}, {"amf-info", true},
{"ue-list", false}, {"ue-count", false}};
static OrderedMap<std::string, DescType> g_ueCmdToDescFunc = {
{"info", DefaultDesc}, {"status", DefaultDesc}, {"timers", DefaultDesc},
{"deregister", DefaultDesc}, {"ps-establish", DefaultDesc}, {"ps-release", DefaultDesc},
{"ps-release-all", DefaultDesc},
};
static OrderedMap<std::string, std::string> g_ueCmdToDescription = {
{"info", "Show some information about the UE"},
{"status", "Show some status information about the UE"},
......@@ -126,8 +139,8 @@ std::unique_ptr<GnbCliCommand> ParseGnbCliCommand(std::vector<std::string> &&tok
return nullptr;
}
opt::OptionsDescription desc =
Desc(subCmd, g_gnbCmdToDescription[subCmd], g_gnbCmdToUsage[subCmd], g_gnbCmdToHelpIfEmpty[subCmd]);
opt::OptionsDescription desc = g_gnbCmdToDescFunc[subCmd](subCmd, g_gnbCmdToDescription[subCmd],
g_gnbCmdToUsage[subCmd], g_gnbCmdToHelpIfEmpty[subCmd]);
OptionsHandler handler{};
......@@ -201,8 +214,8 @@ std::unique_ptr<UeCliCommand> ParseUeCliCommand(std::vector<std::string> &&token
return nullptr;
}
opt::OptionsDescription desc =
Desc(subCmd, g_ueCmdToDescription[subCmd], g_ueCmdToUsage[subCmd], g_ueCmdToHelpIfEmpty[subCmd]);
opt::OptionsDescription desc = g_ueCmdToDescFunc[subCmd](subCmd, g_ueCmdToDescription[subCmd],
g_ueCmdToUsage[subCmd], g_ueCmdToHelpIfEmpty[subCmd]);
OptionsHandler handler{};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment