From 331c0133d25b6d6d8118acf2b83adc21b1b496f8 Mon Sep 17 00:00:00 2001 From: alexwolfmsft <93200798+alexwolfmsft@users.noreply.github.com> Date: Thu, 24 Oct 2024 14:04:14 -0400 Subject: [PATCH] fix help for `azd template source add` (#4474) Fix help text for `azd template source add` - Short no longer has multiline text - Replaced 'http://aka.ms/awesome-azd' with 'https://aka.ms/awesome-azd' --------- Co-authored-by: Wei Lim --- cli/azd/cmd/templates.go | 21 +++++++------------ .../TestUsage-azd-template-source-add.snap | 4 ++-- .../TestUsage-azd-template-source.snap | 3 --- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/cli/azd/cmd/templates.go b/cli/azd/cmd/templates.go index 59db958d921..27f27b39851 100644 --- a/cli/azd/cmd/templates.go +++ b/cli/azd/cmd/templates.go @@ -202,13 +202,11 @@ func getCmdTemplateHelpDescription(*cobra.Command) string { func getCmdTemplateSourceAddHelpDescription(*cobra.Command) string { return generateCmdHelpDescription( - fmt.Sprintf( - "Adds an azd template source with the specified key. %s\nThe key can be any value that uniquely "+ - "identifies the template source, with the exception of the following:", - output.WithWarningFormat("(Beta)")), + fmt.Sprintf("Adds an azd template source with the specified key. %s\n", output.WithWarningFormat("(Beta)"))+ + "The key can be any value that uniquely identifies the template source, with well-known values being:", []string{ formatHelpNote("default: Default templates"), - formatHelpNote("awesome-azd: Templates from http://aka.ms/awesome-azd"), + formatHelpNote("awesome-azd: Templates from https://aka.ms/awesome-azd"), }) } @@ -350,14 +348,11 @@ func (a *templateSourceListAction) Run(ctx context.Context) (*actions.ActionResu func newTemplateSourceAddCmd() *cobra.Command { return &cobra.Command{ - Use: "add ", - Short: fmt.Sprintf( - "Adds an azd template source with the specified key. %s\n"+ - "The key can be any value that uniquely identifies the template source, with the exception of the following"+ - " reserved, well-known key values:\n"+ - " ・default: Default templates\n"+ - " ・awesome-azd: Templates from http://aka.ms/awesome-azd", - output.WithWarningFormat("(Beta)")), + Use: "add ", + Short: fmt.Sprintf("Adds an azd template source with the specified key. %s", output.WithWarningFormat("(Beta)")), + Long: "The key can be any value that uniquely identifies the template source, with well-known values being:\n" + + " ・default: Default templates\n" + + " ・awesome-azd: Templates from https://aka.ms/awesome-azd", Args: cobra.ExactArgs(1), } } diff --git a/cli/azd/cmd/testdata/TestUsage-azd-template-source-add.snap b/cli/azd/cmd/testdata/TestUsage-azd-template-source-add.snap index db11e84089d..15aa82c6434 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-template-source-add.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-template-source-add.snap @@ -1,9 +1,9 @@ Adds an azd template source with the specified key. (Beta) -The key can be any value that uniquely identifies the template source, with the exception of the following: +The key can be any value that uniquely identifies the template source, with well-known values being: • default: Default templates - • awesome-azd: Templates from http://aka.ms/awesome-azd + • awesome-azd: Templates from https://aka.ms/awesome-azd Usage azd template source add [flags] diff --git a/cli/azd/cmd/testdata/TestUsage-azd-template-source.snap b/cli/azd/cmd/testdata/TestUsage-azd-template-source.snap index 4af143d14b9..c6f779e0ff3 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-template-source.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-template-source.snap @@ -9,9 +9,6 @@ Usage Available Commands add : Adds an azd template source with the specified key. (Beta) -The key can be any value that uniquely identifies the template source, with the exception of the following reserved, well-known key values: - ・default: Default templates - ・awesome-azd: Templates from http://aka.ms/awesome-azd list : Lists the configured azd template sources. (Beta) remove : Removes the specified azd template source (Beta)