Re: [RFH] convert shortlog to use parse_options
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 17, 2007, 07:59 UTC
- Message-ID
- <7v3au1eopr.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <47662715.9070200@op5.se>
Andreas Ericsson <ae@op5.se> writes:
Show 10 quoted lines
> Junio C Hamano wrote: > >> ... The >> "must stick" restriction feels Ok on paper but in practice it looks >> rather draconian and very user unfriendly. > > Usually, optional arguments warrant adding a second parameter. This can > often even improve usability, as it's never unclear or ambiguous what's > happening. For the 'git tag -l' case, I'd use something like > 'git tag -l --match="regex"' or some such,...
That is essentially arguing for POSIXly correct "do not allow optional option-arguments" (utility syntax guidelines #7). That position might be politically correct, but I am already discussing beyond that: usability.
For "git tag -l", the fix was rather simple, as the option would either have taken a zero pattern (list all) or a single pattern (list matching this pattern), and the command itself did not take any extra arguments, so that was what I did in the patch. Compare your POSIXly correct version:
git tag -l (ok)
git tag -l pattern (not ok)
git tag -l --match=pattern (ok)with the traditional (and fixed):
git tag -l (ok)
git tag -l pattern (ok)
git tag -l pattern garbage (not ok)Which one is easier for the user?