Added -- as command line argument terminator.

This commit is contained in:
Branimir Karadžić
2017-09-03 20:04:48 -07:00
parent 525801cdf8
commit 057f6b180c
2 changed files with 10 additions and 3 deletions

View File

@@ -15,12 +15,19 @@ TEST_CASE("commandLine", "")
"--long",
"--platform",
"x",
"--foo",
"--", // it should not parse arguments after argument terminator
"--bar",
};
bx::CommandLine cmdLine(BX_COUNTOF(args), args);
REQUIRE(cmdLine.hasArg("long") );
REQUIRE(cmdLine.hasArg('s') );
REQUIRE( cmdLine.hasArg("long") );
REQUIRE( cmdLine.hasArg('s') );
// test argument terminator
REQUIRE( cmdLine.hasArg("foo") );
REQUIRE(!cmdLine.hasArg("bar") );
// non-existing argument
REQUIRE(!cmdLine.hasArg('x') );