1package command 2 3import ( 4 "strings" 5 6 "github.com/mitchellh/cli" 7) 8 9var _ cli.Command = (*PolicyCommand)(nil) 10 11// PolicyCommand is a Command that holds the audit commands 12type PolicyCommand struct { 13 *BaseCommand 14} 15 16func (c *PolicyCommand) Synopsis() string { 17 return "Interact with policies" 18} 19 20func (c *PolicyCommand) Help() string { 21 helpText := ` 22Usage: vault policy <subcommand> [options] [args] 23 24 This command groups subcommands for interacting with policies. 25 Users can write, read, and list policies in Vault. 26 27 List all enabled policies: 28 29 $ vault policy list 30 31 Create a policy named "my-policy" from contents on local disk: 32 33 $ vault policy write my-policy ./my-policy.hcl 34 35 Delete the policy named my-policy: 36 37 $ vault policy delete my-policy 38 39 Please see the individual subcommand help for detailed usage information. 40` 41 42 return strings.TrimSpace(helpText) 43} 44 45func (c *PolicyCommand) Run(args []string) int { 46 return cli.RunResultHelp 47} 48