Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

Re: [PATCH 1/2] parse_options: Add flag to prevent errors for further processing

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:44:47

Hi,

On Tue, 17 Jun 2008, Junio C Hamano wrote:
Jeff King [off-list ref] writes:
quoted
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.
AFAIR Pierre tried a few ways, and settled with a macro to introduce the 
diff options into a caller's options.

IOW it would look something like this:

static struct option builtin_what_options[] = {
	[... options specific to this command ...]
	DIFF__OPT(&diff_options)
};

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help