+int
+executeRetrace(const std::vector<const char *> & opts,
+ const char *traceName) {
+ trace::API api = guessApi(traceName);
+ return executeRetrace(opts, traceName, api);
+}
+
+
+static const char *synopsis = "Replay a trace.";
+
+static void
+usage(void)
+{
+ std::vector<const char *>opts;
+ opts.push_back("--help");
+ trace::API api = trace::API_GL;
+ executeRetrace(opts, NULL, api);
+}
+
+static int
+command(int argc, char *argv[])
+{
+ std::vector<const char *> opts;
+ for (int i = 1; i < argc; ++i) {
+ opts.push_back(argv[i]);
+ }
+
+ trace::API api = trace::API_GL;
+ if (argc >= 1) {
+ const char *lastArg = argv[argc -1];
+ if (lastArg[0] != '-') {
+ api = guessApi(lastArg);
+ }
+ }
+
+ return executeRetrace(opts, NULL, api);
+}
+