From 1519a17f174a97ec74d0d47df1a85533bed63376 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Tue, 5 May 2020 11:21:37 -0400 Subject: [PATCH] Rename catalog flag to catalog-id in hosts create command --- internal/cmd/commands/hosts/host_create.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/cmd/commands/hosts/host_create.go b/internal/cmd/commands/hosts/host_create.go index e69653325..858e20816 100644 --- a/internal/cmd/commands/hosts/host_create.go +++ b/internal/cmd/commands/hosts/host_create.go @@ -20,7 +20,7 @@ type CreateCommand struct { flagAddress string flagName string - flagCatalog string + flagCatalogId string flagDescription string } @@ -37,7 +37,7 @@ Usage: watchtower hosts create Example: - $ watchtower hosts create -catalog= -address= -name= + $ watchtower hosts create -catalog-id= -address= -name= ` + c.Flags().Help() @@ -64,8 +64,8 @@ func (c *CreateCommand) Flags() *base.FlagSets { }) f.StringVar(&base.StringVar{ - Name: "catalog", - Target: &c.flagCatalog, + Name: "catalog-id", + Target: &c.flagCatalogId, Completion: complete.PredictAnything, Usage: "The ID of the host catalog in which the host should be created", }) @@ -97,8 +97,8 @@ func (c *CreateCommand) Run(args []string) int { } switch { - case c.flagCatalog == "": - c.UI.Error("Catalog ID must be provided via -catalog") + case c.flagCatalogId == "": + c.UI.Error("Catalog ID must be provided via -catalog-id") return 1 case c.flagAddress == "": c.UI.Error("Host address must be provided via -address") @@ -113,7 +113,7 @@ func (c *CreateCommand) Run(args []string) int { catalog := &hosts.HostCatalog{ Client: client, - Id: api.String(c.flagCatalog), + Id: api.String(c.flagCatalogId), } host := &hosts.Host{