Use runopts-provided address if given, without overriding

This commit is contained in:
Jeff Mitchell 2018-03-16 13:41:27 -04:00
parent 92ea5f9d66
commit cc0b430b77
1 changed files with 8 additions and 3 deletions

View File

@ -170,14 +170,19 @@ func (c *BaseCommand) flagSet(bit FlagSetBit) *FlagSets {
if bit&FlagSetHTTP != 0 {
f := set.NewFlagSet("HTTP Options")
f.StringVar(&StringVar{
addrStringVar := &StringVar{
Name: "address",
Target: &c.flagAddress,
Default: "https://127.0.0.1:8200",
EnvVar: "VAULT_ADDR",
Completion: complete.PredictAnything,
Usage: "Address of the Vault server.",
})
}
if c.flagAddress != "" {
addrStringVar.Default = c.flagAddress
} else {
addrStringVar.Default = "https://127.0.0.1:8200"
}
f.StringVar(addrStringVar)
f.StringVar(&StringVar{
Name: "ca-cert",