CommandLine parser initial

This commit is contained in:
IlushaShurupov 2023-07-15 13:12:51 +03:00 committed by Ilya Shurupov
parent 3846b91662
commit f5cab30f21
11 changed files with 592 additions and 22 deletions

View file

@ -0,0 +1,23 @@
#include "Tests.hpp"
using namespace tp;
static CommandLine createCmdLine() {
CommandLine cmd({
{ "bool", CommandLine::Arg::BOOL },
{ "int", CommandLine::Arg::INT },
{ "string", CommandLine::Arg::STR },
{ "float", CommandLine::Arg::FLOAT },
});
return cmd;
}
TEST_DEF_STATIC(Simple) {
auto cmd = createCmdLine();
const char* args[] = { "false", "2", "'str'", "-0.15" };
cmd.parse(4, args, true, 0);
}
TEST_DEF(CommandLine) {
testSimple();
}