lunarmodules / busted

Elegant Lua unit testing.
https://lunarmodules.github.io/busted/
MIT License
1.38k stars 184 forks source link

Hack around cliargs to provide "help" flag #732

Open TheMagician23 opened 7 months ago

TheMagician23 commented 7 months ago

Fixes #697

This change adds a check on the error returned from the cliargs library, and provides a "help" argument to the consumer code in busted/runner.lua. It is based on the workaround used with the same library here: https://github.com/sile-typesetter/sile/pull/1737/files except that the code in busted/runner.lua probably won't need to change if cliargs ever supports adding a --help flag in the "correct" way.

alerque commented 7 months ago

The upstream for cli_args has (since this PR was started) migrated the project to this org. I proposed this a long time ago but this PR made me ping the author again and this time it happened. Now that we can fix upstream I think we should fix this issue at the source and then just use it correctly in this project.

TheMagician23 commented 7 months ago

Hi Caleb.

This is fantastic news! I saw that lua_cliargs badly needed to be migrated to lunarmodules when I did my intial research, I'm glad you managed to make it happen. I'll write a fix for the issue upstream soon; once it's done I'll comment on the issue in the busted repo with a link to the upstream fix. Once it's in, you can throw away my original PR. Let me know if you want me to write a proper usage patch for busted after that fix goes in.

Sent: Sunday, December 10, 2023 at 7:53 PM From: "Caleb Maclennan" @.> To: lunarmodules/busted @.> Cc: "The Magician" @.>, Author @.> Subject: Re: [lunarmodules/busted] Hack around cliargs to provide "help" flag (PR #732)

The upstream for cli_args has (since this PR was started) migrated the project to this org. I proposed this a long time ago but this PR made me ping the author again and this time it happened. Now that we can fix upstream I think we should fix this issue at the source and then just use it correctly in this project.

-- Reply to this email directly or view it on GitHub: https://github.com/lunarmodules/busted/pull/732#issuecomment-1849049581 You are receiving this because you authored the thread.

Message ID: @.***>

TheMagician23 commented 7 months ago

Okay, I've written a PR to improve the help system in lua_cliargs: https://github.com/lunarmodules/lua_cliargs/pull/78