git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fish: Make '-x' option enable traces instead of using separate echo path.
[libguestfs.git]
/
fish
/
fish.c
diff --git
a/fish/fish.c
b/fish/fish.c
index
61a8405
..
3f798fd
100644
(file)
--- a/
fish/fish.c
+++ b/
fish/fish.c
@@
-69,7
+69,6
@@
guestfs_h *g;
int read_only = 0;
int quit = 0;
int verbose = 0;
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;
int remote_control_listen = 0;
int remote_control = 0;
int exit_on_error = 1;
@@
-324,7
+323,7
@@
main (int argc, char *argv[])
exit (EXIT_SUCCESS);
case 'x':
exit (EXIT_SUCCESS);
case 'x':
-
echo_commands = 1
;
+
guestfs_set_trace (g, 1)
;
break;
case HELP_OPTION:
break;
case HELP_OPTION:
@@
-380,6
+379,8
@@
main (int argc, char *argv[])
strcat (cmd, " -v");
if (!guestfs_get_autosync (g))
strcat (cmd, " -n");
strcat (cmd, " -v");
if (!guestfs_get_autosync (g))
strcat (cmd, " -n");
+ if (guestfs_get_trace (g))
+ strcat (cmd, " -x");
if (verbose)
fprintf (stderr,
if (verbose)
fprintf (stderr,
@@
-805,13
+806,6
@@
issue_command (const char *cmd, char *argv[], const char *pipecmd)
/* This counts the commands issued, starting at 1. */
command_num++;
/* 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];
/* For | ... commands. Annoyingly we can't use popen(3) here. */
if (pipecmd) {
int fd[2];