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

Function NewCmdVersion

pkg/version/sharedcommand/sharedcommand.go:21–33  ·  view source on GitHub ↗

NewCmdVersion prints out the release version info for this command binary. It is used as a subcommand of a parent command.

(parentCommand string)

Source from the content-addressed store, hash-verified

19// NewCmdVersion prints out the release version info for this command binary.
20// It is used as a subcommand of a parent command.
21func NewCmdVersion(parentCommand string) *cobra.Command {
22 cmd := &cobra.Command{
23 Use: "version",
24 Short: versionShort,
25 Long: versionLong,
26 Example: fmt.Sprintf(versionExample, parentCommand, parentCommand),
27 Run: func(cmd *cobra.Command, args []string) {
28 fmt.Fprintf(os.Stdout, "%s version: %s\n", parentCommand, version.Get())
29 },
30 }
31
32 return cmd
33}

Callers

nothing calls this directly

Calls 1

GetFunction · 0.92

Tested by

no test coverage detected