File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -15,11 +15,13 @@ func main() {
1515 restartCmd := cmd .NewRestartCmd (cfg )
1616 drainCmd := cmd .NewDrainCmd (cfg )
1717 showCmd := cmd .NewShowCmd (cfg )
18+ versionCmd := cmd .NewVersionCmd ()
1819
1920 rootCmd .Subcommands = []* ffcli.Command {
2021 restartCmd ,
2122 drainCmd ,
2223 showCmd ,
24+ versionCmd ,
2325 }
2426
2527 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