cli

package module
v0.0.0-...-91b9ece Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 3 Imported by: 0

README

cli

简单cli

root := &cli.CLI{}
start := &cli.CLI{
	Use:         "start",
	Instruction: "启动",
}
web := &cli.CLI{
	Use: "web",
	Func: func(args []string, cli *cli.CLI) {
		cli.Help()
	},
}
start.AddCommand(web)
root.AddCommand(start)
root.Run()

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CLI

type CLI struct {
	Use         string
	Instruction string
	Func        func(args []string, cli *CLI)
	// contains filtered or unexported fields
}

func (*CLI) AddCommand

func (c *CLI) AddCommand(cli ...*CLI)

func (*CLI) Help

func (c *CLI) Help()

func (*CLI) Run

func (c *CLI) Run()

Jump to

Keyboard shortcuts

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