Conversation
craicoverflow
left a comment
There was a problem hiding this comment.
This is great, very neat PR.
Something that could be done in a follow up PR, or here if you prefer, would be to use the same version output defined in this command and to use it as the text for the --version flag. This way, if we ever want to change the text that is displayed, we only need to update the locales file and both will be changed!
See https://github.com/spf13/cobra#version-flag
|
|
||
| cmd := &cobra.Command{ | ||
| Use: localizer.MustLocalizeFromID("version.cmd.use"), | ||
| Hidden: true, |
There was a problem hiding this comment.
I never would have thought of adding this but it make so much sense! I did not see it in Cobra docs, how did you find out about it? 😄
There was a problem hiding this comment.
I noticed gh cli doesnt show version command, so I went on to check its implementation :) .
There was a problem hiding this comment.
Nice research work! Cobra's docs are a bit poor aren't they? There seems to be no API reference documentation which covers many configuration options.
Description
Add a version command so that user won't have to guess between
--versionorversion.fixes #469
Verification Steps
rhoas versionrhoas version <version>as the outputType of change
Checklist