Skip to content

Commit

Permalink
waypoint: Update flag style in examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
paladin-devops committed Apr 4, 2024
1 parent 025b837 commit 104a0b5
Show file tree
Hide file tree
Showing 17 changed files with 58 additions and 50 deletions.
6 changes: 3 additions & 3 deletions internal/commands/waypoint/add-ons/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func NewCmdCreate(ctx *cmd.Context, opts *AddOnOpts) *cmd.Command {
{
Preamble: "Create a new HCP Waypoint add-on:",
Command: heredoc.New(ctx.IO, heredoc.WithPreserveNewlines()).Must(`
$ hcp waypoint add-ons create -n my-addon -a my-application -d my-addon-definition
$ hcp waypoint add-ons create -n=my-addon -a=my-application -d=my-addon-definition
`),
},
},
Expand All @@ -49,14 +49,14 @@ $ hcp waypoint add-ons create -n my-addon -a my-application -d my-addon-definiti
},
{
Name: "add-on-definition-name",
DisplayValue: "ADD_ON_DEFINITION_NAME",
DisplayValue: "NAME",
Description: "The name of the add-on definition to use.",
Value: flagvalue.Simple("", &opts.AddOnDefinitionName),
Required: true,
},
{
Name: "application-name",
DisplayValue: "APPLICATION_NAME",
DisplayValue: "NAME",
Description: "The name of the application to which the add-on will be added.",
Value: flagvalue.Simple("", &opts.ApplicationName),
Required: true,
Expand Down
20 changes: 10 additions & 10 deletions internal/commands/waypoint/add-ons/definitions/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ command lets you create HCP Waypoint add-on definitions.
{
Preamble: "Create a new HCP Waypoint add-on definition:",
Command: heredoc.New(ctx.IO, heredoc.WithPreserveNewlines()).Must(`
$ hcp waypoint add-ons definitions create -n my-add-on-definition \
-s "My Add-on Definition summary." \
-d "My Add-on Definition description." \
--readme-markdown-template-file "README.tpl" \
--tfc-no-code-module-source "app.terraform.io/hashicorp/dir/template" \
--tfc-no-code-module-version "1.0.2" \
--tfc-project-name "my-tfc-project" \
--tfc-project-id "prj-123456" \
-l label1 \
-l label2
$ hcp waypoint add-ons definitions create -n=my-add-on-definition \
-s="My Add-on Definition summary." \
-d="My Add-on Definition description." \
--readme-markdown-template-file="README.tpl" \
--tfc-no-code-module-source="app.terraform.io/hashicorp/dir/template" \
--tfc-no-code-module-version="1.0.2" \
--tfc-project-name="my-tfc-project" \
--tfc-project-id="prj-123456" \
-l=label1 \
-l=label2
`),
},
},
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/waypoint/add-ons/definitions/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ command lets you delete an existing HCP Waypoint add-on definition.
{
Preamble: "Delete an HCP Waypoint add-on definition:",
Command: heredoc.New(ctx.IO, heredoc.WithPreserveNewlines()).Must(`
$ hcp waypoint add-ons definitions delete -n my-addon-definition
$ hcp waypoint add-ons definitions delete -n=my-addon-definition
`),
},
},
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/waypoint/add-ons/definitions/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ command lets you read an existing HCP Waypoint add-on definition.
{
Preamble: "Read an HCP Waypoint add-on definition:",
Command: heredoc.New(ctx.IO, heredoc.WithPreserveNewlines()).Must(`
$ hcp waypoint add-ons definitions read -n my-addon-definition
$ hcp waypoint add-ons definitions read -n=my-addon-definition
`),
},
},
Expand Down
16 changes: 8 additions & 8 deletions internal/commands/waypoint/add-ons/definitions/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ command lets you update an existing HCP Waypoint add-on definition.
Preamble: "Update a HCP Waypoint add-on definition:",
Command: heredoc.New(ctx.IO, heredoc.WithPreserveNewlines()).Must(`
$ hcp waypoint add-ons definitions update -n=my-add-on-definition \
-s "My updated Add-on Definition summary." \
-d "My updated Add-on Definition description." \
-s="My updated Add-on Definition summary." \
-d="My updated Add-on Definition description." \
--readme-markdown-template-file "README.tpl" \
--tfc-no-code-module-source "app.terraform.io/hashicorp/dir/template" \
--tfc-no-code-module-version "1.0.2" \
--tfc-project-name "my-tfc-project" \
--tfc-project-id "prj-123456" \
-l label1 \
-l label2
--tfc-no-code-module-source="app.terraform.io/hashicorp/dir/template" \
--tfc-no-code-module-version="1.0.2" \
--tfc-project-name="my-tfc-project" \
--tfc-project-id="prj-123456" \
-l=label1 \
-l=label2
`),
},
},
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/waypoint/add-ons/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ destroy an existing HCP Waypoint add-on.
{
Preamble: "Destroy an HCP Waypoint add-on:",
Command: heredoc.New(ctx.IO, heredoc.WithPreserveNewlines()).Must(`
$ hcp waypoint add-ons destroy -n my-addon
$ hcp waypoint add-ons destroy -n=my-addon
`),
},
},
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/waypoint/add-ons/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The {{ template "mdCodeOrBold" "hcp waypoint add-ons read" }} command lets you r
{
Preamble: "Read an HCP Waypoint add-on:",
Command: heredoc.New(ctx.IO, heredoc.WithPreserveNewlines()).Must(`
$ hcp waypoint add-ons read -n my-addon
$ hcp waypoint add-ons read -n=my-addon
`),
},
},
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/waypoint/agent/group_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewCmdGroupCreate(ctx *cmd.Context, opts *GroupOpts) *cmd.Command {
Examples: []cmd.Example{
{
Preamble: "Create a new group:",
Command: "$ hcp waypoint agent group create -n 'prod:us-west-2' -d 'us west production access'",
Command: "$ hcp waypoint agent group create -n='prod:us-west-2' -d='us west production access'",
},
},
PersistentPreRun: func(c *cmd.Command, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/waypoint/agent/group_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func NewCmdGroupDelete(ctx *cmd.Context, opts *GroupOpts) *cmd.Command {
Examples: []cmd.Example{
{
Preamble: "Delete a group:",
Command: "$ hcp waypoint agent group delete -n 'prod:us-west-2'",
Command: "$ hcp waypoint agent group delete -n='prod:us-west-2'",
},
},
PersistentPreRun: func(c *cmd.Command, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/waypoint/applications/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ a new HCP Waypoint application.
{
Preamble: "Create a new HCP Waypoint application:",
Command: heredoc.New(ctx.IO, heredoc.WithPreserveNewlines()).Must(`
$ hcp waypoint application create -n my-application -t my-templates
$ hcp waypoint application create -n=my-application -t=my-template
`),
},
},
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/waypoint/applications/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ an HCP Waypoint application and its infrastructure.
{
Preamble: "Destroy an HCP Waypoint application:",
Command: heredoc.New(ctx.IO, heredoc.WithPreserveNewlines()).Must(`
$ hcp waypoint applications destroy -n my-application
$ hcp waypoint applications destroy -n=my-application
`),
},
},
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/waypoint/applications/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ details about an HCP Waypoint application.
Examples: []cmd.Example{
{
Preamble: "Read an HCP Waypoint application:",
Command: "$ hcp waypoint applications read -n my-application",
Command: "$ hcp waypoint applications read -n=my-application",
},
},
RunF: func(c *cmd.Command, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/waypoint/applications/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ an existing HCP Waypoint application.
{
Preamble: "Update an existing HCP Waypoint application:",
Command: heredoc.New(ctx.IO, heredoc.WithPreserveNewlines()).Must(`
$ hcp waypoint applications update -n my-application --action-config-name my-action-config
$ hcp waypoint applications update -n=my-application --action-config-name my-action-config
`),
},
},
Expand Down
18 changes: 9 additions & 9 deletions internal/commands/waypoint/templates/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ HCP Waypoint templates.
{
Preamble: "Create a new HCP Waypoint template:",
Command: heredoc.New(ctx.IO, heredoc.WithPreserveNewlines()).Must(`
$ hcp waypoint templates create -n my-template \
-s "My Template Summary" \
-d "My Template Description" \
$ hcp waypoint templates create -n=my-template \
-s="My Template Summary" \
-d="My Template Description" \
--readme-markdown-template-file "README.tpl" \
--tfc-no-code-module-source "app.terraform.io/hashicorp/dir/template" \
--tfc-no-code-module-version "1.0.2" \
--tfc-project-name "my-tfc-project" \
--tfc-project-id "prj-123456"" \
-l "label1" \
-l "label2"
--tfc-no-code-module-source="app.terraform.io/hashicorp/dir/template" \
--tfc-no-code-module-version="1.0.2" \
--tfc-project-name="my-tfc-project" \
--tfc-project-id="prj-123456"" \
-l="label1" \
-l="label2"
`),
},
},
Expand Down
8 changes: 8 additions & 0 deletions internal/commands/waypoint/templates/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ func NewCmdDelete(ctx *cmd.Context, opts *TemplateOpts) *cmd.Command {
The {{ template "mdCodeOrBold" "hcp waypoint templates delete" }} command lets you delete
existing HCP Waypoint templates.
`),
Examples: []cmd.Example{
{
Preamble: "Delete an existing HCP Waypoint template:",
Command: heredoc.New(ctx.IO, heredoc.WithPreserveNewlines()).Must(`
$ hcp waypoint templates delete -n=my-template
`),
},
},
RunF: func(c *cmd.Command, args []string) error {
if opts.testFunc != nil {
return opts.testFunc(c, args)
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/waypoint/templates/read.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ an existing HCP Waypoint template.
{
Preamble: "Read an HCP Waypoint template:",
Command: heredoc.New(ctx.IO, heredoc.WithPreserveNewlines()).Must(`
$ hcp waypoint templates read -n my-template
$ hcp waypoint templates read -n=my-template
`),
},
},
Expand Down
18 changes: 9 additions & 9 deletions internal/commands/waypoint/templates/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ existing HCP Waypoint templates.
{
Preamble: "Update an HCP Waypoint template:",
Command: heredoc.New(ctx.IO, heredoc.WithPreserveNewlines()).Must(`
$ hcp waypoint templates update -n my-template \
-s "My Template Summary" \
-d "My Template Description" \
$ hcp waypoint templates update -n=my-template \
-s="My Template Summary" \
-d="My Template Description" \
-readme-markdown-template-file "README.tpl" \
--tfc-no-code-module-source "app.terraform.io/hashicorp/dir/template" \
--tfc-no-code-module-version "1.0.2" \
--tfc-project-name "my-tfc-project" \
--tfc-project-id "prj-123456 \
-l "label1" \
-l "label2"
--tfc-no-code-module-source="app.terraform.io/hashicorp/dir/template" \
--tfc-no-code-module-version="1.0.2" \
--tfc-project-name="my-tfc-project" \
--tfc-project-id="prj-123456 \
-l="label1" \
-l="label2"
`),
},
},
Expand Down

0 comments on commit 104a0b5

Please sign in to comment.