]> git.tdb.fi Git - libs/test.git/commitdiff
Use GetOpt's positional arguments
authorMikko Rasa <tdb@tdb.fi>
Fri, 24 May 2013 12:29:29 +0000 (15:29 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 24 May 2013 12:29:29 +0000 (15:29 +0300)
source/runner.cpp

index a2c291e490b76631e4cc14c66f185635b76de5a2..c89f572a2c0d77af70b511b0bb029c7e084ef795 100644 (file)
@@ -15,10 +15,8 @@ Runner::Runner(int argc, char **argv):
        GetOpt getopt;
        getopt.add_option('v', "verbose", verbose,   GetOpt::NO_ARG).set_help("Show what is being done");
        getopt.add_option('l', "list",    show_list, GetOpt::NO_ARG).set_help("Print a list of available test cases");
+       getopt.add_argument("testcase", tests, GetOpt::OPTIONAL_ARG).set_help("Test case to run");
        getopt(argc, argv);
-
-       const vector<string> &args = getopt.get_args();
-       tests.assign(args.begin(), args.end());
 }
 
 int Runner::main()