Skip to content

Commit

Permalink
[FAB-3610] Add subcommand docstring for peer cmd
Browse files Browse the repository at this point in the history
Add more sub-command docstring for the peer cmd, hence it would be more
clear to know which subcommand to take from.

Change-Id: I03a5de9d4d50780a8eaa8e19a014cafad149c2a5
Signed-off-by: Baohua Yang <baohyang@cn.ibm.com>
  • Loading branch information
yeasy committed May 3, 2017
1 parent d6fbfcf commit fec63a9
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
6 changes: 4 additions & 2 deletions peer/chaincode/chaincode.go
Expand Up @@ -27,6 +27,8 @@ import (

const (
chainFuncName = "chaincode"
shortDes = "Operate a chaincode: install|instantiate|invoke|package|query|signpackage|upgrade."
longDes = "Operate a chaincode: install|instantiate|invoke|package|query|signpackage|upgrade."
)

var logger = flogging.MustGetLogger("chaincodeCmd")
Expand Down Expand Up @@ -99,6 +101,6 @@ var (

var chaincodeCmd = &cobra.Command{
Use: chainFuncName,
Short: fmt.Sprintf("%s specific commands.", chainFuncName),
Long: fmt.Sprintf("%s specific commands.", chainFuncName),
Short: fmt.Sprint(shortDes),
Long: fmt.Sprint(longDes),
}
10 changes: 7 additions & 3 deletions peer/channel/channel.go
Expand Up @@ -30,7 +30,11 @@ import (
"google.golang.org/grpc/credentials"
)

const channelFuncName = "channel"
const (
channelFuncName = "channel"
shortDes = "Operate a channel: create|fetch|join|list."
longDes = "Operate a channel: create|fetch|join|list."
)

var (
// join related variables.
Expand Down Expand Up @@ -70,8 +74,8 @@ func AddFlags(cmd *cobra.Command) {

var channelCmd = &cobra.Command{
Use: channelFuncName,
Short: fmt.Sprintf("%s specific commands.", channelFuncName),
Long: fmt.Sprintf("%s specific commands.", channelFuncName),
Short: fmt.Sprint(shortDes),
Long: fmt.Sprint(longDes),
}

type BroadcastClientFactory func() (common.BroadcastClient, error)
Expand Down
10 changes: 7 additions & 3 deletions peer/clilogging/logging.go
Expand Up @@ -24,7 +24,11 @@ import (
"github.com/spf13/cobra"
)

const loggingFuncName = "logging"
const (
loggingFuncName = "logging"
shortDes = "Log levels: getlevel|setlevel|revertlevels."
longDes = "Log levels: getlevel|setlevel|revertlevels."
)

var logger = flogging.MustGetLogger("cli/logging")

Expand All @@ -39,6 +43,6 @@ func Cmd() *cobra.Command {

var loggingCmd = &cobra.Command{
Use: loggingFuncName,
Short: fmt.Sprintf("%s specific commands.", loggingFuncName),
Long: fmt.Sprintf("%s specific commands.", loggingFuncName),
Short: fmt.Sprint(shortDes),
Long: fmt.Sprint(longDes),
}
10 changes: 7 additions & 3 deletions peer/node/node.go
Expand Up @@ -23,7 +23,11 @@ import (
"github.com/spf13/cobra"
)

const nodeFuncName = "node"
const (
nodeFuncName = "node"
shortDes = "Operate a peer node: start|stop|status."
longDes = "Operate a peer node: start|stop|status."
)

var (
stopPidFile string
Expand All @@ -41,6 +45,6 @@ func Cmd() *cobra.Command {

var nodeCmd = &cobra.Command{
Use: nodeFuncName,
Short: fmt.Sprintf("%s specific commands.", nodeFuncName),
Long: fmt.Sprintf("%s specific commands.", nodeFuncName),
Short: fmt.Sprint(shortDes),
Long: fmt.Sprint(longDes),
}
2 changes: 1 addition & 1 deletion peer/version/version.go
Expand Up @@ -31,7 +31,7 @@ func Cmd() *cobra.Command {
var cobraCommand = &cobra.Command{
Use: "version",
Short: "Print fabric peer version.",
Long: `Print current version of fabric peer server.`,
Long: `Print current version of the the fabric peer server.`,
Run: func(cmd *cobra.Command, args []string) {
Print()
},
Expand Down

0 comments on commit fec63a9

Please sign in to comment.