Re: [PATCH v2 04/20] t0040-parse-options: test parse_options() with various 'parse_opt_flags'
- From
SZEDER Gábor <szeder.dev@gmail.com>
- Date
- Aug 20, 2022, 10:31 UTC
- Message-ID
- <20220820103128.GD3373722@szeder.dev>
- In-Reply-To
- <xmqqczcwksgj.fsf@gitster.g>
On Fri, Aug 19, 2022 at 11:18:20AM -0700, Junio C Hamano wrote:
Show 9 quoted lines
> SZEDER Gábor <szeder.dev@gmail.com> 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