urfave/cli [14.3k] 命令行
最后更新于:2022-04-02 02:39:01
[TOC]
> [github](https://github.com/urfave/cli)
## 概述
[v2 的使用手册](https://github.com/urfave/cli/blob/master/docs/v2/manual.md)
## 实例
```
package main
import (
"fmt"
"log"
"os"
"github.com/urfave/cli/v2"
)
func main() {
app := &cli.App{
Name: "boom",
Usage: "make an explosive entrance",
Action: func(c *cli.Context) error {
fmt.Println("boom! I say!")
return nil
},
}
err := app.Run(os.Args)
if err != nil {
log.Fatal(err)
}
}
```
';