cat: Fix documentation of -x option in usage.
[libguestfs.git] / cat / virt-cat.c
index 3510a94..ebae895 100644 (file)
@@ -69,7 +69,7 @@ usage (int status)
              "  --keys-from-stdin    Read passphrases from stdin\n"
              "  -v|--verbose         Verbose messages\n"
              "  -V|--version         Display version and exit\n"
-             "  -x                   Echo each command before executing it\n"
+             "  -x                   Trace libguestfs API calls\n"
              "For more information, see the manpage %s(1).\n"),
              program_name, program_name, program_name,
              program_name);
@@ -237,13 +237,15 @@ main (int argc, char *argv[])
   /* Free up data structures, no longer needed after this point. */
   free_drives (drvs);
 
+  unsigned errors = 0;
+
   while (optind < argc) {
     if (guestfs_download (g, argv[optind], "/dev/stdout") == -1)
-      exit (EXIT_FAILURE);
+      errors++;
     optind++;
   }
 
   guestfs_close (g);
 
-  exit (EXIT_SUCCESS);
+  exit (errors == 0 ? EXIT_SUCCESS : EXIT_FAILURE);
 }