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() Expand ▾ Collapse ▴ Documentation ¶ Index ¶ type CLI func (c *CLI) AddCommand(cli ...*CLI) func (c *CLI) Help() func (c *CLI) Run() 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() Source Files ¶ View all Source files cli.go Click to show internal directories. Click to hide internal directories.