From 1695506b1d3cf132b7b209fbbfbcdf5f04daca48 Mon Sep 17 00:00:00 2001 From: mckennajones Date: Tue, 6 Dec 2016 20:41:22 -0800 Subject: [PATCH] Added check to see if ui and ui-dir flags are both specified --- command/agent/command.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/command/agent/command.go b/command/agent/command.go index 0c64206a5..2ff79fcfc 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -424,6 +424,13 @@ func (c *Command) readConfig() *Config { // Verify the node metadata entries are valid if err := structs.ValidateMetadata(config.Meta); err != nil { c.Ui.Error(fmt.Sprintf("Failed to parse node metadata: %v", err)) + } + + // It doesn't make sense to include both UI options. + if config.EnableUi == true && config.UiDir != "" { + c.Ui.Error("Both the ui and ui-dir flags were specified, please provide only one") + c.Ui.Error("If trying to use your own web UI resources, use the ui-dir flag") + c.Ui.Error("If using Consul version 0.7.0 or later, the web UI is included in the binary so use ui to enable it") return nil }