cli

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

README

cli

Utilities for creating command line interfaces

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecCommand

func ExecCommand(cmd *Command, argv []string) error

Top level entry for cli applications

Execute a command with the given command line arguments.

func ExecCommandContext

func ExecCommandContext(ctx context.Context, cmd *Command, argv []string) error

Top level entry for cli applications

Execute a command with the given command line arguments and the given context.

Types

type Command

type Command struct {
	Name        string
	Short       string
	Long        string
	Flags       func(fs *flag.FlagSet)
	Run         func(ctx context.Context) error
	SubCommands []*Command
	// contains filtered or unexported fields
}

func (*Command) Help

func (command *Command) Help() string

The commands help text string

func (*Command) SetParent

func (cmd *Command) SetParent(parent *Command)

used to back-link commands when constructing the command tree

Jump to

Keyboard shortcuts

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