On Tue, May 30, 2017 at 08:45:53PM +0000, Ævar Arnfjörð Bjarmason wrote: > On Tue, May 30, 2017 at 7:17 AM, Jeff King <peff@xxxxxxxx> wrote: > > The "git version" command didn't traditionally accept any > > options, and in fact ignores any you give it. When we added > > simple option parsing for "--build-options" in 6b9c38e14, we > > didn't improve this; we just loop over the arguments and > > pick out the one we recognize. > > > > Instead, let's move to a real parsing loop, complain about > > nonsense options, and recognize conventions like "-h". > > > > Signed-off-by: Jeff King <peff@xxxxxxxx> > > --- > > I assume nobody was running "git version --foobar" and expecting it to > > work. I guess we could also complain about "git version foobar" (no > > dashes), but this patch doesn't. Mainly I wanted the auto-generated > > options list. > > Looks good to me. I started hacking this up the other day, but then > thought "wait a minute, isn't this just a test helper?" and wrote this > which I've rebased on top of your change. > > I may be missing something here but isn't this a much straightforward > way to accomplish this, or is this used by some external program > outside of git.git that's going to rely on --build-options output? My intent in putting it into the actual git binary was that it could also be useful for collecting build-time knobs from users (who may be using a binary package). Like: http://public-inbox.org/git/20160712035719.GA30281@xxxxxxxxxxxxxxxxxxxxx/ We haven't filled in that NEEDSWORK yet, but I'd rather see us go in that direction than remove the option entirely. -Peff