@@ -6,12 +6,18 @@ import (
66
77 "github.com/github/gh-cli/api"
88 "github.com/github/gh-cli/context"
9- "github.com/github/gh-cli/version"
109
1110 "github.com/spf13/cobra"
1211)
1312
13+ // Version is dynamically set at build time in the Makefile
14+ var Version = "DEV"
15+
16+ // BuildDate is dynamically set at build time in the Makefile
17+ var BuildDate = "YYYY-MM-DD"
18+
1419func init () {
20+ RootCmd .Version = fmt .Sprintf ("%s (%s)" , Version , BuildDate )
1521 RootCmd .PersistentFlags ().StringP ("repo" , "R" , "" , "current GitHub repository" )
1622 RootCmd .PersistentFlags ().StringP ("current-branch" , "B" , "" , "current git branch" )
1723 // TODO:
@@ -65,7 +71,7 @@ var apiClientForContext = func(ctx context.Context) (*api.Client, error) {
6571 }
6672 opts := []api.ClientOption {
6773 api .AddHeader ("Authorization" , fmt .Sprintf ("token %s" , token )),
68- api .AddHeader ("User-Agent" , fmt .Sprintf ("GitHub CLI %s" , version . Version )),
74+ api .AddHeader ("User-Agent" , fmt .Sprintf ("GitHub CLI %s" , Version )),
6975 }
7076 if verbose := os .Getenv ("DEBUG" ); verbose != "" {
7177 opts = append (opts , api .VerboseLog (os .Stderr ))
0 commit comments