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.
		
			
				
	
	
		
			49 lines
		
	
	
		
			892 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			49 lines
		
	
	
		
			892 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| // Copyright (c) HashiCorp, Inc.
 | |
| // SPDX-License-Identifier: BUSL-1.1
 | |
| 
 | |
| package command
 | |
| 
 | |
| import (
 | |
| 	"strings"
 | |
| 
 | |
| 	"github.com/hashicorp/cli"
 | |
| 	"github.com/posener/complete"
 | |
| )
 | |
| 
 | |
| var (
 | |
| 	_ cli.Command             = (*PrintCommand)(nil)
 | |
| 	_ cli.CommandAutocomplete = (*PrintCommand)(nil)
 | |
| )
 | |
| 
 | |
| type PrintCommand struct {
 | |
| 	*BaseCommand
 | |
| }
 | |
| 
 | |
| func (c *PrintCommand) Synopsis() string {
 | |
| 	return "Prints runtime configurations"
 | |
| }
 | |
| 
 | |
| func (c *PrintCommand) Help() string {
 | |
| 	helpText := `
 | |
| Usage: vault print <subcommand>
 | |
| 
 | |
| 	This command groups subcommands for interacting with Vault's runtime values.
 | |
| 
 | |
| Subcommands:
 | |
| 	token    Token currently in use
 | |
| `
 | |
| 	return strings.TrimSpace(helpText)
 | |
| }
 | |
| 
 | |
| func (c *PrintCommand) AutocompleteArgs() complete.Predictor {
 | |
| 	return nil
 | |
| }
 | |
| 
 | |
| func (c *PrintCommand) AutocompleteFlags() complete.Flags {
 | |
| 	return nil
 | |
| }
 | |
| 
 | |
| func (c *PrintCommand) Run(args []string) int {
 | |
| 	return cli.RunResultHelp
 | |
| }
 |