Closed nirs closed 1 month ago
Lint errors are fixed in #2181, go 1.23 tests added in #2182. I rebased on both temporarily to verify all tests and go version with this change.
I’ll let you rebase this one first @nirs
@marckhouzam can be merged now
@marckhouzam can you check gain?
@nirs On the last commit you mention
This may cause issues for programs processing the output if the program
assumes that the name of the program never contains spaces, and the
version string is the third word. Users can use their own template if
they think that this is an issue.
If we think that this can break users we can drop this change and let
users opt in by setting their own template using `{{.DisplayName}}`.
I'm not concerned because this will only affect programs that use the CommandDisplayNameAnnotation
annotation, in which case your change is correct.
When writing a plugin and setting CommandDisplayNameAnnotation you want the display name to be used in help text. This did not work when setting command Version since the help text and version templates used the command Name().
This change makes command DisplayName() public, so it can be used in templates or other code that want to use this value, and fix --version help text and template to use the command DisplayName().