mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-31 18:48:08 +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.
		
			
				
	
	
		
			52 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			52 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Go
		
	
	
	
	
	
| // Copyright (c) HashiCorp, Inc.
 | |
| // SPDX-License-Identifier: BUSL-1.1
 | |
| 
 | |
| package command
 | |
| 
 | |
| import (
 | |
| 	"strings"
 | |
| 
 | |
| 	"github.com/hashicorp/cli"
 | |
| )
 | |
| 
 | |
| var _ cli.Command = (*PluginCommand)(nil)
 | |
| 
 | |
| type PluginCommand struct {
 | |
| 	*BaseCommand
 | |
| }
 | |
| 
 | |
| func (c *PluginCommand) Synopsis() string {
 | |
| 	return "Interact with Vault plugins and catalog"
 | |
| }
 | |
| 
 | |
| func (c *PluginCommand) Help() string {
 | |
| 	helpText := `
 | |
| Usage: vault plugin <subcommand> [options] [args]
 | |
| 
 | |
|   This command groups subcommands for interacting with Vault's plugins and the
 | |
|   plugin catalog. The plugin catalog is divided into three types: "auth", 
 | |
|   "database", and "secret" plugins. A type must be specified on each call. Here 
 | |
|   are a few examples of the plugin commands.
 | |
| 
 | |
|   List all available plugins in the catalog of a particular type:
 | |
| 
 | |
|       $ vault plugin list database
 | |
| 
 | |
|   Register a new plugin to the catalog as a particular type:
 | |
| 
 | |
|       $ vault plugin register -sha256=d3f0a8b... auth my-custom-plugin
 | |
| 
 | |
|   Get information about a plugin in the catalog listed under a particular type:
 | |
| 
 | |
|       $ vault plugin info auth my-custom-plugin
 | |
| 
 | |
|   Please see the individual subcommand help for detailed usage information.
 | |
| `
 | |
| 
 | |
| 	return strings.TrimSpace(helpText)
 | |
| }
 | |
| 
 | |
| func (c *PluginCommand) Run(args []string) int {
 | |
| 	return cli.RunResultHelp
 | |
| }
 |