Skip to content

Commit

Permalink
[FAB-9246] Remove peer version flag
Browse files Browse the repository at this point in the history
It's confused that we set version flag as global, but it's
not valid for peer subcommands.

Change-Id: I35a7ad5ab8ce0917f69fe5515ecf8c5e5e93a09f
Signed-off-by: Zhenguo Niu <[email protected]>
  • Loading branch information
niuzhenguo authored and mastersingh24 committed Apr 7, 2018
1 parent 0d3ccd0 commit 55ceea4
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions peer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ SPDX-License-Identifier: Apache-2.0
package main

import (
"fmt"
_ "net/http/pprof"
"os"
"runtime"
Expand Down Expand Up @@ -51,18 +50,8 @@ var mainCmd = &cobra.Command{

return nil
},
Run: func(cmd *cobra.Command, args []string) {
if versionFlag {
fmt.Print(version.GetInfo())
} else {
cmd.HelpFunc()(cmd, args)
}
},
}

// Peer command version flag
var versionFlag bool

func main() {
// For environment variables.
viper.SetEnvPrefix(cmdRoot)
Expand All @@ -73,7 +62,6 @@ func main() {
// Define command-line flags that are valid for all peer commands and
// subcommands.
mainFlags := mainCmd.PersistentFlags()
mainFlags.BoolVarP(&versionFlag, "version", "v", false, "Display the build version for this fabric peer")

mainFlags.String("logging-level", "", "Default logging level and overrides, see core.yaml for full syntax")
viper.BindPFlag("logging_level", mainFlags.Lookup("logging-level"))
Expand Down

0 comments on commit 55ceea4

Please sign in to comment.