]> git.cworth.org Git - apitrace/blobdiff - cli/cli_diff.cpp
Merge pull request #61 from prahal/gui-edit
[apitrace] / cli / cli_diff.cpp
index 11399a16b4c191f07c0372470b3a359ae2bfe6bb..0bd1b31f4f2c1c968b86a04d9a9470255023e57d 100644 (file)
@@ -29,8 +29,9 @@
 #include <iostream>
 
 #include "cli.hpp"
-#include "os_path.hpp"
-#include "trace_tools.hpp"
+#include "os_string.hpp"
+#include "os_process.hpp"
+#include "trace_resource.hpp"
 
 static const char *synopsis = "Identify differences between two traces.";
 
@@ -80,11 +81,7 @@ command(int argc, char *argv[])
     file1 = argv[i];
     file2 = argv[i+1];
 
-#define CLI_DIFF_TRACEDIFF_COMMAND "tracediff.sh"
-
-    os::Path command = trace::findFile("scripts/" CLI_DIFF_TRACEDIFF_COMMAND,
-                 APITRACE_SCRIPTS_INSTALL_DIR "/" CLI_DIFF_TRACEDIFF_COMMAND,
-                                       true);
+    os::String command = trace::findScript("tracediff.sh");
 
     char* args[4];
 
@@ -95,16 +92,13 @@ command(int argc, char *argv[])
 
 #ifdef _WIN32
     std::cerr << "The 'apitrace diff' command is not yet supported on this O/S.\n";
+    return 1;
 #else
-    os::Path apitrace = os::getProcessName();
+    os::String apitrace = os::getProcessName();
     setenv("APITRACE", apitrace.str(), 1);
 
-    execv(command.str(), args);
+    return os::execute(args);
 #endif
-
-    std::cerr << "Error: Failed to execute " << argv[0] << "\n";
-
-    return 1;
 }
 
 const Command diff_command = {