MCPcopy Create free account
hub / github.com/cli/cli / NewCmdVersion

Function NewCmdVersion

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

Source from the content-addressed store, hash-verified

11)
12
13func NewCmdVersion(f *cmdutil.Factory, version, buildDate string) *cobra.Command {
14 cmd := &cobra.Command{
15 Use: "version",
16 Hidden: true,
17 RunE: func(cmd *cobra.Command, args []string) error {
18 fmt.Fprint(f.IOStreams.Out, cmd.Root().Annotations["versionInfo"])
19 return nil
20 },
21 }
22
23 cmdutil.DisableAuthCheck(cmd)
24
25 return cmd
26}
27
28func Format(version, buildDate string) string {
29 return format(version, buildDate, debug.Enabled)

Callers

nothing calls this directly

Calls 1

DisableAuthCheckFunction · 0.92

Tested by

no test coverage detected