Skip to content

Commit 1f35f52

Browse files
committed
feat: improve version output
Fixes #27
1 parent 777c1f3 commit 1f35f52

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

kui/kui.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ import (
1818
"strings"
1919
)
2020

21+
// version information that will come from goreleaser
22+
var (
23+
version = "dev"
24+
commit = "none"
25+
date = "unknown"
26+
)
27+
2128
type KrewComponent interface {
2229
init()
2330
}
@@ -158,7 +165,17 @@ func (component *KuiComponent) Run(context Context, args []string) {
158165
}
159166
}
160167

168+
if arg == "version" {
169+
// also report our version
170+
fmt.Printf("%v\t%v %v\n%v\t", blue(base), version, date, blue("kui"))
171+
}
172+
161173
component.invokeRun(context, cmd, kaskArgs, style)
174+
175+
if arg == "version" {
176+
// missing trailing newline; fixing here for now
177+
fmt.Print("\n")
178+
}
162179
}
163180

164181
func (component *KuiComponent) invokeRun(context Context, cmd *exec.Cmd, kaskArgs []string, style ExecStyle) {

0 commit comments

Comments
 (0)