Skip to content

Commit

Permalink
update azd config help text
Browse files Browse the repository at this point in the history
  • Loading branch information
v-jiaodi committed Sep 11, 2023
1 parent f9331ac commit c55c60c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
9 changes: 1 addition & 8 deletions cli/azd/cmd/cmd_help.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,18 +258,11 @@ func getPreFooter(c *cobra.Command) string {
}

// generateCmdHelpDescription construct a help text block from a title and description notes.
func generateCmdHelpDescription(title string, notes []string, options ...string) string {
func generateCmdHelpDescription(title string, notes []string) string {
var note string
if len(notes) > 0 {
note = fmt.Sprintf("%s\n\n", strings.Join(notes, "\n"))
}
if len(options) > 0 {
var item string
for _, opt := range options {
item = opt
}
return fmt.Sprintf("%s\n\n%s%s\n\n", title, note, item)
}
return fmt.Sprintf("%s\n\n%s", title, note)
}

Expand Down
7 changes: 4 additions & 3 deletions cli/azd/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,10 @@ func getCmdConfigHelpDescription(*cobra.Command) string {
formatHelpNote(fmt.Sprintf("The default configuration path is: %s.",
output.WithBackticks(defaultConfigPath),
)),
},
"The configuration directory can be overridden by specifying a path in the AZD_CONFIG_DIR environment variable.",
)
formatHelpNote(fmt.Sprintf("The configuration directory can be overridden by specifying a path" +
" in the AZD_CONFIG_DIR environment variable.",
)),
})
}

func getCmdConfigHelpFooter(c *cobra.Command) string {
Expand Down
3 changes: 1 addition & 2 deletions cli/azd/cmd/testdata/TestUsage-azd-config.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ Manage the Azure Developer CLI user configuration, which includes your default A
Applications are initially configured when you run azd init.
The subscription and location you select will be stored at: %HOME/.azd/config.json.
The default configuration path is: %HOME/.azd.
The configuration directory can be overridden by specifying a path in the AZD_CONFIG_DIR environment variable.

The configuration directory can be overridden by specifying a path in the AZD_CONFIG_DIR environment variable.

Usage
azd config [command]

Expand Down

0 comments on commit c55c60c

Please sign in to comment.