cli

package
v2.3.2-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: Apache-2.0 Imports: 46 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCommandGroups

func AddCommandGroups(cmd *cobra.Command, groups []CommandGroup)

AddCommandGroups adds all the groups in the given CommandGroup to the command, replaces the its standard usage template with a template that groups the commands according to that group.

func ClusterIdCommand added in v2.2.0

func ClusterIdCommand() *cobra.Command

func Command

func Command(ctx context.Context) *cobra.Command

Command returns the top level "telepresence" CLI command

func DescribeIntercept

func DescribeIntercept(ii *manager.InterceptInfo, volumeMountsPrevented error, debug bool) string

func IsServerRunning

func IsServerRunning() bool

IsServerRunning reports whether or not the daemon server is running.

func LicenseCommand added in v2.2.0

func LicenseCommand() *cobra.Command

func LoginCommand added in v2.1.4

func LoginCommand() *cobra.Command

Command returns the telepresence sub-command "auth"

func LogoutCommand added in v2.1.4

func LogoutCommand() *cobra.Command

func NewConnectorState

func NewConnectorState(sessionInfo *sessionInfo, daemonClient daemon.DaemonClient) *connectorState

func OnlySubcommands

func OnlySubcommands(cmd *cobra.Command, args []string) error

OnlySubcommands is a cobra.PositionalArgs that is similar to cobra.NoArgs, but prints a better error message.

func RunSubcommands

func RunSubcommands(cmd *cobra.Command, args []string) error

RunSubcommands is for use as a cobra.Command.RunE for commands that don't do anything themselves but have subcommands. In such cases, it is important to set RunE even though there's nothing to run, because otherwise cobra will treat that as "success", and it shouldn't be "success" if the user typos a command and types something invalid.

Types

type CommandGroup

type CommandGroup struct {
	Name     string
	Commands []*cobra.Command
}

CommandGroup represents a group of commands and the name of that group

type FlagGroup

type FlagGroup struct {
	Name  string
	Flags *pflag.FlagSet
}

FlagGroup represents a group of flags and the name of that group

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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