2026-04-06 15:48:37 +05:30
|
|
|
// Copyright IBM Corp. 2020, 2026
|
2023-02-02 17:15:17 -08:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
|
|
2020-09-21 20:25:16 -04:00
|
|
|
package database
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/hashicorp/boundary/internal/cmd/base"
|
|
|
|
|
"github.com/mitchellh/cli"
|
|
|
|
|
"github.com/posener/complete"
|
|
|
|
|
)
|
|
|
|
|
|
2021-01-07 10:02:32 -05:00
|
|
|
var (
|
|
|
|
|
_ cli.Command = (*Command)(nil)
|
|
|
|
|
_ cli.CommandAutocomplete = (*Command)(nil)
|
|
|
|
|
)
|
2020-09-21 20:25:16 -04:00
|
|
|
|
|
|
|
|
type Command struct {
|
|
|
|
|
*base.Command
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *Command) Synopsis() string {
|
2026-10-12 10:20:06 -07:00
|
|
|
return "Manage Threshold's database"
|
2020-09-21 20:25:16 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *Command) Help() string {
|
|
|
|
|
return base.WrapForHelpText([]string{
|
2026-10-12 10:20:06 -07:00
|
|
|
"Usage: threshold database [sub command] [options] [args]",
|
2020-09-21 20:25:16 -04:00
|
|
|
"",
|
2026-10-12 10:20:06 -07:00
|
|
|
" This command allows operations on Threshold's database. Example:",
|
2020-09-21 20:25:16 -04:00
|
|
|
"",
|
|
|
|
|
" Initialize the database:",
|
|
|
|
|
"",
|
2026-10-12 10:20:06 -07:00
|
|
|
` $ threshold database init`,
|
2020-09-21 20:25:16 -04:00
|
|
|
"",
|
|
|
|
|
" Please see the database subcommand help for detailed usage information.",
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *Command) Flags() *base.FlagSets {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *Command) AutocompleteArgs() complete.Predictor {
|
|
|
|
|
return complete.PredictAnything
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *Command) AutocompleteFlags() complete.Flags {
|
|
|
|
|
return c.Flags().Completions()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (c *Command) Run(args []string) int {
|
|
|
|
|
return cli.RunResultHelp
|
|
|
|
|
}
|