Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> wrote: > But in this case there's really a much easier way to do this, to just > extend something like this: > ... > See b6c2a0d45d4 (parse-options: make sure argh string does not have SP > or _, 2014-03-23) for the existing code shown in the context where we > already check "argh" like that, i.e. we're just missing a test for > "help". > > Obviously such a function would need to hardcode some of the logic you > added in your shellscript. E.g. this fires on a string ending in "...", > but yours doesn't. Hello Ævar, I have some query related to this method. I have implemented the logic locally and tests are also passing. However, I think the test you mentioned is only running against the builtin files and files that are used in builtin commands (e.g. `diff.c`, `builtin/add.c` etc.). But some files from `t/helper` (e.g. t/helper/test-run-command.c) also uses parse option API and it seems that there are no test files (pardon me if I am wrong) for checking `parse option usage strings check` for `t/helper` test-tool commands. E.g. `grep -r --include="*.c" 'struct option .*\[] = {$' .` command gives the following output - ./helper/test-parse-options.c: struct option options[] = { ./helper/test-lazy-init-name-hash.c: struct option options[] = { ./helper/test-serve-v2.c: struct option options[] = { ./helper/test-simple-ipc.c: struct option options[] = { ./helper/test-parse-pathspec-file.c: struct option options[] = { ./helper/test-getcwd.c: struct option options[] = { ./helper/test-run-command.c: struct option options[] = { ./helper/test-run-command.c: struct option options[] = { ./helper/test-proc-receive.c: struct option options[] = { ./helper/test-progress.c: struct option options[] = { ./helper/test-tool.c: struct option options[] = { So, these files are using parse-options and there is a chance that in future, usage strings from these files may violate the style guide. In this case, all tests will be passing even if there are some style violations. What do you think? Thanks :)