Skip to content

Commit

Permalink
fix help for azd template source add (#4474)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
alexwolfmsft and weikanglim authored Oct 24, 2024
1 parent 9ec227e commit 331c013
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
21 changes: 8 additions & 13 deletions cli/azd/cmd/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
})
}

Expand Down Expand Up @@ -350,14 +348,11 @@ func (a *templateSourceListAction) Run(ctx context.Context) (*actions.ActionResu

func newTemplateSourceAddCmd() *cobra.Command {
return &cobra.Command{
Use: "add <key>",
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 <key>",
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),
}
}
Expand Down
4 changes: 2 additions & 2 deletions cli/azd/cmd/testdata/TestUsage-azd-template-source-add.snap
Original file line number Diff line number Diff line change
@@ -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 <key> [flags]
Expand Down
3 changes: 0 additions & 3 deletions cli/azd/cmd/testdata/TestUsage-azd-template-source.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 331c013

Please sign in to comment.