cmd

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Ttz = New("ttz", "A simple greeter program")

Functions

This section is empty.

Types

type Cli

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

func New

func New(name, long string) *Cli

func (*Cli) AddCmd

func (c *Cli) AddCmd(cmd Command)

func (*Cli) Find

func (c *Cli) Find(cmd string) (Command, bool)

func (*Cli) Run

func (c *Cli) Run()

type Command

type Command struct {
	// The command name, used to match the command line argument e.g. clitool <Name>.
	Name string
	// Short is used in the list of commands message e.g. "command does xyz"
	Short string
	// Long is used in the usage message from the help command e.g.:
	// "Usage: <Name> [args]
	//
	// "<Long>"
	Long string
	// Cmd is the function that is called when the command is matched.
	Cmd func()
}

Jump to

Keyboard shortcuts

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