Support multiple recursor flag

This commit is contained in:
Mohammad Zolfaghari 2015-02-21 10:15:52 +03:30
parent 92794ded6e
commit fec46d0559
1 changed files with 5 additions and 0 deletions

View File

@ -56,11 +56,13 @@ func (c *Command) readConfig() *Config {
var configFiles []string
var retryInterval string
var retryIntervalWan string
var dnsRecursors []string
cmdFlags := flag.NewFlagSet("agent", flag.ContinueOnError)
cmdFlags.Usage = func() { c.Ui.Output(c.Help()) }
cmdFlags.Var((*AppendSliceValue)(&configFiles), "config-file", "json file to read config from")
cmdFlags.Var((*AppendSliceValue)(&configFiles), "config-dir", "directory of json files to read")
cmdFlags.Var((*AppendSliceValue)(&dnsRecursors), "recursor", "address of an upstream DNS server")
cmdFlags.StringVar(&cmdConfig.LogLevel, "log-level", "", "log level")
cmdFlags.StringVar(&cmdConfig.NodeName, "node", "", "node name")
@ -138,6 +140,8 @@ func (c *Command) readConfig() *Config {
config = MergeConfig(config, fileConfig)
}
cmdConfig.DNSRecursors = append(cmdConfig.DNSRecursors, dnsRecursors...)
config = MergeConfig(config, &cmdConfig)
if config.NodeName == "" {
@ -857,6 +861,7 @@ Options:
as configuration in this directory in alphabetical
order.
-data-dir=path Path to a data directory to store agent state
-recursor Address of an upstream DNS server
-dc=east-aws Datacenter of the agent
-encrypt=key Provides the gossip encryption key
-join=1.2.3.4 Address of an agent to join at start time.