Re: Convert 'git blame' to parse_options()
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 23, 2008, 06:35 UTC
- Message-ID
- <7vr6aoirqh.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <alpine.LFD.1.10.0806222207220.2926@woody.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
> That builtin-blame option parsing is really ugly,...
Yeah, but wasn't it because it needed to be compatible with both annotate syntax and rev-list style "range" notation at the same time?
Show 10 quoted lines
> +static int blame_bottomtop_callback(const struct option *option, const char *arg, int unset)
> +{
> + const char **bottomtop = option->value;
> + if (!arg)
> + return -1;
> + if (*bottomtop)
> + die("More than one '-L n,m' option given");
> + *bottomtop = arg;
> + return 0;
> +}Hmmmm. I actually wanted to eventually allow more than one -L so that we can blame two functions inside a file, for example. Would this make it even harder, I have to wonder...