mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-30 18:17:55 +00:00 
			
		
		
		
	 6ed8b88f5f
			
		
	
	6ed8b88f5f
	
	
	
		
			
			@mitchellh suggested we fork `cli` and switch to that. Since we primarily use the interfaces in `cli`, and the new fork has not changed those, this is (mostly) a drop-in replacement. A small fix will be necessary for Vault Enterprise, I believe.
		
			
				
	
	
		
			51 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			51 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| // Copyright (c) HashiCorp, Inc.
 | |
| // SPDX-License-Identifier: BUSL-1.1
 | |
| 
 | |
| package command
 | |
| 
 | |
| import (
 | |
| 	"strings"
 | |
| 
 | |
| 	"github.com/hashicorp/cli"
 | |
| )
 | |
| 
 | |
| var _ cli.Command = (*PolicyCommand)(nil)
 | |
| 
 | |
| // PolicyCommand is a Command that holds the audit commands
 | |
| type PolicyCommand struct {
 | |
| 	*BaseCommand
 | |
| }
 | |
| 
 | |
| func (c *PolicyCommand) Synopsis() string {
 | |
| 	return "Interact with policies"
 | |
| }
 | |
| 
 | |
| func (c *PolicyCommand) Help() string {
 | |
| 	helpText := `
 | |
| Usage: vault policy <subcommand> [options] [args]
 | |
| 
 | |
|   This command groups subcommands for interacting with policies.
 | |
|   Users can write, read, and list policies in Vault.
 | |
| 
 | |
|   List all enabled policies:
 | |
| 
 | |
|       $ vault policy list
 | |
| 
 | |
|   Create a policy named "my-policy" from contents on local disk:
 | |
| 
 | |
|       $ vault policy write my-policy ./my-policy.hcl
 | |
| 
 | |
|   Delete the policy named my-policy:
 | |
| 
 | |
|       $ vault policy delete my-policy
 | |
| 
 | |
|   Please see the individual subcommand help for detailed usage information.
 | |
| `
 | |
| 
 | |
| 	return strings.TrimSpace(helpText)
 | |
| }
 | |
| 
 | |
| func (c *PolicyCommand) Run(args []string) int {
 | |
| 	return cli.RunResultHelp
 | |
| }
 |