mirror of https://github.com/status-im/consul.git
command: simplify duplicate code
This commit is contained in:
parent
a364555121
commit
e769cd22f6
|
@ -210,21 +210,15 @@ func (c *BaseCommand) helpFlagsFor(f *flag.FlagSet) string {
|
|||
|
||||
var out bytes.Buffer
|
||||
|
||||
firstHTTP := true
|
||||
if c.hasClientHTTP() || c.hasServerHTTP() {
|
||||
printTitle(&out, "HTTP API Options")
|
||||
}
|
||||
if c.hasClientHTTP() {
|
||||
if firstHTTP {
|
||||
printTitle(&out, "HTTP API Options")
|
||||
firstHTTP = false
|
||||
}
|
||||
httpFlagsClient.VisitAll(func(f *flag.Flag) {
|
||||
printFlag(&out, f)
|
||||
})
|
||||
}
|
||||
if c.hasServerHTTP() {
|
||||
if firstHTTP {
|
||||
printTitle(&out, "HTTP API Options")
|
||||
firstHTTP = false
|
||||
}
|
||||
httpFlagsServer.VisitAll(func(f *flag.Flag) {
|
||||
printFlag(&out, f)
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue