desertbit / grumble

A powerful modern CLI and SHELL
MIT License
534 stars 55 forks source link

Adding an optional `context.Context` parameter to `App.RunCommand([]string)` #66

Open ovidiuf opened 1 week ago

ovidiuf commented 1 week ago

Adding an optional (to avoid breaking backward compatibility) context.Context parameter to App.RunCommand([]string) would enhance the testability of commands.

If you are open to the idea, I could write down a short proposal and/or send a PR.

ovidiuf commented 1 week ago

... or add a new RunCommandWithContext(...)

skaldesh commented 1 week ago

Sure, a PR is always welcome.
I am not certain, but this might be related to https://github.com/desertbit/grumble/issues/6

If that is the case, it could turn out to be tricky to actually get readline to abort its current read operation.