]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Expand verbose output with -x.
authorTim Kientzle <kientzle@acm.org>
Mon, 26 Jan 2015 05:30:08 +0000 (21:30 -0800)
committerTim Kientzle <kientzle@acm.org>
Mon, 26 Jan 2015 05:30:08 +0000 (21:30 -0800)
After this change:
  -xvv emits the detailed format used by -tv.
  -xv uses the SUSv2 format.
  -x without -v doesn't emit anything.

tar/read.c

index a4c063c7ee67e3ba9eca1344adb8587076f81bd6..8267b70e3a12c5378fd966169d087c7419ea9630 100644 (file)
@@ -335,11 +335,13 @@ read_archive(struct bsdtar *bsdtar, char mode, struct archive *writer)
                            !yes("extract '%s'", archive_entry_pathname(entry)))
                                continue;
 
-                       /*
-                        * Format here is from SUSv2, including the
-                        * deferred '\n'.
-                        */
-                       if (bsdtar->verbose) {
+                       if (bsdtar->verbose > 1) {
+                               /* GNU tar uses -tv format with -xvv */
+                               list_item_verbose(bsdtar, stderr, entry);
+                               fflush(stderr);
+                       } else if (bsdtar->verbose > 0) {
+                               /* Format follows SUSv2, including the
+                                * deferred '\n'. */
                                safe_fprintf(stderr, "x %s",
                                    archive_entry_pathname(entry));
                                fflush(stderr);