diff --git a/api/authtokens/authtokens.gen.go b/api/authtokens/authtokens.gen.go index f95ea76f61..d0fee9dbdf 100644 --- a/api/authtokens/authtokens.gen.go +++ b/api/authtokens/authtokens.gen.go @@ -44,7 +44,6 @@ func (n AuthTokenReadResult) GetResponse() *api.Response { return n.response } -type AuthTokenCreateResult = AuthTokenReadResult type AuthTokenUpdateResult = AuthTokenReadResult type AuthTokenDeleteResult struct { diff --git a/internal/api/genapi/input.go b/internal/api/genapi/input.go index fe51a698ec..5be4dfac2a 100644 --- a/internal/api/genapi/input.go +++ b/internal/api/genapi/input.go @@ -486,7 +486,7 @@ var inputStructs = []*structInfo{ listTemplate, }, pluralResourceName: "auth-tokens", - createResponseTypes: []string{CreateResponseType, ReadResponseType, UpdateResponseType, DeleteResponseType, ListResponseType}, + createResponseTypes: []string{ReadResponseType, UpdateResponseType, DeleteResponseType, ListResponseType}, recursiveListing: true, }, // Credentials diff --git a/internal/cmd/commands/authtokenscmd/authtokens.gen.go b/internal/cmd/commands/authtokenscmd/authtokens.gen.go index e3fee45143..71ee94dd4a 100644 --- a/internal/cmd/commands/authtokenscmd/authtokens.gen.go +++ b/internal/cmd/commands/authtokenscmd/authtokens.gen.go @@ -79,7 +79,7 @@ func (c *Command) Help() string { default: - helpStr = helpMap["base"]() + helpStr = c.extraHelpFunc(helpMap) } diff --git a/internal/cmd/commands/authtokenscmd/authtokens.go b/internal/cmd/commands/authtokenscmd/authtokens.go new file mode 100644 index 0000000000..17da532a80 --- /dev/null +++ b/internal/cmd/commands/authtokenscmd/authtokens.go @@ -0,0 +1,29 @@ +// Copyright (c) HashiCorp, Inc. +// SPDX-License-Identifier: MPL-2.0 + +package authtokenscmd + +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 auth-tokens [sub command] [options] [args]", + "", + " This command allows operations on Boundary auth token resources. Example:", + "", + " List all auth tokens:", + "", + ` $ boundary auth-tokens list -recursive `, + "", + " Please see the auth-tokens subcommand help for detailed usage information.", + " Note: To create an auth token, see the authenticate subcommand.", + }) + + default: + helpStr = helpMap["base"]() + } + return helpStr +} diff --git a/internal/cmd/gencli/input.go b/internal/cmd/gencli/input.go index 9e9ada40cb..767e5c2bc0 100644 --- a/internal/cmd/gencli/input.go +++ b/internal/cmd/gencli/input.go @@ -204,10 +204,11 @@ var inputStructs = map[string][]*cmdInfo{ }, "authtokens": { { - ResourceType: resource.AuthToken.String(), - Pkg: "authtokens", - StdActions: []string{"read", "delete", "list"}, - Container: "Scope", + ResourceType: resource.AuthToken.String(), + Pkg: "authtokens", + StdActions: []string{"read", "delete", "list"}, + HasExtraHelpFunc: true, + Container: "Scope", }, }, "credentialstores": {