Change additional options usage in meta to a func to remove build tags.

This commit is contained in:
Jeff Mitchell 2017-02-17 12:09:20 -05:00
parent 37f3b2bafd
commit ad66ed85fd
3 changed files with 16 additions and 24 deletions

View File

@ -23,6 +23,21 @@ const (
FlagSetDefault = FlagSetServer
)
var (
additionalOptionsUsage = func() string {
return `
-wrap-ttl="" Indicates that the response should be wrapped in a
cubbyhole token with the requested TTL. The response
can be fetched by calling the "sys/wrapping/unwrap"
endpoint, passing in the wrappping token's ID. This
is a numeric string with an optional suffix
"s", "m", or "h"; if no suffix is specified it will
be parsed as seconds. May also be specified via
VAULT_WRAP_TTL.
`
}
)
// Meta contains the meta-options and functionality that nearly every
// Vault command inherits.
type Meta struct {
@ -188,6 +203,6 @@ func GeneralOptionsUsage() string {
if VAULT_SKIP_VERIFY is set.
`
general += AdditionalOptionsUsage()
general += additionalOptionsUsage()
return general
}

View File

@ -1,7 +0,0 @@
// +build !vault
package meta
func AdditionalOptionsUsage() string {
return ""
}

View File

@ -1,16 +0,0 @@
// +build vault
package meta
func AdditionalOptionsUsage() string {
return `
-wrap-ttl="" Indicates that the response should be wrapped in a
cubbyhole token with the requested TTL. The response
can be fetched by calling the "sys/wrapping/unwrap"
endpoint, passing in the wrappping token's ID. This
is a numeric string with an optional suffix
"s", "m", or "h"; if no suffix is specified it will
be parsed as seconds. May also be specified via
VAULT_WRAP_TTL.
`
}