Skip to content

Commit df91e76

Browse files
niuzhenguoryjones
authored andcommitted
[FAB-9261] Remove redundant const for cmd description
We declared two consts for some cmds Short and Long description with the same text, which is redundant and just one is enough. Change-Id: I6e5c6b76f369729a4cd642334ca7677310c51af1 Signed-off-by: Zhenguo Niu <Niu.ZGlinux@gmail.com>
1 parent 3b6a904 commit df91e76

File tree

4 files changed

+12
-16
lines changed

4 files changed

+12
-16
lines changed

peer/chaincode/chaincode.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ import (
1717

1818
const (
1919
chainFuncName = "chaincode"
20-
shortDes = "Operate a chaincode: install|instantiate|invoke|package|query|signpackage|upgrade|list."
21-
longDes = "Operate a chaincode: install|instantiate|invoke|package|query|signpackage|upgrade|list."
20+
chainCmdDes = "Operate a chaincode: install|instantiate|invoke|package|query|signpackage|upgrade|list."
2221
)
2322

2423
var logger = flogging.MustGetLogger("chaincodeCmd")
@@ -68,8 +67,8 @@ var (
6867

6968
var chaincodeCmd = &cobra.Command{
7069
Use: chainFuncName,
71-
Short: fmt.Sprint(shortDes),
72-
Long: fmt.Sprint(longDes),
70+
Short: fmt.Sprint(chainCmdDes),
71+
Long: fmt.Sprint(chainCmdDes),
7372
PersistentPreRun: common.SetOrdererEnv,
7473
}
7574

peer/channel/channel.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ import (
3030

3131
const (
3232
channelFuncName = "channel"
33-
shortDes = "Operate a channel: create|fetch|join|list|update|signconfigtx|getinfo."
34-
longDes = "Operate a channel: create|fetch|join|list|update|signconfigtx|getinfo."
33+
channelCmdDes = "Operate a channel: create|fetch|join|list|update|signconfigtx|getinfo."
3534
)
3635

3736
var logger = flogging.MustGetLogger("channelCmd")
@@ -105,8 +104,8 @@ func attachFlags(cmd *cobra.Command, names []string) {
105104

106105
var channelCmd = &cobra.Command{
107106
Use: channelFuncName,
108-
Short: fmt.Sprint(shortDes),
109-
Long: fmt.Sprint(longDes),
107+
Short: fmt.Sprint(channelCmdDes),
108+
Long: fmt.Sprint(channelCmdDes),
110109
PersistentPreRun: common.SetOrdererEnv,
111110
}
112111

peer/clilogging/logging.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ import (
2626

2727
const (
2828
loggingFuncName = "logging"
29-
shortDes = "Log levels: getlevel|setlevel|revertlevels."
30-
longDes = "Log levels: getlevel|setlevel|revertlevels."
29+
loggingCmdDes = "Log levels: getlevel|setlevel|revertlevels."
3130
)
3231

3332
var logger = flogging.MustGetLogger("cli/logging")
@@ -43,6 +42,6 @@ func Cmd(cf *LoggingCmdFactory) *cobra.Command {
4342

4443
var loggingCmd = &cobra.Command{
4544
Use: loggingFuncName,
46-
Short: fmt.Sprint(shortDes),
47-
Long: fmt.Sprint(longDes),
45+
Short: fmt.Sprint(loggingCmdDes),
46+
Long: fmt.Sprint(loggingCmdDes),
4847
}

peer/node/node.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ import (
2525

2626
const (
2727
nodeFuncName = "node"
28-
shortDes = "Operate a peer node: start|status."
29-
longDes = "Operate a peer node: start|status."
28+
nodeCmdDes = "Operate a peer node: start|status."
3029
)
3130

3231
var logger = flogging.MustGetLogger("nodeCmd")
@@ -41,6 +40,6 @@ func Cmd() *cobra.Command {
4140

4241
var nodeCmd = &cobra.Command{
4342
Use: nodeFuncName,
44-
Short: fmt.Sprint(shortDes),
45-
Long: fmt.Sprint(longDes),
43+
Short: fmt.Sprint(nodeCmdDes),
44+
Long: fmt.Sprint(nodeCmdDes),
4645
}

0 commit comments

Comments
 (0)