MCPcopy
hub / github.com/cli/cli / NewCmdVersion

Function NewCmdVersion

pkg/cmd/version/version.go:12–25  ·  view source on GitHub ↗
(f *cmdutil.Factory, version, buildDate string)

Source from the content-addressed store, hash-verified

10)
11
12func 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
27func Format(version, buildDate string) string {
28 version = strings.TrimPrefix(version, "v")

Callers

nothing calls this directly

Calls 1

DisableAuthCheckFunction · 0.92

Tested by

no test coverage detected