Re: [PATCH 4/5 v4] log: parse detached options like git log --grep foo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:
> this---the users won't miss the "--opt <string>" feature because that is
> not a common practice.
>
> And I was agreeing to that.

No, that would be not good -- GNU getopt_long supports that form, and
AFAICT, both the "--foo=bar" and "--foo bar" forms are widely used (I
certainly use both all the time), for roughly the same reasons both
"-Oarg" and "-O arg" are both common[*].

In the case of "optional-argument options", the "--foo bar" (and "-O
bar") form doesn't work, which is an unfortunate (but apparently
unavoidable) inconsistency, but optional-argument options are rare
enough that this doesn't really effect the usage patterns of more
conventional options.

[*] both forms are useful -- sometimes it's handy to bundle up the
option-argument with the option, e.g., when writing a throw-away script,
to avoid whitespace issues, but sometimes it's useful to keep it
separate, e.g. so that shell filename completion works on the
option-argument.

-Miles

-- 
Justice, n. A commodity which in a more or less adulterated condition the
State sells to the citizen as a reward for his allegiance, taxes and personal
service.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]