Added check to see if ui and ui-dir flags are both specified

This commit is contained in:
mckennajones 2016-12-06 20:41:22 -08:00 committed by James Phillips
parent 9108dcd79c
commit 1695506b1d
No known key found for this signature in database
GPG Key ID: 77183E682AC5FC11
1 changed files with 7 additions and 0 deletions

View File

@ -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
}