companion

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

type CLI struct {
	Name          string
	Description   string
	VarName       string `json:"-" yaml:"-" validate:"omitempty"`
	FileName      string `json:"-" yaml:"-" validate:"omitempty"`
	IsSubcommand  bool   `json:"-" yaml:"-" validate:"omitempty"`
	IsRootcommand bool   `json:"-" yaml:"-" validate:"omitempty"`
}

CLI defines the command name and description for the root command or subcommand of a companion CLI.

func (*CLI) GetSubCmdRelativeFileName

func (cli *CLI) GetSubCmdRelativeFileName(
	rootCmdName string,
	subCommandFolder string,
	group string,
	fileName string,
) string

GetSubCmdRelativeFileName will generate a path for a subcommand CLI file that is relative to the root of the repository.

func (*CLI) HasDescription

func (cli *CLI) HasDescription() bool

HasDescription is a helper method which determines if a companion CLI has a description set.

func (*CLI) HasName

func (cli *CLI) HasName() bool

HasName is a helper method which determines if a companion CLI has a name set.

func (*CLI) SetCommonValues

func (cli *CLI) SetCommonValues(workload companionCLIProcessor, isSubcommand bool)

SetCommonValues sets the common values for a companion CLI.

func (*CLI) SetDefaults

func (cli *CLI) SetDefaults(workload companionCLIProcessor, isSubcommand bool)

SetDefaults sets the default values for a companion CLI.

Jump to

Keyboard shortcuts

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