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, SZEDER Gábor wrote:

> +	for (int i = 0; i < argc; i++)

See
https://lore.kernel.org/git/CABPp-BHvQwct2WRRYGyzm=YVkjmwBqoe1DUtCicuQW=jrQ2hdA@xxxxxxxxxxxxxx/;
but maybe nothing to to be done here...

> +	if (argc == 0 || strcmp(argv[0], "cmd")) {

Nit: !argc
> +		error("'cmd' is mandatory");
> +		usage_with_options(usage, test_flag_options);

I think you want usage_msg_opt() instead.

> +test_expect_success 'NO_INTERNAL_HELP works for -h' '
> +	test_expect_code 129 test-tool parse-options-flags --no-internal-help cmd -h 2>err &&
> +	cat err &&

Stray "cat", presumably in error..

> +	grep "^error: unknown switch \`h$SQ" err &&
> +	grep "^usage: " err
> +'
> +
> +for help_opt in help help-all
> +do
> +	test_expect_success "NO_INTERNAL_HELP works for --$help_opt" "
> +		test_expect_code 129 test-tool parse-options-flags --no-internal-help cmd --$help_opt 2>err &&
> +		cat err &&

ditto.





[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