package command import ( "strings" ) // GetCommand is a Command that gets data from the Vault. type GetCommand struct { Meta } func (c *GetCommand) Run(args []string) int { flags := c.Meta.FlagSet("put", FlagSetDefault) flags.Usage = func() { c.Ui.Error(c.Help()) } if err := flags.Parse(args); err != nil { return 1 } return 0 } func (c *GetCommand) Synopsis() string { return "Get data or secrets from Vault" } func (c *GetCommand) Help() string { helpText := ` Usage: vault get [options] path Read data from Vault. Read reads data at the given path from Vault. This can be used to read secrets and configuration as well as generate dynamic values from materialized backends. Please reference the documentation for the backends in use to determine key structure. General Options: -address=TODO The address of the Vault server. -ca-cert=path Path to a PEM encoded CA cert file to use to verify the Vault server SSL certificate. -ca-path=path Path to a directory of PEM encoded CA cert files to verify the Vault server SSL certificate. If both -ca-cert and -ca-path are specified, -ca-path is used. -insecure Do not verify TLS certificate. This is highly not recommended. This is especially not recommended for unsealing a vault. ` return strings.TrimSpace(helpText) }