cli

package
v0.0.0-...-473980d Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd[T any] struct {
	Name        string
	Description string
	Examples    []Example
	Usage       string
	ParseArgs   func([]string) (T, error)
	Fn          func(T) error
	SubCmds     []Runable
}

func (*Cmd[T]) Describe

func (c *Cmd[T]) Describe() string

func (*Cmd[T]) Match

func (c *Cmd[T]) Match(args []string) bool

func (*Cmd[T]) Run

func (c *Cmd[T]) Run(args []string) int

type Example

type Example struct {
	Description string
	Args        []string
	Output      string
	Error       error
}

type Runable

type Runable interface {
	Run([]string) int
	Describe() string
	Match([]string) bool
}

Jump to

Keyboard shortcuts

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