Skip to content
Snippets Groups Projects
Commit 47cc0a1c authored by Steven Murray's avatar Steven Murray
Browse files

Improved the 'Invalid number of command-line arguments' message of cta-rdbmsUnitTests

parent 3cd05779
Branches
Tags
No related merge requests found
...@@ -41,8 +41,13 @@ static void printUsage(std::ostream &os) { ...@@ -41,8 +41,13 @@ static void printUsage(std::ostream &os) {
* command-line. * command-line.
*/ */
static RdbmsUnitTestsCmdLineArgs parseCmdLine(const int argc, char ** argv) { static RdbmsUnitTestsCmdLineArgs parseCmdLine(const int argc, char ** argv) {
if(argc != 2) { const int expectedNbArgs = 1;
std::cerr << "Invalid number of command-line arguments"; const int actualNbArgs = argc - 1;
if(expectedNbArgs != actualNbArgs) {
std::cerr << "Invalid number of command-line arguments: expected=" << expectedNbArgs << " actual=" << actualNbArgs
<< std::endl;
std::cerr << std::endl;
printUsage(std::cerr); printUsage(std::cerr);
exit(1); exit(1);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment