Fix up the meta common options text function to not strip leading space and fix up commands

This commit is contained in:
Jeff Mitchell 2016-04-01 16:50:12 -04:00
parent b0888e8af1
commit 1b7335cf4e
36 changed files with 39 additions and 93 deletions

View File

@ -65,7 +65,6 @@ Usage: vault audit-disable [options] id
type of the backend).
General Options:
` + meta.GeneralOptionsUsage()
` + meta.GeneralOptionsUsage()
return strings.TrimSpace(helpText)
}

View File

@ -96,9 +96,7 @@ Usage: vault audit-enable [options] type [config...]
Example: vault audit-enable file path=audit.log
General Options:
` + meta.GeneralOptionsUsage() + `
` + meta.GeneralOptionsUsage() + `
Audit Enable Options:
-description=<desc> A human-friendly description for the backend. This

View File

@ -79,7 +79,6 @@ Usage: vault audit-list [options]
only a root Vault user can view this.
General Options:
` + meta.GeneralOptionsUsage()
` + meta.GeneralOptionsUsage()
return strings.TrimSpace(helpText)
}

View File

@ -64,7 +64,6 @@ Usage: vault auth-disable [options] path
If the command is exited early, the tokens will still be revoked.
General Options:
` + meta.GeneralOptionsUsage()
` + meta.GeneralOptionsUsage()
return strings.TrimSpace(helpText)
}

View File

@ -72,9 +72,7 @@ Usage: vault auth-enable [options] type
access Vault.
General Options:
` + meta.GeneralOptionsUsage() + `
` + meta.GeneralOptionsUsage() + `
Auth Enable Options:
-description=<desc> Human-friendly description of the purpose for the

View File

@ -82,7 +82,6 @@ Usage: vault capabilities [options] [token] path
is invalid, this command will respond with a ["deny"].
General Options:
` + meta.GeneralOptionsUsage()
` + meta.GeneralOptionsUsage()
return strings.TrimSpace(helpText)
}

View File

@ -62,7 +62,6 @@ Usage: vault delete [options] path
whether delete is supported for a path and what the behavior is.
General Options:
` + meta.GeneralOptionsUsage()
` + meta.GeneralOptionsUsage()
return strings.TrimSpace(helpText)
}

View File

@ -315,9 +315,7 @@ Usage: vault generate-root [options] [key]
final token value will be encrypted with this public key and base64-encoded.
General Options:
` + meta.GeneralOptionsUsage() + `
` + meta.GeneralOptionsUsage() + `
Rekey Options:
-init Initialize the root generation attempt. This can only

View File

@ -106,9 +106,7 @@ Usage: vault init [options]
This command can't be called on an already-initialized Vault.
General Options:
` + meta.GeneralOptionsUsage() + `
` + meta.GeneralOptionsUsage() + `
Init Options:
-check Don't actually initialize, just check if Vault is

View File

@ -50,7 +50,6 @@ Usage: vault key-status [options]
the current key term and the key installation time.
General Options:
` + meta.GeneralOptionsUsage()
` + meta.GeneralOptionsUsage()
return strings.TrimSpace(helpText)
}

View File

@ -83,9 +83,7 @@ Usage: vault list [options] path
and endpoint-specific.
General Options:
` + meta.GeneralOptionsUsage() + `
` + meta.GeneralOptionsUsage() + `
Read Options:
-format=table The format for output. By default it is a whitespace-

View File

@ -83,9 +83,7 @@ Usage: vault mount [options] type
secrets.
General Options:
` + meta.GeneralOptionsUsage() + `
` + meta.GeneralOptionsUsage() + `
Mount Options:
-description=<desc> Human-friendly description of the purpose for

View File

@ -86,7 +86,6 @@ Usage: vault mounts [options]
A TTL of 'system' indicates that the system default is being used.
General Options:
` + meta.GeneralOptionsUsage()
` + meta.GeneralOptionsUsage()
return strings.TrimSpace(helpText)
}

View File

@ -71,9 +71,7 @@ func (c *MountTuneCommand) Help() string {
Example: vault mount-tune -default-lease-ttl="24h" secret
General Options:
` + meta.GeneralOptionsUsage() + `
` + meta.GeneralOptionsUsage() + `
Mount Options:
-default-lease-ttl=<duration> Default lease time-to-live for this backend.

View File

@ -71,7 +71,6 @@ Usage: vault path-help [options] path
the mount points of the backends are unknown.
General Options:
` + meta.GeneralOptionsUsage()
` + meta.GeneralOptionsUsage()
return strings.TrimSpace(helpText)
}

View File

@ -60,7 +60,6 @@ Usage: vault policy-delete [options] name
doesn't exist, it is identical to not being associated with that policy.
General Options:
` + meta.GeneralOptionsUsage()
` + meta.GeneralOptionsUsage()
return strings.TrimSpace(helpText)
}

View File

@ -87,7 +87,6 @@ Usage: vault policies [options] [name]
If a name of a policy is specified, that policy is outputted.
General Options:
` + meta.GeneralOptionsUsage()
` + meta.GeneralOptionsUsage()
return strings.TrimSpace(helpText)
}

View File

@ -84,7 +84,6 @@ Usage: vault policy-write [options] name path
loaded from the file at the given path.
General Options:
` + meta.GeneralOptionsUsage()
` + meta.GeneralOptionsUsage()
return strings.TrimSpace(helpText)
}

View File

@ -101,9 +101,7 @@ Usage: vault read [options] path
backends in use to determine key structure.
General Options:
` + meta.GeneralOptionsUsage() + `
` + meta.GeneralOptionsUsage() + `
Read Options:
-format=table The format for output. By default it is a whitespace-

View File

@ -301,9 +301,7 @@ Usage: vault rekey [options] [key]
keys be provided.
General Options:
` + meta.GeneralOptionsUsage() + `
` + meta.GeneralOptionsUsage() + `
Rekey Options:
-init Initialize the rekey operation by setting the desired

View File

@ -68,8 +68,7 @@ Usage: vault remount [options] from to
Example: vault remount secret/ generic/
General Options:
` + meta.GeneralOptionsUsage()
` + meta.GeneralOptionsUsage()
return strings.TrimSpace(helpText)
}

View File

@ -80,9 +80,7 @@ Usage: vault renew [options] id [increment]
is not required to honor this request.
General Options:
` + meta.GeneralOptionsUsage() + `
` + meta.GeneralOptionsUsage() + `
Renew Options:
-format=table The format for output. By default it is a whitespace-

View File

@ -82,9 +82,7 @@ Usage: vault revoke [options] id
lightly. This option requires -prefix.
General Options:
` + meta.GeneralOptionsUsage() + `
` + meta.GeneralOptionsUsage() + `
Revoke Options:
-prefix=true Revoke all secrets with the matching prefix. This

View File

@ -62,7 +62,6 @@ Usage: vault rotate [options]
disruptive.
General Options:
` + meta.GeneralOptionsUsage()
` + meta.GeneralOptionsUsage()
return strings.TrimSpace(helpText)
}

View File

@ -58,7 +58,6 @@ Usage: vault seal [options]
This is the same as running "vault unseal -reset".
General Options:
` + meta.GeneralOptionsUsage()
` + meta.GeneralOptionsUsage()
return strings.TrimSpace(helpText)
}

View File

@ -256,9 +256,7 @@ Usage: vault ssh [options] username@ip
See [https://github.com/hashicorp/vault-ssh-agent]
General Options:
` + meta.GeneralOptionsUsage() + `
` + meta.GeneralOptionsUsage() + `
SSH Options:
-role Role to be used to create the key.

View File

@ -98,7 +98,6 @@ Usage: vault status [options]
code also reflects the seal status (0 unsealed, 2 sealed, 1 error).
General Options:
` + meta.GeneralOptionsUsage()
` + meta.GeneralOptionsUsage()
return strings.TrimSpace(helpText)
}

View File

@ -50,7 +50,6 @@ Usage: vault step-down [options]
same node to re-grab the lock and become active again.
General Options:
` + meta.GeneralOptionsUsage()
` + meta.GeneralOptionsUsage()
return strings.TrimSpace(helpText)
}

View File

@ -109,9 +109,7 @@ Usage: vault token-create [options]
If a role is specified, the role may override parameters specified here.
General Options:
` + meta.GeneralOptionsUsage() + `
` + meta.GeneralOptionsUsage() + `
Token Options:
-id="7699125c-d8...." The token value that clients will use to authenticate

View File

@ -85,9 +85,7 @@ Usage: vault token-lookup [options] [token|accessor]
'-accessor' flag.
General Options:
` + meta.GeneralOptionsUsage() + `
` + meta.GeneralOptionsUsage() + `
Token Lookup Options:
-accessor A boolean flag, if set, treats the argument as an accessor of the token.
Note that the response of the command when this is set, will not contain

View File

@ -98,9 +98,7 @@ Usage: vault token-renew [options] [token] [increment]
well; otherwise it must be passed in via the '-increment' flag.
General Options:
` + meta.GeneralOptionsUsage() + `
` + meta.GeneralOptionsUsage() + `
Token Renew Options:
-increment=3600 The desired increment. If not supplied, Vault will

View File

@ -101,9 +101,7 @@ Usage: vault token-revoke [options] [token|accessor]
a token accessor always revokes the token along with it's child tokens.
General Options:
` + meta.GeneralOptionsUsage() + `
` + meta.GeneralOptionsUsage() + `
Token Options:
-accessor A boolean flag, if set, treats the argument as an accessor of the token.

View File

@ -62,7 +62,6 @@ Usage: vault unmount [options] path
by this backend will be revoked and its Vault data will be deleted.
General Options:
` + meta.GeneralOptionsUsage()
` + meta.GeneralOptionsUsage()
return strings.TrimSpace(helpText)
}

View File

@ -115,9 +115,7 @@ Usage: vault unseal [options] [key]
only exists to assist in scripting.
General Options:
` + meta.GeneralOptionsUsage() + `
` + meta.GeneralOptionsUsage() + `
Unseal Options:
-reset Reset the unsealing process by throwing away

View File

@ -134,9 +134,7 @@ Usage: vault write [options] path [data]
prefix the "@" with a slash: "\@".
General Options:
` + meta.GeneralOptionsUsage() + `
` + meta.GeneralOptionsUsage() + `
Write Options:
-f | -force Force the write to continue without any data values

View File

@ -12,7 +12,6 @@ import (
"net/http"
"os"
"path/filepath"
"strings"
"github.com/hashicorp/errwrap"
"github.com/hashicorp/vault/api"
@ -261,7 +260,7 @@ func GeneralOptionsUsage() string {
-client-cert=path Path to a PEM encoded client certificate for TLS
authentication to the Vault server. Must also specify
-client-key. Overrides the VAULT_CLIENT_CERT
-client-key. Overrides the VAULT_CLIENT_CERT
environment variable if set.
-client-key=path Path to an unencrypted PEM encoded private key
@ -270,8 +269,8 @@ func GeneralOptionsUsage() string {
if set.
-tls-skip-verify Do not verify TLS certificate. This is highly
not recommended. Verification will also be skipped
not recommended. Verification will also be skipped
if VAULT_SKIP_VERIFY is set.
`
return strings.TrimSpace(general)
`
return general
}