Re: [PATCH v2 04/20] t0040-parse-options: test parse_options() with various 'parse_opt_flags'

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

 



On Fri, Aug 19, 2022 at 11:18:20AM -0700, Junio C Hamano wrote:
> SZEDER Gábor <szeder.dev@xxxxxxxxx> writes:
> 
> > +static void print_args(int argc, const char **argv)
> > +{
> > +	for (int i = 0; i < argc; i++)
> > +		printf("arg %02d: %s\n", i, argv[i]);
> > +}
> 
> It is not November 2022 yet (cf. Documentation/CodingGuidelines).

Oh, I've misunderstood Ævar's remarks about this in the previous
round, and thought it's fair game.

> Curious why "%02d", not "%d", or autoscale for cases where argc is
> larger than 99, but I'll let it pass (iow no need to reroll only to
> "fix" it).

It doesn't matter for these tests, but 'test-tool parse-options' uses
the same format to print args:

  $ ./t/helper/test-tool parse-options foo bar baz |tail -n3
  arg 00: foo
  arg 01: bar
  arg 02: baz




[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