command

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateRandomName

func GenerateRandomName() string

func PrintTable

func PrintTable(output io.Writer, data [][]string) error

func Prompt added in v0.1.4

func Prompt(in io.Reader, out io.Writer, prompt, configDefault string) (string, error)

func PromptForConfirmation added in v0.1.4

func PromptForConfirmation(in io.Reader, out io.Writer, message string) (bool, error)

PromptForConfirmation requests and checks confirmation from the user. This will display the provided message followed by ' y/N '. If the user input 'y' or 'Y' it returns true otherwise false. If no message is provided, "Are you sure you want to proceed? y/N " will be used instead.

Types

type Cli

type Cli struct {
	Config    *config.Config
	Out, Err  *streams.Out
	In        *streams.In
	CmdLogger *slog.Logger
}

func (*Cli) HostExecutor added in v0.2.0

func (c *Cli) HostExecutor(host config.Host) (sshexec.Executor, error)

func (*Cli) MachineExecuters added in v0.1.4

func (c *Cli) MachineExecuters(machine string) ([]sshexec.Executor, error)

type CmdLogHandler added in v0.1.4

type CmdLogHandler struct {
	slog.Handler
	// contains filtered or unexported fields
}

func NewCmdLogHandler added in v0.1.4

func NewCmdLogHandler(
	out io.Writer,
	opts *slog.HandlerOptions,
) *CmdLogHandler

func (*CmdLogHandler) Handle added in v0.1.4

func (h *CmdLogHandler) Handle(ctx context.Context, r slog.Record) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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