X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fish%2Ffish.c;h=48ba4590dab1eb690c842b42317c36da74317880;hb=00dcc4084e1f581d6eb98508431c51c83ae014b4;hp=61a84050df4f2dd047ed52bf49bcf49e2a3afdcb;hpb=e4d115487ea5bc454a5afc5ed22c3519f27076c8;p=libguestfs.git diff --git a/fish/fish.c b/fish/fish.c index 61a8405..48ba459 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -61,7 +61,9 @@ static void script (int prompt); static void cmdline (char *argv[], int optind, int argc); static void initialize_readline (void); static void cleanup_readline (void); +#ifdef HAVE_LIBREADLINE static void add_history_line (const char *); +#endif /* Currently open libguestfs handle. */ guestfs_h *g; @@ -69,7 +71,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; @@ -324,7 +325,7 @@ main (int argc, char *argv[]) exit (EXIT_SUCCESS); case 'x': - echo_commands = 1; + guestfs_set_trace (g, 1); break; case HELP_OPTION: @@ -380,6 +381,8 @@ main (int argc, char *argv[]) strcat (cmd, " -v"); if (!guestfs_get_autosync (g)) strcat (cmd, " -n"); + if (guestfs_get_trace (g)) + strcat (cmd, " -x"); if (verbose) fprintf (stderr, @@ -805,13 +808,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]; @@ -1344,14 +1340,14 @@ cleanup_readline (void) #endif } +#ifdef HAVE_LIBREADLINE static void add_history_line (const char *line) { -#ifdef HAVE_LIBREADLINE add_history (line); nr_history_lines++; -#endif } +#endif int xwrite (int fd, const void *v_buf, size_t len)