File tree 2 files changed +25
-0
lines changed
2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -15,11 +15,13 @@ func main() {
15
15
restartCmd := cmd .NewRestartCmd (cfg )
16
16
drainCmd := cmd .NewDrainCmd (cfg )
17
17
showCmd := cmd .NewShowCmd (cfg )
18
+ versionCmd := cmd .NewVersionCmd ()
18
19
19
20
rootCmd .Subcommands = []* ffcli.Command {
20
21
restartCmd ,
21
22
drainCmd ,
22
23
showCmd ,
24
+ versionCmd ,
23
25
}
24
26
25
27
if err := rootCmd .Parse (os .Args [1 :]); err != nil {
Original file line number Diff line number Diff line change
1
+ package cmd
2
+
3
+ import (
4
+ "context"
5
+ "fmt"
6
+
7
+ "github.com/peterbourgon/ff/v3/ffcli"
8
+ )
9
+
10
+ const Version = "v0.0.5"
11
+
12
+ func NewVersionCmd () * ffcli.Command {
13
+ c := & ffcli.Command {
14
+ Name : "version" ,
15
+ ShortUsage : "show version of kroller" ,
16
+ ShortHelp : "show version of kroller" ,
17
+ Exec : func (context.Context , []string ) error {
18
+ fmt .Printf ("version: %s\n " , Version )
19
+ return nil
20
+ },
21
+ }
22
+ return c
23
+ }
You can’t perform that action at this time.
0 commit comments