Re: [PATCH] add usage-strings ci check and amend remaining usage strings
- From
Abhradeep Chakraborty <chakrabortyabhradeep79@gmail.com>
- Date
- Feb 21, 2022, 17:33 UTC
- Message-ID
- <20220221173357.8622-1-chakrabortyabhradeep79@gmail.com>
- In-Reply-To
- <220221.86tucsb4oy.gmgdl@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
> Sorry about leaving this patch submission hanging. I read this at the > time, but forgot to find time to loop back to it.
No worries. Thanks for reviewing :)
Show 11 quoted lines
> 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.
Thank you so much for the suggestion. Didn't aware of it before. I will try to implement the logic in parse-options.c` (as you suggested).
> That should be fairly easy to do though, and if not we could always just
> dump these to stderr or something if a
> git_env_bool("GIT_TEST_PARSE_OPTIONS_DUMP_FIELD_HELP", 0) was true, and
> do the testing itself in t0012-help.sh.Okay but if the logic can't be implented in the `parse-options.c` file (most probably I will be able to implement the logic), would you allow me to try the `coccinelle script` method you mentioned?
Thanks :)