✨ 新增 --version
This commit is contained in:
parent
3c95e509a0
commit
b14e3fe4c4
7
main.go
7
main.go
|
@ -8,10 +8,13 @@ import (
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const version = "v0.0.1-snapshot" // 版本号
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
app := &cli.App{
|
app := &cli.App{
|
||||||
Name: "boom",
|
Name: "boom",
|
||||||
Usage: "make an explosive entrance",
|
Version: version,
|
||||||
|
Usage: "make an explosive entrance",
|
||||||
Action: func(*cli.Context) error {
|
Action: func(*cli.Context) error {
|
||||||
fmt.Println("boom! I say!")
|
fmt.Println("boom! I say!")
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue