prune-trace: pruners may add own command-line switches
Change-Id: I23293e7e6cf8ab1c3456337ba5e4af9b5e106ccb
This commit is contained in:
@ -18,6 +18,12 @@ public:
|
|||||||
const std::vector<std::string>& benchmarks,
|
const std::vector<std::string>& benchmarks,
|
||||||
const std::vector<std::string>& benchmarks_exclude);
|
const std::vector<std::string>& benchmarks_exclude);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback function that can be used to add command line options
|
||||||
|
* to the cmd interface
|
||||||
|
*/
|
||||||
|
virtual bool commandline_init() { return true; }
|
||||||
|
|
||||||
virtual std::string method_name() = 0;
|
virtual std::string method_name() = 0;
|
||||||
|
|
||||||
virtual bool create_database();
|
virtual bool create_database();
|
||||||
|
|||||||
@ -70,6 +70,14 @@ int main(int argc, char *argv[]) {
|
|||||||
pruner = new BasicPruner();
|
pruner = new BasicPruner();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pruner && !(pruner->commandline_init())) {
|
||||||
|
std::cerr << "Pruner's commandline initialization failed" << std::endl;
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
// Since the pruner might have added command line options, we need to
|
||||||
|
// reparse all arguments.
|
||||||
|
cmd.parse();
|
||||||
|
|
||||||
if (cmd[HELP]) {
|
if (cmd[HELP]) {
|
||||||
cmd.printUsage();
|
cmd.printUsage();
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user