cobra icon indicating copy to clipboard operation
cobra copied to clipboard

Command passed to SetHelpFunc doesn't have a context

Open Frassle opened this issue 2 days ago • 1 comments

When using SetHelpFunc the function gets given a Command object and you'd think you could use Context() to get the right context off the command, but it doesn't actually get set.

We hit this in pulumi: https://github.com/pulumi/pulumi/issues/18659

I can work around via just a context.Background call instead, but feels like this should just work as the parent "help" command does have a context.

Frassle avatar Feb 20 '25 14:02 Frassle