1

I'd like to be able to take the Long value of a Command from Cobra and modify it before it's returned to the user when [program] [command] --help is called.

While there's ample documentation, Cobra lacks examples to illustrate ways of modifying what's returned from the Help() function. As an exmaple, I'd like to include markdown within the Long value:

// other values
Long:    `This [feature](https://www.google.com) blah, blah blah.`

And then use a custom parser - which I've already written - that removes the markdown before returning the string to the user:

// other help information

This feature blah, blah blah.

Essentially: can someone provide an example of a function I can pass to SetHelpFunc() that will permit me to change this value?

robdominguez
  • 118
  • 7

0 Answers0