version

package
v0.0.3-alpha Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CLIVersion = "dev"

Functions

func GetParent

func GetParent(c interface{}) *cobra.Command

GetParent is a convenience function written when the CLI code is scaffolded to return the parent command and avoid scaffolding code with bad imports.

Types

type VersionFunc

type VersionFunc func(*VersionSubCommand) error

type VersionInfo

type VersionInfo struct {
	CLIVersion  string   `json:"cliVersion"`
	APIVersions []string `json:"apiVersions"`
}

func (*VersionInfo) Display

func (v *VersionInfo) Display() error

Display will parse and print the information stored on the VersionInfo object.

type VersionSubCommand

type VersionSubCommand struct {
	*cobra.Command

	// options
	Name         string
	Description  string
	SubCommandOf *cobra.Command

	VersionFunc VersionFunc
}

func NewBaseVersionSubCommand

func NewBaseVersionSubCommand(parentCommand *cobra.Command) *VersionSubCommand

NewBaseVersionSubCommand returns a subcommand that is meant to belong to a parent subcommand but have subcommands itself.

func (*VersionSubCommand) Setup

func (v *VersionSubCommand) Setup()

Setup sets up this command to be used as a command.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL