From: René Scharfe Date: Thu, 7 May 2009 19:46:48 +0000 (+0200) Subject: grep: use parseopt X-Git-Tag: v1.6.4-rc0~143^2~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3e230fa1b2ba3aa1a207c4399a1b93e41b103dfb;p=git.git grep: use parseopt Convert git-grep to parseopt. The bitfields in struct grep_opt are converted to full ints, increasing its size. This shouldn't be a problem as there is only a single instance in memory. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- diff --git a/builtin-grep.c b/builtin-grep.c index 620399f9a..169a91c17 100644 --- a/builtin-grep.c +++ b/builtin-grep.c @@ -10,6 +10,7 @@ #include "tag.h" #include "tree-walk.h" #include "builtin.h" +#include "parse-options.h" #include "grep.h" #ifndef NO_EXTERNAL_GREP @@ -20,6 +21,11 @@ #endif #endif +static char const * const grep_usage[] = { + "git grep [options] [-e] [...] [[--] path...]", + NULL +}; + static int grep_config(const char *var, const char *value, void *cb) { struct grep_opt *opt = cb; @@ -559,15 +565,86 @@ static int grep_object(struct grep_opt *opt, const char **paths, die("unable to grep from object of type %s", typename(obj->type)); } -static const char builtin_grep_usage[] = -"git grep