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.
		
			
				
	
	
		
			50 lines
		
	
	
		
			936 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			50 lines
		
	
	
		
			936 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| // Copyright (c) HashiCorp, Inc.
 | |
| // SPDX-License-Identifier: BUSL-1.1
 | |
| 
 | |
| package command
 | |
| 
 | |
| import (
 | |
| 	"strings"
 | |
| 
 | |
| 	"github.com/hashicorp/cli"
 | |
| )
 | |
| 
 | |
| var _ cli.Command = (*TokenCommand)(nil)
 | |
| 
 | |
| type TokenCommand struct {
 | |
| 	*BaseCommand
 | |
| }
 | |
| 
 | |
| func (c *TokenCommand) Synopsis() string {
 | |
| 	return "Interact with tokens"
 | |
| }
 | |
| 
 | |
| func (c *TokenCommand) Help() string {
 | |
| 	helpText := `
 | |
| Usage: vault token <subcommand> [options] [args]
 | |
| 
 | |
|   This command groups subcommands for interacting with tokens. Users can
 | |
|   create, lookup, renew, and revoke tokens.
 | |
| 
 | |
|   Create a new token:
 | |
| 
 | |
|       $ vault token create
 | |
| 
 | |
|   Revoke a token:
 | |
| 
 | |
|       $ vault token revoke 96ddf4bc-d217-f3ba-f9bd-017055595017
 | |
| 
 | |
|   Renew a token:
 | |
| 
 | |
|       $ vault token renew 96ddf4bc-d217-f3ba-f9bd-017055595017
 | |
| 
 | |
|   Please see the individual subcommand help for detailed usage information.
 | |
| `
 | |
| 
 | |
| 	return strings.TrimSpace(helpText)
 | |
| }
 | |
| 
 | |
| func (c *TokenCommand) Run(args []string) int {
 | |
| 	return cli.RunResultHelp
 | |
| }
 |