Browse Source

add v to version pretty formatter (#8341)

* add v to version pretty formatter

* remove v from json version output
pull/8343/head
Alvin Huang 4 years ago committed by GitHub
parent
commit
dd9f5928fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      command/version/formatter.go
  2. 2
      command/version/testdata/pretty.golden

2
command/version/formatter.go

@ -38,7 +38,7 @@ func newPrettyFormatter() Formatter {
func (_ *prettyFormatter) Format(info *VersionInfo) (string, error) {
var buffer bytes.Buffer
buffer.WriteString(fmt.Sprintf("Consul %s\n", info.HumanVersion))
buffer.WriteString(fmt.Sprintf("Consul v%s\n", info.HumanVersion))
if info.Revision != "" {
buffer.WriteString(fmt.Sprintf("Revision %s\n", info.Revision))
}

2
command/version/testdata/pretty.golden vendored

@ -1,3 +1,3 @@
Consul 1.99.3-beta1
Consul v1.99.3-beta1
Revision 5e5dbedd47a5f875b60e241c5555a9caab595246
Protocol 2 spoken by default, understands 1 to 3 (agent will automatically use protocol >2 when speaking to compatible agents)

Loading…
Cancel
Save