Skip to content

Commit 2b61e9e

Browse files
committed
Release v0.2.0
1 parent 2774a7f commit 2b61e9e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

config/config.go

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ type Config struct {
1313
MulticastAddress string
1414
WildcardAddress string
1515
FilePath string
16+
Version string
1617
}
1718

1819
var G Config
@@ -31,6 +32,7 @@ func (c *Config) SetConf(port string) error {
3132
c.MulticastAddress = fmt.Sprintf("224.0.0.169:%s", port)
3233
c.WildcardAddress = fmt.Sprintf("0.0.0.0:%s", port)
3334
c.FilePath = ""
35+
c.Version = "0.2.0"
3436
return nil
3537
}
3638

main.go

+10
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,18 @@ func main() {
7777
Aliases: []string{"p"},
7878
Destination: &port,
7979
},
80+
&cli.BoolFlag{
81+
Name: "version",
82+
Aliases: []string{"v"},
83+
Usage: "print the version",
84+
},
8085
},
8186
Action: func(c *cli.Context) error {
87+
if c.Bool("version") {
88+
fmt.Printf("st version %s\n", config.G.Version)
89+
return nil
90+
}
91+
8292
if c.NArg() > 0 {
8393
currentPath := filepath.ToSlash(c.Args().Get(0))
8494
config.G.FilePath = currentPath

0 commit comments

Comments
 (0)