1#ifndef LINTEL_COMMANDPARSER_H
2#define LINTEL_COMMANDPARSER_H
23 std::map<std::string, Command> m_commands;
24 std::map<std::string, ENUM> m_enumCommand;
25 static constexpr int32_t m_maxCommandPerLine = 10;
34 m_enumCommand.insert({
command.getCommand(), value });
41 m_enumCommand.insert({
command.getCommand(), value });
63 if (
found == m_commands.end()) {
64 os <<
"ERROR: " <<
command <<
" not available\n";
73 const std::string_view
alias,
75 std::ostream &
os = std::cout)
79 for (
const auto &
item : m_commands) {
90 for (
const auto &
item : m_commands) {
92 if (
i % m_maxCommandPerLine == 0) {
os <<
"\n"; }
94 if (
i % m_maxCommandPerLine > 0) {
os <<
"\t"; }
98 if (
i % m_maxCommandPerLine == 0) {
os <<
"\n"; }
100 if (
i % m_maxCommandPerLine > 0) {
os <<
"\t"; }
108 std::vector<std::string>
temp;
109 std::transform(m_commands.begin(),
111 std::back_inserter(
temp),
112 [](
const std::pair<std::string, Command> &
pair) -> std::string { return pair.second.getCommand(); });
Definition CommandParser.h:21
void printHelp(const std::string &command, std::ostream &os=std::cout)
Definition CommandParser.h:60
void printHelp(std::string_view componentName, const std::string_view alias, std::string_view description, std::ostream &os=std::cout)
Definition CommandParser.h:72
std::vector< std::string > allCommandsOf()
Definition CommandParser.h:106
void printCommandList(std::set< std::string > menuAlias, std::ostream &os=std::cout)
Definition CommandParser.h:86
void addCommand(const Command &command, ENUM value)
Definition CommandParser.h:31
ENUM parse(const std::string &command, const std::vector< std::string > &flags)
Definition CommandParser.h:50
void addCommand(Command &&command, ENUM value)
Definition CommandParser.h:38
Definition BaseFeature.h:6
constexpr std::string_view type_name()
Definition TypeName.h:9