|
|
@ -12,7 +12,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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -20,6 +20,7 @@ type cmd struct {
|
|
|
|
UI cli.Ui
|
|
|
|
UI cli.Ui
|
|
|
|
flags *flag.FlagSet
|
|
|
|
flags *flag.FlagSet
|
|
|
|
http *flags.HTTPFlags
|
|
|
|
http *flags.HTTPFlags
|
|
|
|
|
|
|
|
usage string
|
|
|
|
|
|
|
|
|
|
|
|
// flags
|
|
|
|
// flags
|
|
|
|
installKey string
|
|
|
|
installKey string
|
|
|
@ -29,7 +30,7 @@ type cmd struct {
|
|
|
|
relay int
|
|
|
|
relay int
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (c *cmd) initFlags() {
|
|
|
|
func (c *cmd) init() {
|
|
|
|
c.flags = flag.NewFlagSet("", flag.ContinueOnError)
|
|
|
|
c.flags = flag.NewFlagSet("", flag.ContinueOnError)
|
|
|
|
c.flags.StringVar(&c.installKey, "install", "",
|
|
|
|
c.flags.StringVar(&c.installKey, "install", "",
|
|
|
|
"Install a new encryption key. This will broadcast the new key to "+
|
|
|
|
"Install a new encryption key. This will broadcast the new key to "+
|
|
|
@ -51,6 +52,7 @@ func (c *cmd) initFlags() {
|
|
|
|
c.http = &flags.HTTPFlags{}
|
|
|
|
c.http = &flags.HTTPFlags{}
|
|
|
|
flags.Merge(c.flags, c.http.ClientFlags())
|
|
|
|
flags.Merge(c.flags, c.http.ClientFlags())
|
|
|
|
flags.Merge(c.flags, c.http.ServerFlags())
|
|
|
|
flags.Merge(c.flags, c.http.ServerFlags())
|
|
|
|
|
|
|
|
c.usage = flags.Usage(usage, c.flags, c.http.ClientFlags(), c.http.ServerFlags())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (c *cmd) Run(args []string) int {
|
|
|
|
func (c *cmd) Run(args []string) int {
|
|
|
@ -164,7 +166,10 @@ func (c *cmd) Synopsis() string {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (c *cmd) Help() string {
|
|
|
|
func (c *cmd) Help() string {
|
|
|
|
s := `Usage: consul keyring [options]
|
|
|
|
return c.usage
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const usage = `Usage: consul keyring [options]
|
|
|
|
|
|
|
|
|
|
|
|
Manages encryption keys used for gossip messages. Gossip encryption is
|
|
|
|
Manages encryption keys used for gossip messages. Gossip encryption is
|
|
|
|
optional. When enabled, this command may be used to examine active encryption
|
|
|
|
optional. When enabled, this command may be used to examine active encryption
|
|
|
@ -178,5 +183,3 @@ func (c *cmd) Help() string {
|
|
|
|
All variations of the keyring command return 0 if all nodes reply and there
|
|
|
|
All variations of the keyring command return 0 if all nodes reply and there
|
|
|
|
are no errors. If any node fails to reply or reports failure, the exit code
|
|
|
|
are no errors. If any node fails to reply or reports failure, the exit code
|
|
|
|
will be 1.`
|
|
|
|
will be 1.`
|
|
|
|
return flags.Usage(s, c.flags, c.http.ClientFlags(), c.http.ServerFlags())
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|