Re: [PATCH 09/20] parse-options: add support for parsing subcommands

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

 



On Mon, Jul 25, 2022 at 09:41:52PM +0200, Ævar Arnfjörð Bjarmason wrote:
> >> > +		error("'cmd' is mandatory");
> >> > +		usage_with_options(usage, test_flag_options);
> >> 
> >> nit: I think you want usage_msg_optf() or usage_msg_opt().
> >
> > Maybe... but I don't know what they do ;)  Though I remember removing
> > a couple of similar error() and usage_with_options() pairs from the
> > builtin commands.
> 
> It's just helpers for "usage_with_options, except with a message, e.g.:
> 
> 	$ ./git cat-file a b c
> 	fatal: only two arguments allowed in <type> <object> mode, not 3
> 
> 	usage: git cat-file <type> <object>

I've looked them up in the meantime.  The problem is that they both
output the given message with a "fatal:" prefix, but option parsing
related errors are usually prefixed with "error:".




[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]

  Powered by Linux