cli(workers): Add extra help func
This commit is contained in:
1 parent
cca044d8cb
commit
80752e9a24
5 files changed
+29
-1
No files matched your search
@@ -9,6 +9,27 @@ import (
|
||||
"github.com/hashicorp/boundary/internal/cmd/base"
|
||||
)
|
||||
|
||||
func (c *Command) extraHelpFunc(helpMap map[string]func() string) string {
|
||||
var helpStr string
|
||||
switch c.Func {
|
||||
case "":
|
||||
return base.WrapForHelpText([]string{
|
||||
"Usage: boundary workers [sub command] [options] [args]",
|
||||
"",
|
||||
" This command allows operations on Boundary worker resources. Example:",
|
||||
"",
|
||||
" Read a worker:",
|
||||
"",
|
||||
` $ boundary workers read -id w_1234567890`,
|
||||
"",
|
||||
" Please see the workers subcommand help for detailed usage information.",
|
||||
})
|
||||
default:
|
||||
helpStr = helpMap[c.Func]()
|
||||
}
|
||||
return helpStr + c.Flags().Help()
|
||||
}
|
||||
|
||||
func (c *Command) printListTable(items []*workers.Worker) string {
|
||||
if len(items) == 0 {
|
||||
return "No workers found"
|
||||
|
||||
@@ -79,7 +79,7 @@ func (c *Command) Help() string {
|
||||
|
||||
default:
|
||||
|
||||
helpStr = helpMap["base"]()
|
||||
helpStr = c.extraHelpFunc(helpMap)
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user