Skip to content

Commit

Permalink
Small tweaks to line length
Browse files Browse the repository at this point in the history
  • Loading branch information
dadgar committed Mar 20, 2024
1 parent 96c28f5 commit 77cab1d
Show file tree
Hide file tree
Showing 16 changed files with 46 additions and 21 deletions.
3 changes: 2 additions & 1 deletion internal/commands/iam/serviceprincipals/sps.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ func NewCmdServicePrincipals(ctx *cmd.Context) *cmd.Command {
interacts with HCP. Your application uses the service principal to authenticate to HCP so that
users aren't directly involved.
Because service principals are principals, you can grant it permissions by granting a role. Refer to the examples for guidance.
Because service principals are principals, you can grant it permissions
by granting a role. Refer to the examples for guidance.
`),
Examples: []cmd.Example{
{
Expand Down
5 changes: 3 additions & 2 deletions internal/commands/organizations/iam/add_binding.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ func NewCmdAddBinding(ctx *cmd.Context, runF func(*AddBindingOpts) error) *cmd.C
Name: "add-binding",
ShortHelp: "Add an IAM policy binding for the organization.",
LongHelp: heredoc.New(ctx.IO).Must(`
The {{ template "mdCodeOrBold" "hcp organizations iam add-binding" }} command adds an IAM policy binding for the organization. A binding grants the
specified principal the given role on the organization.
The {{ template "mdCodeOrBold" "hcp organizations iam add-binding" }}
command adds an IAM policy binding for the organization. A binding
grants the specified principal the given role on the organization.
To view the available roles to bind, run
{{ template "mdCodeOrBold" "hcp iam roles list" }}.
Expand Down
5 changes: 3 additions & 2 deletions internal/commands/organizations/iam/delete_binding.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ func NewCmdDeleteBinding(ctx *cmd.Context, runF func(*DeleteBindingOpts) error)
Name: "delete-binding",
ShortHelp: "Delete an IAM policy binding for the organization.",
LongHelp: heredoc.New(ctx.IO).Must(`
The {{ template "mdCodeOrBold" "hcp organizations iam delete-binding" }} command deletes an IAM policy binding for the organization. A binding consists of a
principal and a role.
The {{ template "mdCodeOrBold" "hcp organizations iam delete-binding" }}
command deletes an IAM policy binding for the organization. A binding
consists of a principal and a role.
To view the existing role bindings, run {{ template "mdCodeOrBold" "hcp organizations iam read-policy" }}.
`),
Expand Down
3 changes: 2 additions & 1 deletion internal/commands/organizations/iam/set_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ func NewCmdSetPolicy(ctx *cmd.Context, runF func(*SetPolicyOpts) error) *cmd.Com
Name: "set-policy",
ShortHelp: "Set the IAM policy for the organization.",
LongHelp: heredoc.New(ctx.IO).Must(`
The {{ template "mdCodeOrBold" "hcp organizations iam set-policy" }} command sets the IAM policy for the organization. Setting the entire policy must be done
The {{ template "mdCodeOrBold" "hcp organizations iam set-policy" }} command sets
the IAM policy for the organization. Setting the entire policy must be done
with great care. If adding or removing a single principal from the policy, prefer
using {{ template "mdCodeOrBold" "hcp organizations iam add-binding" }} and the related
{{ template "mdCodeOrBold" "hcp organizations iam delete-binding" }}.
Expand Down
3 changes: 2 additions & 1 deletion internal/commands/organizations/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ func NewCmdList(ctx *cmd.Context, runF func(*ListOpts) error) *cmd.Command {
Name: "list",
ShortHelp: "List organizations.",
LongHelp: heredoc.New(ctx.IO).Must(`
"The {{ template "mdCodeOrBold" "hcp organizations list" }} command lists the organizations the authenticated principal is a member of."
"The {{ template "mdCodeOrBold" "hcp organizations list" }} command
lists the organizations the authenticated principal is a member of."
`),
RunF: func(c *cmd.Command, args []string) error {
if runF != nil {
Expand Down
7 changes: 4 additions & 3 deletions internal/commands/profile/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ func NewCmdInit(ctx *cmd.Context) *cmd.Command {
Name: "init",
ShortHelp: "Initialize the current profile.",
LongHelp: heredoc.New(ctx.IO).Mustf(`
The {{ template "mdCodeOrBold" "hcp profile init" }} command configures the HCP CLI to run commands against the correct context; namely against the
desired organization and project ID. This command is interactive. To set configuration using
non-interactively prefer using {{ template "mdCodeOrBold" "hcp profile set" }}.
The {{ template "mdCodeOrBold" "hcp profile init" }} command configures
the HCP CLI to run commands against the correct context; namely against
the desired organization and project ID. This command is interactive. To
set configuration using non-interactively prefer using {{ template "mdCodeOrBold" "hcp profile set" }}.
For a list of all available options, run {{ template "mdCodeOrBold" "hcp config --help" }}.
`),
Expand Down
4 changes: 3 additions & 1 deletion internal/commands/profile/profiles/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ func NewCmdDelete(ctx *cmd.Context) *cmd.Command {
Name: "delete",
ShortHelp: "Delete an existing HCP profile.",
LongHelp: heredoc.New(ctx.IO).Must(`
The {{ template "mdCodeOrBold" "hcp profile profiles delete" }} command deletes an existing HCP profiles. If the profile is the active profile, it may not be deleted.
The {{ template "mdCodeOrBold" "hcp profile profiles delete" }} command
deletes an existing HCP profiles. If the profile is the active profile,
it may not be deleted.
To delete the current active profile, first run {{ template "mdCodeOrBold" "hcp profile profiles activate" }}
to active a different profile.
Expand Down
3 changes: 2 additions & 1 deletion internal/commands/projects/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ func NewCmdCreate(ctx *cmd.Context, runF func(*CreateOpts) error) *cmd.Command {
Name: "create",
ShortHelp: "Create a new project.",
LongHelp: heredoc.New(ctx.IO).Must(`
The {{ template "mdCodeOrBold" "hcp products create" }} command creates a new project with the given name. The currently authenticated principal
The {{ template "mdCodeOrBold" "hcp products create" }} command creates
a new project with the given name. The currently authenticated principal
will be given role "admin" on the newly created project.
`),
Examples: []cmd.Example{
Expand Down
4 changes: 3 additions & 1 deletion internal/commands/projects/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ func NewCmdDelete(ctx *cmd.Context, runF func(*DeleteOpts) error) *cmd.Command {
Name: "delete",
ShortHelp: "Delete a project.",
LongHelp: heredoc.New(ctx.IO).Must(`
The {{ template "mdCodeOrBold" "hcp products delete" }} command deletes the specified project. The project must be empty before it can be deleted.
The {{ template "mdCodeOrBold" "hcp products delete" }} command deletes
the specified project. The project must be empty before it can be
deleted.
`),
Examples: []cmd.Example{
{
Expand Down
10 changes: 8 additions & 2 deletions internal/commands/projects/iam/set_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@ func NewCmdSetPolicy(ctx *cmd.Context, runF func(*SetPolicyOpts) error) *cmd.Com
Name: "set-policy",
ShortHelp: "Set the IAM policy for a project.",
LongHelp: heredoc.New(ctx.IO).Must(`
Sets the IAM policy for a project, given a project ID and a file encoded in
JSON that contains the IAM policy.
The {{ template "mdCodeOrBold" "hcp projects iam set-policy" }} command sets
the IAM policy for the project, given a project ID and a file encoded in
JSON that contains the IAM policy. If adding or removing a single principal from
the policy, prefer using {{ template "mdCodeOrBold" "hcp projects iam add-binding" }}
and the related {{ template "mdCodeOrBold" "hcp projects iam delete-binding" }}.
The policy file is expected to be a file encoded in JSON that
contains the IAM policy.
The format for the policy JSON file is an object with the following format:
Expand Down
4 changes: 3 additions & 1 deletion internal/commands/waypoint/actionconfig/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ func NewCmdCreate(ctx *cmd.Context) *cmd.Command {
Name: "create",
ShortHelp: "Create a new action configuration.",
LongHelp: heredoc.New(ctx.IO).Must(`
The {{ template "mdCodeOrBold" "hcp waypoint action-config create" }} command creates a new action configuration to be used to launch an action with.
The {{ template "mdCodeOrBold" "hcp waypoint action-config create" }}
command creates a new action configuration to be used to launch an
action with.
`),
RunF: func(c *cmd.Command, args []string) error {
return createActionConfig(c, args, opts)
Expand Down
4 changes: 3 additions & 1 deletion internal/commands/waypoint/actionconfig/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ func NewCmdDelete(ctx *cmd.Context) *cmd.Command {
Name: "delete",
ShortHelp: "Delete an existing action configuration.",
LongHelp: heredoc.New(ctx.IO).Must(`
The {{ template "mdCodeOrBold" "hcp waypoint action-config delete" }} command deletes an existing action configuration. This will remove the config completely from HCP Waypoint.
The {{ template "mdCodeOrBold" "hcp waypoint action-config delete" }}
command deletes an existing action configuration. This will remove the
config completely from HCP Waypoint.
`),
RunF: func(c *cmd.Command, args []string) error {
return deleteActionConfig(c, args, opts)
Expand Down
3 changes: 2 additions & 1 deletion internal/commands/waypoint/actionconfig/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ func NewCmdList(ctx *cmd.Context) *cmd.Command {
Name: "list",
ShortHelp: "List all known action configurations.",
LongHelp: heredoc.New(ctx.IO).Must(`
The {{ template "mdCodeOrBold" "hcp waypoint action-config list" }} command lists all known action configurations from HCP Waypoint.
The {{ template "mdCodeOrBold" "hcp waypoint action-config list" }}
command lists all known action configurations from HCP Waypoint.
`),
RunF: func(c *cmd.Command, args []string) error {
return listActionConfig(c, args, opts)
Expand Down
3 changes: 2 additions & 1 deletion internal/commands/waypoint/actionconfig/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ func NewCmdRead(ctx *cmd.Context) *cmd.Command {
Name: "read",
ShortHelp: "Read more details about an action configurations.",
LongHelp: heredoc.New(ctx.IO).Must(`
The {{ template "mdCodeOrBold" "hcp waypoint action-config read" }} command returns more details about an action configurations.
The {{ template "mdCodeOrBold" "hcp waypoint action-config read" }}
command returns more details about an action configurations.
`),
RunF: func(c *cmd.Command, args []string) error {
return readActionConfig(c, args, opts)
Expand Down
4 changes: 3 additions & 1 deletion internal/commands/waypoint/actionconfig/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ func NewCmdUpdate(ctx *cmd.Context) *cmd.Command {
Name: "update",
ShortHelp: "Update a action configuration.",
LongHelp: heredoc.New(ctx.IO).Must(`
The {{ template "mdCodeOrBold" "hcp waypoint action-config update" }} command updates a action configuration to be used to launch an action with.
The {{ template "mdCodeOrBold" "hcp waypoint action-config update" }}
command updates a action configuration to be used to launch an action
with.
`),
RunF: func(c *cmd.Command, args []string) error {
return updateActionConfig(c, args, opts)
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/heredoc/heredoc.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func (f *Formatter) Docf(tmpl string, args ...any) (string, error) {
// - mdCodeOrBold: If the output is markdown, it will return the string in a
// code stanza. Otherwise, it will return the string in bold.
// An example usage is:
// {{ template "mdCodeOrBold" "hcp projects iam read-policy --format=json" }}
// {{ template "mdCodeOrBold" "hcp projects iam read-policy --format=json" }}
//
// After rendering the template following manipulations are made:
// - The text is dedented. This allows you to use a Go string literal and not
Expand Down

0 comments on commit 77cab1d

Please sign in to comment.