Rename daemon CLI command to cache (#4808)
* internal/cmd/wrapper: add deprecation wrapper The deprecation wrapper can be used to display a warning to callers when a command is deprecated. * all: rename daemon to cache Rename the boundary daemon command to boundary cache. This avoids confusion with future client/daemons. * changes daemon to cache in nav --------- Co-authored-by: Robin Beck <stellarsquall@protonmail.ch>
This commit is contained in:
1 parent
be7d72d690
commit
e64443c66f
34 files changed
+554
-299
No files matched your search
+60
@@ -0,0 +1,60 @@
|
||||
// Copyright (c) HashiCorp, Inc.
|
||||
// SPDX-License-Identifier: BUSL-1.1
|
||||
|
||||
package cache
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/boundary/internal/cmd/base"
|
||||
"github.com/mitchellh/cli"
|
||||
"github.com/posener/complete"
|
||||
)
|
||||
|
||||
var (
|
||||
_ cli.Command = (*StartCommand)(nil)
|
||||
_ cli.CommandAutocomplete = (*StartCommand)(nil)
|
||||
)
|
||||
|
||||
type CacheCommand struct {
|
||||
*base.Command
|
||||
}
|
||||
|
||||
func (c *CacheCommand) Synopsis() string {
|
||||
return "Manages the client side Boundary cache"
|
||||
}
|
||||
|
||||
func (c *CacheCommand) Help() string {
|
||||
helpText := `
|
||||
Usage: boundary cache [sub command] [options]
|
||||
|
||||
This command allows interacting with the Boundary cache.
|
||||
|
||||
Start a cache:
|
||||
|
||||
$ boundary cache start
|
||||
|
||||
For a full list of examples, please see the documentation.
|
||||
|
||||
`
|
||||
return strings.TrimSpace(helpText)
|
||||
}
|
||||
|
||||
func (c *CacheCommand) Flags() *base.FlagSets {
|
||||
return c.FlagSet(base.FlagSetNone)
|
||||
}
|
||||
|
||||
func (c *CacheCommand) AutocompleteArgs() complete.Predictor {
|
||||
return complete.PredictNothing
|
||||
}
|
||||
|
||||
func (c *CacheCommand) AutocompleteFlags() complete.Flags {
|
||||
return c.Flags().Completions()
|
||||
}
|
||||
|
||||
func (c *CacheCommand) Run(args []string) int {
|
||||
if len(args) >= 2 && args[1] == "daemon" {
|
||||
c.UI.Warn("The `boundary daemon` command is deprecated, use `boundary cache` instead")
|
||||
}
|
||||
return cli.RunResultHelp
|
||||
}
|
||||
Reference in new issue
Block a user