From 210d07c8a13daf922bde6c043b7ade84659f24d8 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Fri, 17 Feb 2017 12:09:20 -0500 Subject: [PATCH] Change additional options usage in meta to a func to remove build tags. --- meta/meta.go | 17 ++++++++++++++++- meta/meta_non_vault.go | 7 ------- meta/meta_vault.go | 16 ---------------- 3 files changed, 16 insertions(+), 24 deletions(-) delete mode 100644 meta/meta_non_vault.go delete mode 100644 meta/meta_vault.go diff --git a/meta/meta.go b/meta/meta.go index 3ff422e2f8..0f5fef9fd5 100644 --- a/meta/meta.go +++ b/meta/meta.go @@ -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 } diff --git a/meta/meta_non_vault.go b/meta/meta_non_vault.go deleted file mode 100644 index a00dfa1241..0000000000 --- a/meta/meta_non_vault.go +++ /dev/null @@ -1,7 +0,0 @@ -// +build !vault - -package meta - -func AdditionalOptionsUsage() string { - return "" -} diff --git a/meta/meta_vault.go b/meta/meta_vault.go deleted file mode 100644 index f1fc97afc3..0000000000 --- a/meta/meta_vault.go +++ /dev/null @@ -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. -` -}