use pre defined Version field in root cmd
@@ -14,6 +14,7 @@ func NewRootCmd(version string) *cobra.Command {
cmd := &cobra.Command{
Use: "janus",
+ Version: version,
Short: "Janus is an API Gateway",
Long: `
This is a lightweight API Gateway and Management Platform that enables you
@@ -26,7 +27,6 @@ Complete documentation is available at https://hellofresh.gitbooks.io/janus`,
cmd.PersistentFlags().StringVarP(&configFile, "config", "c", "", "Config file (default is $PWD/janus.toml)")
cmd.AddCommand(NewCheckCmd(ctx))
- cmd.AddCommand(NewVersionCmd(ctx, version))
cmd.AddCommand(NewServerStartCmd(ctx, version))
return cmd
