update per design review

This commit is contained in:
David Cermak
2021-03-24 21:06:27 +01:00
parent a93cb68078
commit 8314e163fa
12 changed files with 228 additions and 94 deletions

View File

@ -33,6 +33,9 @@ void ConsoleCommand::RegisterCommand(const char* command, const char* help, std:
case INT1:
common_arg = arg_int1(it.shortopts, it.longopts, it.datatype, it.glossary);
break;
case LIT0:
common_arg = arg_lit0(it.shortopts, it.longopts, it.glossary);
break;
}
if (common_arg) {
arg_table.emplace_back(common_arg);
@ -67,6 +70,13 @@ std::string ConsoleCommand::get_string(int index)
return std::string();
}
int ConsoleCommand::get_int(int index)
{
if (get_count(index) > 0) {
return *((struct arg_int *)arg_table[index])->ival;
}
return -1;
}
std::vector<ConsoleCommand*> ConsoleCommand::console_commands;