summaryrefslogtreecommitdiff
path: root/parse-options.c
diff options
context:
space:
mode:
authorMichele Ballabio <barra_cuda@katamail.com>2008-03-24 14:02:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-03-27 20:55:15 (GMT)
commit1f4a711a05e00db81da552dd990f6ddff4ffb63e (patch)
treeafa79d66e796ca0ea45409979b6ee915a83e2c97 /parse-options.c
parent1768905b51601d5d080168059acd24d13b888a2d (diff)
downloadgit-1f4a711a05e00db81da552dd990f6ddff4ffb63e.zip
git-1f4a711a05e00db81da552dd990f6ddff4ffb63e.tar.gz
git-1f4a711a05e00db81da552dd990f6ddff4ffb63e.tar.bz2
parse-options.c: introduce OPT_DATE
There are quite a few places that will need to call approxidate(), when they'll adopt the parse-options system, so this patch adds the function parse_opt_approxidate_cb(), used by OPT_DATE. Signed-off-by: Michele Ballabio <barra_cuda@katamail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'parse-options.c')
-rw-r--r--parse-options.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/parse-options.c b/parse-options.c
index 8e64316..e87cafb 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -409,3 +409,10 @@ int parse_opt_abbrev_cb(const struct option *opt, const char *arg, int unset)
*(int *)(opt->value) = v;
return 0;
}
+
+int parse_opt_approxidate_cb(const struct option *opt, const char *arg,
+ int unset)
+{
+ *(unsigned long *)(opt->value) = approxidate(arg);
+ return 0;
+}