Re: [PATCH 09/13] revert: Catch incompatible command-line options early
- From
Ramkumar Ramachandra <artagnon@gmail.com>
- Date
- Jul 2, 2011, 09:47 UTC
- Message-ID
- <BANLkTinN6KdPnuMWbrdE4jf4ijKDC=35Aw@mail.gmail.com>
- In-Reply-To
- <20110621170416.GN15461@elie>
Hi again,
Jonathan Nieder writes:
Show 13 quoted lines
> Ramkumar Ramachandra wrote: >> Earlier, incompatible command-line options used to be caught in >> pick_commits after parse_args has parsed the options and populated the >> options structure. Instead, hand over the responsibility of catching >> incompatible command-line options to parse_args so that the program >> can die early. > > The "Earlier ... used to" phrasing is tripping me up again. > > The naive reader (i.e., me) wonders: how long does this option parsing > and populating the options structure that we want to delay until after > verify_opt_compatible take? Does that delay matter or is there some > other reason for this change?
I've tried to spell out the motivation for this change more clearly in my latest iteration. Does this look alright?
revert: Catch incompatible command-line options in parse_args
Some incompatible command-line options are caught in pick_commits
after parse_args has parsed the options and populated the options
structure. Change this so that parse_args only parses valid
command-line options instead of returning an unusable options
structure. However, this does not mean that we will never need to
check the options structure; when a sequencer API is written future,
callers will call in with a pre-populated options structure whose
validity we will still need to check. Also, provide a
verify_opt_compatible function to handle incompatible options in a
general manner.-- Ram