From 8e007581c91a5193e6aec0f6f9aeb379a935c9d4 Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Sat, 8 May 2010 09:04:28 +0100 Subject: [PATCH] fish: Make '-x' option enable traces instead of using separate echo path. Previously we had separate code paths for echoing commands (-x) and tracing (guestfs_set_trace). This just unifies that so that the guestfish -x option enables tracing. --- fish/fish.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/fish/fish.c b/fish/fish.c index a36ec09..2e8c751 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -72,7 +72,6 @@ guestfs_h *g; int read_only = 0; int quit = 0; int verbose = 0; -int echo_commands = 0; int remote_control_listen = 0; int remote_control = 0; int exit_on_error = 1; @@ -361,7 +360,7 @@ main (int argc, char *argv[]) exit (EXIT_SUCCESS); case 'x': - echo_commands = 1; + guestfs_set_trace (g, 1); break; case HELP_OPTION: @@ -857,13 +856,6 @@ issue_command (const char *cmd, char *argv[], const char *pipecmd) /* This counts the commands issued, starting at 1. */ command_num++; - if (echo_commands) { - printf ("%s", cmd); - for (i = 0; argv[i] != NULL; ++i) - printf (" %s", argv[i]); - printf ("\n"); - } - /* For | ... commands. Annoyingly we can't use popen(3) here. */ if (pipecmd) { int fd[2]; -- 1.8.3.1