vault/command/operator.go
Christopher Swenson 6ed8b88f5f
Switch from mitchellh/cli to hashicorp/cli (#24239)
@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.
2023-12-04 11:05:02 -08:00

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 = (*OperatorCommand)(nil)
type OperatorCommand struct {
*BaseCommand
}
func (c *OperatorCommand) Synopsis() string {
return "Perform operator-specific tasks"
}
func (c *OperatorCommand) Help() string {
helpText := `
Usage: vault operator <subcommand> [options] [args]
This command groups subcommands for operators interacting with Vault. Most
users will not need to interact with these commands. Here are a few examples
of the operator commands:
Initialize a new Vault cluster:
$ vault operator init
Force a Vault to resign leadership in a cluster:
$ vault operator step-down
Rotate Vault's underlying encryption key:
$ vault operator rotate
Please see the individual subcommand help for detailed usage information.
`
return strings.TrimSpace(helpText)
}
func (c *OperatorCommand) Run(args []string) int {
return cli.RunResultHelp
}