cmdutil

package
v1.57.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package cmdutil contains command line utilities.

Index

Constants

View Source
const (
	Indentation = "   "
	LineLen     = 80
)

Variables

This section is empty.

Functions

func CLIStringSliceToStringSlice

func CLIStringSliceToStringSlice(origSlice []string, newSlice *[]string)

func CreateKubernetesCommand

func CreateKubernetesCommand(ctx context.Context, wd, command string, args ...string) (*exec.Cmd, error)

CreateKubernetesCommand is like RunKubernetesCommand but returns the command

func EnsureBinary

func EnsureBinary(log logrus.FieldLogger, name, downloadDesc, downloadURL, archiveFileName string) (string, error)

EnsureBinary downloads a binary if it's not found, based on the name of the binary otherwise it returns the path to it.

func GetYesOrNoInput

func GetYesOrNoInput(ctx context.Context) (bool, error)

func NewDescription

func NewDescription(desc, examples string) string

NewDescription creates a description from a long desc and examples. This also formats them and normalizes the formatting.

func Normalize

func Normalize(s string) string

Normalize takes a string and normalizes it.

func RequireAtMostOneArg added in v1.52.0

func RequireAtMostOneArg(ctx *cli.Context) error

RequireAtMostOneArg returns an error if the given context includes more than one Args value.

func RequireNoArgs added in v1.52.0

func RequireNoArgs(ctx *cli.Context) error

RequireNoArgs returns an error if the given context includes any Args values.

func RunKubernetesCommand

func RunKubernetesCommand(ctx context.Context, wd string, onlyOutputOnError bool, name string, args ...string) error

RunKubernetesCommand runs a command with KUBECONFIG set. This command runs in the provided working directory

Types

This section is empty.

Jump to

Keyboard shortcuts

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