Jonathan Nieder [off-list ref] writes:
Jonathan Nieder wrote:
quoted
Here's a helper to make it easier for commands that use parse-options
to adopt that nicer behavior. It writes its output to stdout, so it
should only be used to be used to handle the -h option.
Alas, "git update-index" does not use parse-options yet. But that
is easily enough changed...
Patch 1 introduces an OPTION_LOWLEVEL_CALLBACK backdoor to
parse-options, so new option types (like the three-argument type
used by update-index --cacheinfo) can be supported without tempting
inventors of other commands through mention in the public API.
I like the idea of this one. I imagine it can also be used to finally
whip the command line parsing of "log -L" series Thomas mentored into a
reasonable shape, which needs to parse the -L option that takes <range>
and an optional <path> (not <pathspec>) as arguments.