Skip to content

Commit 59be6a8

Browse files
authored
feat(cli): expose --version flag on enola binary, printing the ldflags-stamped build version (#68)
1 parent cbfcf3c commit 59be6a8

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

cmd/enola/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"path/filepath"
99

1010
"github.com/enola-labs/enola/internal/config"
11+
"github.com/enola-labs/enola/internal/version"
1112
"github.com/enola-labs/enola/pkg/bootstrap"
1213
"github.com/enola-labs/enola/pkg/explain"
1314
)
@@ -25,6 +26,9 @@ func main() {
2526

2627
for _, arg := range os.Args[1:] {
2728
switch arg {
29+
case "--version":
30+
fmt.Fprintf(os.Stderr, "enola version %s\n", version.Version)
31+
os.Exit(0)
2832
case "--generate":
2933
generateMode = true
3034
case "--explain":

0 commit comments

Comments
 (0)