|
|
@ -10,7 +10,7 @@ import ( |
|
|
|
|
|
|
|
|
|
|
|
func New(ui cli.Ui) *cmd { |
|
|
|
func New(ui cli.Ui) *cmd { |
|
|
|
c := &cmd{UI: ui} |
|
|
|
c := &cmd{UI: ui} |
|
|
|
c.initFlags() |
|
|
|
c.init() |
|
|
|
return c |
|
|
|
return c |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -18,16 +18,18 @@ type cmd struct { |
|
|
|
UI cli.Ui |
|
|
|
UI cli.Ui |
|
|
|
flags *flag.FlagSet |
|
|
|
flags *flag.FlagSet |
|
|
|
http *flags.HTTPFlags |
|
|
|
http *flags.HTTPFlags |
|
|
|
|
|
|
|
usage string |
|
|
|
wan bool |
|
|
|
wan bool |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (c *cmd) initFlags() { |
|
|
|
func (c *cmd) init() { |
|
|
|
c.flags = flag.NewFlagSet("", flag.ContinueOnError) |
|
|
|
c.flags = flag.NewFlagSet("", flag.ContinueOnError) |
|
|
|
c.flags.BoolVar(&c.wan, "wan", false, |
|
|
|
c.flags.BoolVar(&c.wan, "wan", false, |
|
|
|
"Joins a server to another server in the WAN pool.") |
|
|
|
"Joins a server to another server in the WAN pool.") |
|
|
|
|
|
|
|
|
|
|
|
c.http = &flags.HTTPFlags{} |
|
|
|
c.http = &flags.HTTPFlags{} |
|
|
|
flags.Merge(c.flags, c.http.ClientFlags()) |
|
|
|
flags.Merge(c.flags, c.http.ClientFlags()) |
|
|
|
|
|
|
|
c.usage = flags.Usage(usage, c.flags, c.http.ClientFlags(), nil) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (c *cmd) Run(args []string) int { |
|
|
|
func (c *cmd) Run(args []string) int { |
|
|
@ -73,10 +75,10 @@ func (c *cmd) Synopsis() string { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (c *cmd) Help() string { |
|
|
|
func (c *cmd) Help() string { |
|
|
|
s := `Usage: consul join [options] address ... |
|
|
|
return c.usage |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const usage = `Usage: consul join [options] address ... |
|
|
|
|
|
|
|
|
|
|
|
Tells a running Consul agent (with "consul agent") to join the cluster |
|
|
|
Tells a running Consul agent (with "consul agent") to join the cluster |
|
|
|
by specifying at least one existing member.` |
|
|
|
by specifying at least one existing member.` |
|
|
|
|
|
|
|
|
|
|
|
return flags.Usage(s, c.flags, c.http.ClientFlags(), nil) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|