Cleanup and formatting adjustments
This commit is contained in:
parent
2a82804c0c
commit
a64c5e69a3
|
@ -451,7 +451,7 @@ func (r *request) setWriteOptions(q *WriteOptions) {
|
|||
r.header.Set("X-Consul-Token", q.Token)
|
||||
}
|
||||
if q.RelayFactor != 0 {
|
||||
r.header.Set("relay-factor", strconv.Itoa(int(q.RelayFactor)))
|
||||
r.params.Set("relay-factor", strconv.Itoa(int(q.RelayFactor)))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ func (c *Command) httpFlagsClient(f *flag.FlagSet) *flag.FlagSet {
|
|||
}
|
||||
|
||||
f.Var(&c.httpAddr, "http-addr",
|
||||
"Address and port to the Consul HTTP agent. The value can be an IP "+
|
||||
"The `address` and port of the Consul HTTP agent. The value can be an IP "+
|
||||
"address or DNS address, but it must also include the port. This can "+
|
||||
"also be specified via the CONSUL_HTTP_ADDR environment variable. The "+
|
||||
"default value is 127.0.0.1:8500.")
|
||||
|
@ -140,6 +140,8 @@ func (c *Command) Parse(args []string) error {
|
|||
|
||||
// Help returns the help for this flagSet.
|
||||
func (c *Command) Help() string {
|
||||
// Some commands with subcommands (kv/snapshot) call this without initializing
|
||||
// any flags first, so exit early to avoid a panic
|
||||
if c.flagSet == nil {
|
||||
return ""
|
||||
}
|
||||
|
@ -211,10 +213,6 @@ func printTitle(w io.Writer, s string) {
|
|||
func printFlag(w io.Writer, f *flag.Flag) {
|
||||
example, _ := flag.UnquoteUsage(f)
|
||||
if example != "" {
|
||||
// Change 'value' to 'string' for consistency
|
||||
if example == "value" {
|
||||
example = "string"
|
||||
}
|
||||
fmt.Fprintf(w, " -%s=<%s>\n", f.Name, example)
|
||||
} else {
|
||||
fmt.Fprintf(w, " -%s\n", f.Name)
|
||||
|
|
|
@ -37,7 +37,7 @@ func (c *EventCommand) Run(args []string) int {
|
|||
f.StringVar(&node, "node", "",
|
||||
"Regular expression to filter on node names.")
|
||||
f.StringVar(&service, "service", "",
|
||||
"Regular expression to filter on service instances")
|
||||
"Regular expression to filter on service instances.")
|
||||
f.StringVar(&tag, "tag", "",
|
||||
"Regular expression to filter on service tags. Must be used with -service.")
|
||||
|
||||
|
|
|
@ -36,9 +36,9 @@ func (c *KeyringCommand) Run(args []string) int {
|
|||
f.BoolVar(&listKeys, "list", false,
|
||||
"List all keys currently in use within the cluster.")
|
||||
f.IntVar(&relay, "relay-factor", 0,
|
||||
"Added in Consul 0.7.4, setting this to a non-zero value will cause nodes "+
|
||||
"to relay their response to the operation through this many randomly-chosen "+
|
||||
"other nodes in the cluster. The maximum allowed value is 5.")
|
||||
"Setting this to a non-zero value will cause nodes to relay their response "+
|
||||
"to the operation through this many randomly-chosen other nodes in the "+
|
||||
"cluster. The maximum allowed value is 5.")
|
||||
|
||||
if err := c.Command.Parse(args); err != nil {
|
||||
return 1
|
||||
|
|
|
@ -57,6 +57,8 @@ Usage: consul kv get [options] [KEY_OR_PREFIX]
|
|||
|
||||
func (c *KVGetCommand) Run(args []string) int {
|
||||
f := c.Command.NewFlagSet(c)
|
||||
base64encode := f.Bool("base64", false,
|
||||
"Base64 encode the value. The default value is false.")
|
||||
detailed := f.Bool("detailed", false,
|
||||
"Provide additional metadata about the key in addition to the value such "+
|
||||
"as the ModifyIndex and any flags that may have been set on the key. "+
|
||||
|
@ -66,8 +68,6 @@ func (c *KVGetCommand) Run(args []string) int {
|
|||
"This is especially useful if you only need the key names themselves. "+
|
||||
"This option is commonly combined with the -separator option. The default "+
|
||||
"value is false.")
|
||||
base64encode := f.Bool("base64", false,
|
||||
"Base64 encode the value. The default value is false.")
|
||||
recurse := f.Bool("recurse", false,
|
||||
"Recursively look at all keys prefixed with the given path. The default "+
|
||||
"value is false.")
|
||||
|
|
|
@ -88,8 +88,8 @@
|
|||
</li>
|
||||
|
||||
<li<%= sidebar_current("docs-commands-info") %>>
|
||||
<a href="/docs/commands/info.html">info</a>
|
||||
</li>
|
||||
<a href="/docs/commands/info.html">info</a>
|
||||
</li>
|
||||
|
||||
<li<%= sidebar_current("docs-commands-join") %>>
|
||||
<a href="/docs/commands/join.html">join</a>
|
||||
|
|
Loading…
Reference in New Issue