Skip to content

Commit d05f596

Browse files
committed
display version on flag called
1 parent 5fd5f72 commit d05f596

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cmd/kndp/main.go

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"context"
5+
"fmt"
56
"os"
67
"os/signal"
78

@@ -33,6 +34,7 @@ type VersionFlag string
3334
func (v VersionFlag) Decode(ctx *kong.DecodeContext) error { return nil }
3435
func (v VersionFlag) IsBool() bool { return true }
3536
func (v VersionFlag) BeforeApply(app *kong.Kong, vars kong.Vars) error {
37+
fmt.Println(vars["version"])
3638
app.Exit(0)
3739
return nil
3840
}

0 commit comments

Comments
 (0)