aboutsummaryrefslogtreecommitdiff
path: root/parse-options.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-11-27 19:24:11 -0800
committerJunio C Hamano <gitster@pobox.com>2008-11-27 19:24:11 -0800
commit98cdf78c5cf1356757ccc4d25c212ae1f38339e4 (patch)
tree8c9936b21070e664e36f2b5e61b96e371f1a50f6 /parse-options.c
parent496db64202b11e66a080873ca9e32f1354dcfd3e (diff)
parentc6576f912fc34193a02d7ec587484f7c2ce3fe77 (diff)
downloadgit-98cdf78c5cf1356757ccc4d25c212ae1f38339e4.tar.xz
Merge branch 'ta/quiet-pull'
* ta/quiet-pull: Retain multiple -q/-v occurrences in git pull Teach/Fix pull/fetch -q/-v options
Diffstat (limited to 'parse-options.c')
-rw-r--r--parse-options.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/parse-options.c b/parse-options.c
index fd08bb425c..9eb55cc8b5 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -484,6 +484,28 @@ int parse_opt_approxidate_cb(const struct option *opt, const char *arg,
return 0;
}
+int parse_opt_verbosity_cb(const struct option *opt, const char *arg,
+ int unset)
+{
+ int *target = opt->value;
+
+ if (unset)
+ /* --no-quiet, --no-verbose */
+ *target = 0;
+ else if (opt->short_name == 'v') {
+ if (*target >= 0)
+ (*target)++;
+ else
+ *target = 1;
+ } else {
+ if (*target <= 0)
+ (*target)--;
+ else
+ *target = -1;
+ }
+ return 0;
+}
+
/*
* This should really be OPTION_FILENAME type as a part of
* parse_options that take prefix to do this while parsing.