Skip to content

Commit 78b4094

Browse files
committed
chore: include build version info in the release
1 parent 16ed952 commit 78b4094

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

cmd/root.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ import (
1818
var (
1919
cfg *config.Config
2020
api *spec.API
21+
22+
// BuildVersion is injected at build time (for releases) via ldflags.
23+
BuildVersion = "dev"
2124
)
2225

2326
func Execute() {
@@ -35,6 +38,8 @@ func Execute() {
3538
Short: "API client for the Nuon public API",
3639
Long: fmt.Sprintf(`Make API requests to the Nuon public API.
3740
41+
Extension version: %s
42+
3843
API version: %s
3944
4045
The HTTP method is inferred from the request:
@@ -49,11 +54,12 @@ Examples:
4954
nuon api /v1/apps -q limit=5
5055
nuon api /v1/apps '{"name":"my-app"}'
5156
nuon api /v1/apps/{app_id} --info
52-
nuon api --list`, apiVersion),
57+
nuon api --list`, BuildVersion, apiVersion),
5358
Args: cobra.ArbitraryArgs,
5459
PersistentPreRunE: initAPI,
5560
RunE: runAPI,
5661
}
62+
root.Version = BuildVersion
5763

5864
root.Flags().StringP("method", "X", "", "HTTP method override (GET, POST, PUT, PATCH, DELETE)")
5965
root.Flags().StringArrayP("query", "q", nil, "Query parameter as key=value (repeatable)")

0 commit comments

Comments
 (0)