Skip to content

Commit 6114f63

Browse files
committed
use pre defined Version field in root cmd
1 parent 6df68a4 commit 6114f63

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmd/root.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ func NewRootCmd(version string) *cobra.Command {
1313
ctx := context.Background()
1414

1515
cmd := &cobra.Command{
16-
Use: "janus",
17-
Short: "Janus is an API Gateway",
16+
Use: "janus",
17+
Version: version,
18+
Short: "Janus is an API Gateway",
1819
Long: `
1920
This is a lightweight API Gateway and Management Platform that enables you
2021
to control who accesses your API, when they access it and how they access it.
@@ -26,7 +27,6 @@ Complete documentation is available at https://hellofresh.gitbooks.io/janus`,
2627
cmd.PersistentFlags().StringVarP(&configFile, "config", "c", "", "Config file (default is $PWD/janus.toml)")
2728

2829
cmd.AddCommand(NewCheckCmd(ctx))
29-
cmd.AddCommand(NewVersionCmd(ctx, version))
3030
cmd.AddCommand(NewServerStartCmd(ctx, version))
3131

3232
return cmd

0 commit comments

Comments
 (0)