Skip to content

Commit fec63a9

Browse files
committed
[FAB-3610] Add subcommand docstring for peer cmd
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 <[email protected]>
1 parent d6fbfcf commit fec63a9

File tree

5 files changed

+26
-12
lines changed

5 files changed

+26
-12
lines changed

peer/chaincode/chaincode.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ import (
2727

2828
const (
2929
chainFuncName = "chaincode"
30+
shortDes = "Operate a chaincode: install|instantiate|invoke|package|query|signpackage|upgrade."
31+
longDes = "Operate a chaincode: install|instantiate|invoke|package|query|signpackage|upgrade."
3032
)
3133

3234
var logger = flogging.MustGetLogger("chaincodeCmd")
@@ -99,6 +101,6 @@ var (
99101

100102
var chaincodeCmd = &cobra.Command{
101103
Use: chainFuncName,
102-
Short: fmt.Sprintf("%s specific commands.", chainFuncName),
103-
Long: fmt.Sprintf("%s specific commands.", chainFuncName),
104+
Short: fmt.Sprint(shortDes),
105+
Long: fmt.Sprint(longDes),
104106
}

peer/channel/channel.go

+7-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ import (
3030
"google.golang.org/grpc/credentials"
3131
)
3232

33-
const channelFuncName = "channel"
33+
const (
34+
channelFuncName = "channel"
35+
shortDes = "Operate a channel: create|fetch|join|list."
36+
longDes = "Operate a channel: create|fetch|join|list."
37+
)
3438

3539
var (
3640
// join related variables.
@@ -70,8 +74,8 @@ func AddFlags(cmd *cobra.Command) {
7074

7175
var channelCmd = &cobra.Command{
7276
Use: channelFuncName,
73-
Short: fmt.Sprintf("%s specific commands.", channelFuncName),
74-
Long: fmt.Sprintf("%s specific commands.", channelFuncName),
77+
Short: fmt.Sprint(shortDes),
78+
Long: fmt.Sprint(longDes),
7579
}
7680

7781
type BroadcastClientFactory func() (common.BroadcastClient, error)

peer/clilogging/logging.go

+7-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ import (
2424
"github.com/spf13/cobra"
2525
)
2626

27-
const loggingFuncName = "logging"
27+
const (
28+
loggingFuncName = "logging"
29+
shortDes = "Log levels: getlevel|setlevel|revertlevels."
30+
longDes = "Log levels: getlevel|setlevel|revertlevels."
31+
)
2832

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

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

4044
var loggingCmd = &cobra.Command{
4145
Use: loggingFuncName,
42-
Short: fmt.Sprintf("%s specific commands.", loggingFuncName),
43-
Long: fmt.Sprintf("%s specific commands.", loggingFuncName),
46+
Short: fmt.Sprint(shortDes),
47+
Long: fmt.Sprint(longDes),
4448
}

peer/node/node.go

+7-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ import (
2323
"github.com/spf13/cobra"
2424
)
2525

26-
const nodeFuncName = "node"
26+
const (
27+
nodeFuncName = "node"
28+
shortDes = "Operate a peer node: start|stop|status."
29+
longDes = "Operate a peer node: start|stop|status."
30+
)
2731

2832
var (
2933
stopPidFile string
@@ -41,6 +45,6 @@ func Cmd() *cobra.Command {
4145

4246
var nodeCmd = &cobra.Command{
4347
Use: nodeFuncName,
44-
Short: fmt.Sprintf("%s specific commands.", nodeFuncName),
45-
Long: fmt.Sprintf("%s specific commands.", nodeFuncName),
48+
Short: fmt.Sprint(shortDes),
49+
Long: fmt.Sprint(longDes),
4650
}

peer/version/version.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func Cmd() *cobra.Command {
3131
var cobraCommand = &cobra.Command{
3232
Use: "version",
3333
Short: "Print fabric peer version.",
34-
Long: `Print current version of fabric peer server.`,
34+
Long: `Print current version of the the fabric peer server.`,
3535
Run: func(cmd *cobra.Command, args []string) {
3636
Print()
3737
},

0 commit comments

Comments
 (0)