Re: [PATCH 1/2] parse_options: Add flag to prevent errors for further processing
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 18, 2008, 05:13 UTC
- Message-ID
- <7vwskn1g2p.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <20080618033010.GA19657@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> I think the only right way to accomplish this is to convert the revision > and diff parameters into a parseopt-understandable format.
Not necessarily. You could structure individual option parsers like how diff option parsers are done. You iterate over argv[], feed diff option parser the current index into argv[] and ask if it is an option diff understands, have diff eat the option (and possibly its parameter) to advance the index, or allow diff option to say "I do not understand this", and then handle it yourself or hand it to other parsers.