cli

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithContext

func WithContext(runner Runner) func(cmd *cobra.Command, args []string) error

Types

type CLI

type CLI struct {
	// contains filtered or unexported fields
}

func NewCLI

func NewCLI(name, desc string) *CLI

func (*CLI) AddCommands

func (c *CLI) AddCommands(cmds ...*cobra.Command)

func (*CLI) Run

func (c *CLI) Run() error

type Input

type Input struct {
	Logger          slog.Logger
	PersistentFlags PersistentFlags
	Stdin           io.Reader
}

type PersistentFlags

type PersistentFlags struct {
	LogLevel string
}

type Runner

type Runner func(ctx context.Context, input Input) error

Jump to

Keyboard shortcuts

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