(f *cmdutil.Factory, version, buildDate string)
| 10 | ) |
| 11 | |
| 12 | func NewCmdVersion(f *cmdutil.Factory, version, buildDate string) *cobra.Command { |
| 13 | cmd := &cobra.Command{ |
| 14 | Use: "version", |
| 15 | Hidden: true, |
| 16 | RunE: func(cmd *cobra.Command, args []string) error { |
| 17 | fmt.Fprint(f.IOStreams.Out, cmd.Root().Annotations["versionInfo"]) |
| 18 | return nil |
| 19 | }, |
| 20 | } |
| 21 | |
| 22 | cmdutil.DisableAuthCheck(cmd) |
| 23 | |
| 24 | return cmd |
| 25 | } |
| 26 | |
| 27 | func Format(version, buildDate string) string { |
| 28 | version = strings.TrimPrefix(version, "v") |
nothing calls this directly
no test coverage detected