From 25eeab5e49a8be225c0c2c2aa3e74a21b4d0604c Mon Sep 17 00:00:00 2001 From: "richard.hulm" Date: Mon, 18 Jul 2016 10:01:16 +0100 Subject: [PATCH 1/2] Add the version (from config) to the Starting Consul Agent printout --- command/agent/command.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/command/agent/command.go b/command/agent/command.go index bb40fa2632..cd2756b4f8 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -406,7 +406,15 @@ func (c *Command) setupLoggers(config *Config) (*GatedWriter, *logWriter, io.Wri // setupAgent is used to start the agent and various interfaces func (c *Command) setupAgent(config *Config, logOutput io.Writer, logWriter *logWriter) error { - c.Ui.Output("Starting Consul agent...") + var version string + + version = "v" + config.Version + + if len(config.VersionPrerelease) != 0 { + version += " " + config.VersionPrerelease + } + + c.Ui.Output("Starting Consul agent (" + version + ")...") agent, err := Create(config, logOutput) if err != nil { c.Ui.Error(fmt.Sprintf("Error starting agent: %s", err)) From e2f7e825a11ec91df5751077230bca14b3d8e64a Mon Sep 17 00:00:00 2001 From: "richard.hulm" Date: Tue, 19 Jul 2016 10:04:56 +0100 Subject: [PATCH 2/2] RH: Add revision (if it exists) --- command/agent/command.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/command/agent/command.go b/command/agent/command.go index cd2756b4f8..0163223966 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -412,6 +412,10 @@ func (c *Command) setupAgent(config *Config, logOutput io.Writer, logWriter *log if len(config.VersionPrerelease) != 0 { version += " " + config.VersionPrerelease + + if len(config.Revision) != 0 { + version += " " + config.Revision + } } c.Ui.Output("Starting Consul agent (" + version + ")...")