diff options
author | José Fonseca <jose.r.fonseca@gmail.com> | 2011-11-29 00:25:12 +0000 |
---|---|---|
committer | José Fonseca <jose.r.fonseca@gmail.com> | 2011-11-29 00:25:12 +0000 |
commit | a19a87e02f91dd0cf4d6217a5ea7125f8509ed85 (patch) | |
tree | 2e7fca2f993f88831d013a86589b1ceb39590bc5 /cli | |
parent | 97a199dc1340c4afa0c16cd608289c41655deb66 (diff) |
Refactor the code to find scripts.
Hopefully fixes scripts on Windows too, but untested yet.
Diffstat (limited to 'cli')
-rw-r--r-- | cli/cli_diff.cpp | 8 | ||||
-rw-r--r-- | cli/cli_diff_images.cpp | 9 | ||||
-rw-r--r-- | cli/cli_diff_state.cpp | 8 |
3 files changed, 6 insertions, 19 deletions
diff --git a/cli/cli_diff.cpp b/cli/cli_diff.cpp index d9d6257..0bd1b31 100644 --- a/cli/cli_diff.cpp +++ b/cli/cli_diff.cpp @@ -31,7 +31,7 @@ #include "cli.hpp" #include "os_string.hpp" #include "os_process.hpp" -#include "trace_tools.hpp" +#include "trace_resource.hpp" static const char *synopsis = "Identify differences between two traces."; @@ -81,11 +81,7 @@ command(int argc, char *argv[]) file1 = argv[i]; file2 = argv[i+1]; -#define CLI_DIFF_TRACEDIFF_COMMAND "tracediff.sh" - - os::String 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]; diff --git a/cli/cli_diff_images.cpp b/cli/cli_diff_images.cpp index 91f07c1..3b5507a 100644 --- a/cli/cli_diff_images.cpp +++ b/cli/cli_diff_images.cpp @@ -30,19 +30,14 @@ #include "cli.hpp" #include "os_string.hpp" -#include "trace_tools.hpp" +#include "trace_resource.hpp" static const char *synopsis = "Identify differences between two image dumps."; static os::String find_command(void) { -#define CLI_DIFF_IMAGES_COMMAND "snapdiff.py" - - return trace::findFile("scripts/" CLI_DIFF_IMAGES_COMMAND, - APITRACE_SCRIPTS_INSTALL_DIR "/" CLI_DIFF_IMAGES_COMMAND, - true); - + return trace::findScript("snapdiff.py"); } static void diff --git a/cli/cli_diff_state.cpp b/cli/cli_diff_state.cpp index 55d8083..8918d58 100644 --- a/cli/cli_diff_state.cpp +++ b/cli/cli_diff_state.cpp @@ -31,7 +31,7 @@ #include "cli.hpp" #include "os_string.hpp" #include "os_process.hpp" -#include "trace_tools.hpp" +#include "trace_resource.hpp" static const char *synopsis = "Identify differences between two state dumps."; @@ -81,11 +81,7 @@ command(int argc, char *argv[]) file1 = argv[i]; file2 = argv[i+1]; -#define CLI_DIFF_STATE_COMMAND "jsondiff.py" - - os::String command = trace::findFile("scripts/" CLI_DIFF_STATE_COMMAND, - APITRACE_SCRIPTS_INSTALL_DIR "/" CLI_DIFF_STATE_COMMAND, - true); + os::String command = trace::findScript("jsondiff.py"); char *args[5]; |