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@mail.gmail.com/ (local);
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.