Module Name: src
Committed By: wiz
Date: Fri Sep 4 14:23:24 UTC 2009
Modified Files:
src/usr.bin/unzip: unzip.c
Log Message:
Make output for -v/-l match Infozip unzip more closely.
Mention archive name, like Infozip unzip.
Add missing options to usage.
Ok joerg@
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/unzip/unzip.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/unzip/unzip.c
diff -u src/usr.bin/unzip/unzip.c:1.5 src/usr.bin/unzip/unzip.c:1.6
--- src/usr.bin/unzip/unzip.c:1.5 Fri Sep 4 13:02:52 2009
+++ src/usr.bin/unzip/unzip.c Fri Sep 4 14:23:24 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: unzip.c,v 1.5 2009/09/04 13:02:52 joerg Exp $ */
+/* $NetBSD: unzip.c,v 1.6 2009/09/04 14:23:24 wiz Exp $ */
/*-
* Copyright (c) 2009 Joerg Sonnenberger <[email protected]>
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: unzip.c,v 1.5 2009/09/04 13:02:52 joerg Exp $");
+__RCSID("$NetBSD: unzip.c,v 1.6 2009/09/04 14:23:24 wiz Exp $");
#include <sys/queue.h>
#include <sys/stat.h>
@@ -463,7 +463,7 @@
error("open('%s')", path);
/* loop over file contents and write to disk */
- info("x %s", path);
+ info(" extracting: %s", path);
text = a_opt;
warn = 0;
cr = 0;
@@ -762,7 +762,7 @@
(uintmax_t)archive_entry_size(e),
buf, archive_entry_pathname(e));
} else if (v_opt == 2) {
- printf("%8ju Stored %7ju 0%% %s %08x %s\n",
+ printf("%8ju Stored %7ju 0%% %s %08x %s\n",
(uintmax_t)archive_entry_size(e),
(uintmax_t)archive_entry_size(e),
buf,
@@ -817,12 +817,13 @@
ac(archive_read_support_format_zip(a));
ac(archive_read_open_fd(a, fd, 8192));
+ printf("Archive: %s\n", fn);
if (v_opt == 1) {
- printf(" Length Date Time Name\n");
- printf(" -------- ---- ---- ----\n");
+ printf(" Length Date Time Name\n");
+ printf(" -------- ---- ---- ----\n");
} else if (v_opt == 2) {
- printf(" Length Method Size Ratio Date Time CRC-32 Name\n");
- printf("-------- ------ ------- ----- ---- ---- ------ ----\n");
+ printf(" Length Method Size Ratio Date Time CRC-32 Name\n");
+ printf("-------- ------ ------- ----- ---- ---- ------ ----\n");
}
total_size = 0;
@@ -850,8 +851,8 @@
printf(" %8ju %ju file%s\n",
total_size, file_count, file_count != 1 ? "s" : "");
} else if (v_opt == 2) {
- printf("-------- ------- --- -------\n");
- printf("%8ju %7ju 0%% %ju file%s\n",
+ printf("-------- ------- --- -------\n");
+ printf("%8ju %7ju 0%% %ju file%s\n",
total_size, total_size, file_count,
file_count != 1 ? "s" : "");
}
@@ -869,7 +870,7 @@
usage(void)
{
- fprintf(stderr, "usage: unzip [-ajLlnoqtu] [-d dir] zipfile\n");
+ fprintf(stderr, "usage: unzip [-acfjLlnopqtuv] [-d dir] [-x pattern] zipfile\n");
exit(1);
}