summaryrefslogtreecommitdiff
path: root/builtin-archive.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-09-09 22:42:02 -0700
committerJunio C Hamano <junkio@cox.net>2006-09-10 13:39:25 -0700
commite0ffb24877d4530208905512f7c91dd8d71e2c95 (patch)
treedf9d8046b159c0b2418e2a04c9eacb007517a936 /builtin-archive.c
parent8142f603b9955648228549d2e83ace7fbe834114 (diff)
downloadgit-e0ffb24877d4530208905512f7c91dd8d71e2c95.tar.gz
Add --verbose to git-archive
And teach backends about it. Signed-off-by: Junio C Hamano <junkio@cox.net> (cherry picked from 9e2c44a2893ae90944a0b7c9f40a9d22b759b5c0 commit)
Diffstat (limited to 'builtin-archive.c')
-rw-r--r--builtin-archive.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/builtin-archive.c b/builtin-archive.c
index 3a8be57e15..7544ad3ca1 100644
--- a/builtin-archive.c
+++ b/builtin-archive.c
@@ -12,7 +12,7 @@
#include "pkt-line.h"
static const char archive_usage[] = \
-"git-archive --format=<fmt> [--prefix=<prefix>/] [<extra>] <tree-ish> [path...]";
+"git-archive --format=<fmt> [--prefix=<prefix>/] [--verbose] [<extra>] <tree-ish> [path...]";
struct archiver archivers[] = {
{
@@ -148,6 +148,7 @@ int parse_archive_args(int argc, const char **argv, struct archiver *ar)
int extra_argc = 0;
const char *format = NULL; /* might want to default to "tar" */
const char *base = "";
+ int verbose = 0;
int i;
for (i = 1; i < argc; i++) {
@@ -158,6 +159,10 @@ int parse_archive_args(int argc, const char **argv, struct archiver *ar)
printf("%s\n", archivers[i].name);
exit(0);
}
+ if (!strcmp(arg, "--verbose") || !strcmp(arg, "-v")) {
+ verbose = 1;
+ continue;
+ }
if (!strncmp(arg, "--format=", 9)) {
format = arg + 9;
continue;
@@ -192,6 +197,7 @@ int parse_archive_args(int argc, const char **argv, struct archiver *ar)
die("%s", default_parse_extra(ar, extra_argv));
ar->args.extra = ar->parse_extra(extra_argc, extra_argv);
}
+ ar->args.verbose = verbose;
ar->args.base = base;
return i;