From 104a0b59f63f6e1a5b0997453186548a7aa559e9 Mon Sep 17 00:00:00 2001 From: paladin-devops <83741749+paladin-devops@users.noreply.github.com> Date: Thu, 4 Apr 2024 11:47:53 -0400 Subject: [PATCH] waypoint: Update flag style in examples. --- internal/commands/waypoint/add-ons/create.go | 6 +++--- .../waypoint/add-ons/definitions/create.go | 20 +++++++++---------- .../waypoint/add-ons/definitions/delete.go | 2 +- .../waypoint/add-ons/definitions/read.go | 2 +- .../waypoint/add-ons/definitions/update.go | 16 +++++++-------- internal/commands/waypoint/add-ons/destroy.go | 2 +- internal/commands/waypoint/add-ons/read.go | 2 +- .../commands/waypoint/agent/group_create.go | 2 +- .../commands/waypoint/agent/group_delete.go | 2 +- .../commands/waypoint/applications/create.go | 2 +- .../commands/waypoint/applications/destroy.go | 2 +- .../commands/waypoint/applications/read.go | 2 +- .../commands/waypoint/applications/update.go | 2 +- .../commands/waypoint/templates/create.go | 18 ++++++++--------- .../commands/waypoint/templates/delete.go | 8 ++++++++ internal/commands/waypoint/templates/read.go | 2 +- .../commands/waypoint/templates/update.go | 18 ++++++++--------- 17 files changed, 58 insertions(+), 50 deletions(-) diff --git a/internal/commands/waypoint/add-ons/create.go b/internal/commands/waypoint/add-ons/create.go index e843f73a..1eb681df 100644 --- a/internal/commands/waypoint/add-ons/create.go +++ b/internal/commands/waypoint/add-ons/create.go @@ -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 `), }, }, @@ -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, diff --git a/internal/commands/waypoint/add-ons/definitions/create.go b/internal/commands/waypoint/add-ons/definitions/create.go index 9b2bdd7d..067e357e 100644 --- a/internal/commands/waypoint/add-ons/definitions/create.go +++ b/internal/commands/waypoint/add-ons/definitions/create.go @@ -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 `), }, }, diff --git a/internal/commands/waypoint/add-ons/definitions/delete.go b/internal/commands/waypoint/add-ons/definitions/delete.go index 574fdf50..eee37296 100644 --- a/internal/commands/waypoint/add-ons/definitions/delete.go +++ b/internal/commands/waypoint/add-ons/definitions/delete.go @@ -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 `), }, }, diff --git a/internal/commands/waypoint/add-ons/definitions/read.go b/internal/commands/waypoint/add-ons/definitions/read.go index 1e4db2a1..adae51d2 100644 --- a/internal/commands/waypoint/add-ons/definitions/read.go +++ b/internal/commands/waypoint/add-ons/definitions/read.go @@ -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 `), }, }, diff --git a/internal/commands/waypoint/add-ons/definitions/update.go b/internal/commands/waypoint/add-ons/definitions/update.go index 310f1879..fbf4b554 100644 --- a/internal/commands/waypoint/add-ons/definitions/update.go +++ b/internal/commands/waypoint/add-ons/definitions/update.go @@ -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 `), }, }, diff --git a/internal/commands/waypoint/add-ons/destroy.go b/internal/commands/waypoint/add-ons/destroy.go index c15bdbc2..8ebd7e95 100644 --- a/internal/commands/waypoint/add-ons/destroy.go +++ b/internal/commands/waypoint/add-ons/destroy.go @@ -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 `), }, }, diff --git a/internal/commands/waypoint/add-ons/read.go b/internal/commands/waypoint/add-ons/read.go index 2468e68e..b408b1c5 100644 --- a/internal/commands/waypoint/add-ons/read.go +++ b/internal/commands/waypoint/add-ons/read.go @@ -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 `), }, }, diff --git a/internal/commands/waypoint/agent/group_create.go b/internal/commands/waypoint/agent/group_create.go index 6c40b558..694a0143 100644 --- a/internal/commands/waypoint/agent/group_create.go +++ b/internal/commands/waypoint/agent/group_create.go @@ -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 { diff --git a/internal/commands/waypoint/agent/group_delete.go b/internal/commands/waypoint/agent/group_delete.go index 00b4bca5..c482d319 100644 --- a/internal/commands/waypoint/agent/group_delete.go +++ b/internal/commands/waypoint/agent/group_delete.go @@ -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 { diff --git a/internal/commands/waypoint/applications/create.go b/internal/commands/waypoint/applications/create.go index bff37961..4024041c 100644 --- a/internal/commands/waypoint/applications/create.go +++ b/internal/commands/waypoint/applications/create.go @@ -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 `), }, }, diff --git a/internal/commands/waypoint/applications/destroy.go b/internal/commands/waypoint/applications/destroy.go index efdb8e16..e66e3ff8 100644 --- a/internal/commands/waypoint/applications/destroy.go +++ b/internal/commands/waypoint/applications/destroy.go @@ -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 `), }, }, diff --git a/internal/commands/waypoint/applications/read.go b/internal/commands/waypoint/applications/read.go index 289d0104..15c49ebc 100644 --- a/internal/commands/waypoint/applications/read.go +++ b/internal/commands/waypoint/applications/read.go @@ -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 { diff --git a/internal/commands/waypoint/applications/update.go b/internal/commands/waypoint/applications/update.go index e6c38532..a5bb90b0 100644 --- a/internal/commands/waypoint/applications/update.go +++ b/internal/commands/waypoint/applications/update.go @@ -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 `), }, }, diff --git a/internal/commands/waypoint/templates/create.go b/internal/commands/waypoint/templates/create.go index 1e0f7df2..33d526ac 100644 --- a/internal/commands/waypoint/templates/create.go +++ b/internal/commands/waypoint/templates/create.go @@ -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" `), }, }, diff --git a/internal/commands/waypoint/templates/delete.go b/internal/commands/waypoint/templates/delete.go index 7671f568..dbe9ce46 100644 --- a/internal/commands/waypoint/templates/delete.go +++ b/internal/commands/waypoint/templates/delete.go @@ -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) diff --git a/internal/commands/waypoint/templates/read.go b/internal/commands/waypoint/templates/read.go index 7d6fe5ce..b17c3241 100644 --- a/internal/commands/waypoint/templates/read.go +++ b/internal/commands/waypoint/templates/read.go @@ -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 `), }, }, diff --git a/internal/commands/waypoint/templates/update.go b/internal/commands/waypoint/templates/update.go index 9827c45d..d721e180 100644 --- a/internal/commands/waypoint/templates/update.go +++ b/internal/commands/waypoint/templates/update.go @@ -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" `), }, },