Re: [RFH] convert shortlog to use parse_options
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 14, 2007, 20:34 UTC
- Message-ID
- <7v63z1qakt.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <20071214083943.GA24475@artemis.madism.org>
Pierre Habouzit <madcoder@debian.org> writes:
> On Fri, Dec 14, 2007 at 05:59:52AM +0000, Junio C Hamano wrote: >> git cmd --abbrev=10 -n=4 > > actually -n=4 isn't understood atm, only -n4 and -n 4 are.
Ah, my mistake. And I do not think accepting -n=4 is a good idea (it is not historically done).
After thinking about it a bit more, I think I was worried too much about burdening the users to remember the differences between options with, without and optional option-arguments [*1*]. They need to know the difference between options with and without option-arguments already because single letter options can be combined if they are without option-arguments, and they have to write "shortlog -new72" but not "shortlog -wen72". If they want to be extra sure, they can be more explicit and say "shortlog -n -e -w72".
So let's go with the version you outlined --- options that take optional option-arguments must get their option-arguments stuck to them, but otherwise option-arguments can also be given as a separate word that follows the option.
[Footnote]
*1* The fact some of our commands support options with optional option-arguments is already against Guideline #7 in "12.2 Utility Syntax Guidelines", so other POSIX guidelines are not useful for us in deciding what behaviour to model after.