From 24ff77257da1b85be775164acd8506b18bab8e5d Mon Sep 17 00:00:00 2001 From: "Menghua Chen (WICRESOFT NORTH AMERICA LTD)" Date: Thu, 2 Jan 2025 15:01:49 +0800 Subject: [PATCH 1/2] Do not hide outputFlag in help --- cli/azd/pkg/output/parameter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/azd/pkg/output/parameter.go b/cli/azd/pkg/output/parameter.go index d6998b07899..5b6973983eb 100644 --- a/cli/azd/pkg/output/parameter.go +++ b/cli/azd/pkg/output/parameter.go @@ -25,7 +25,7 @@ func AddOutputFlag(f *pflag.FlagSet, s *string, supportedFormats []Format, defau description := fmt.Sprintf("The output format (the supported formats are %s).", strings.Join(formatNames, ", ")) f.StringVarP(s, outputFlagName, "o", string(defaultFormat), description) //preview:flag hide --output - _ = f.MarkHidden(outputFlagName) + // _ = f.MarkHidden(outputFlagName) // Only error that can occur is "flag not found", which is not possible given we just added the flag on the previous line _ = f.SetAnnotation(outputFlagName, supportedFormatterAnnotation, formatNames) From cac2a8d1c00aa0087093bc32721c61212fb9ede1 Mon Sep 17 00:00:00 2001 From: "Menghua Chen (WICRESOFT NORTH AMERICA LTD)" Date: Thu, 2 Jan 2025 17:11:56 +0800 Subject: [PATCH 2/2] update testdata update testdata --- cli/azd/cmd/testdata/TestUsage-azd-auth-login.snap | 1 + cli/azd/cmd/testdata/TestUsage-azd-config-get.snap | 3 +++ cli/azd/cmd/testdata/TestUsage-azd-config-show.snap | 3 +++ cli/azd/cmd/testdata/TestUsage-azd-deploy.snap | 1 + cli/azd/cmd/testdata/TestUsage-azd-down.snap | 1 + cli/azd/cmd/testdata/TestUsage-azd-env-get-values.snap | 1 + cli/azd/cmd/testdata/TestUsage-azd-env-list.snap | 3 +++ cli/azd/cmd/testdata/TestUsage-azd-env-refresh.snap | 1 + cli/azd/cmd/testdata/TestUsage-azd-infra-synth.snap | 1 + cli/azd/cmd/testdata/TestUsage-azd-package.snap | 1 + cli/azd/cmd/testdata/TestUsage-azd-provision.snap | 1 + cli/azd/cmd/testdata/TestUsage-azd-restore.snap | 1 + cli/azd/cmd/testdata/TestUsage-azd-show.snap | 1 + cli/azd/cmd/testdata/TestUsage-azd-template-list.snap | 1 + cli/azd/cmd/testdata/TestUsage-azd-template-show.snap | 3 +++ cli/azd/cmd/testdata/TestUsage-azd-template-source-add.snap | 1 + cli/azd/cmd/testdata/TestUsage-azd-template-source-list.snap | 3 +++ cli/azd/cmd/testdata/TestUsage-azd-template-source-remove.snap | 3 +++ cli/azd/cmd/testdata/TestUsage-azd-up.snap | 1 + cli/azd/cmd/testdata/TestUsage-azd-version.snap | 3 +++ 20 files changed, 34 insertions(+) diff --git a/cli/azd/cmd/testdata/TestUsage-azd-auth-login.snap b/cli/azd/cmd/testdata/TestUsage-azd-auth-login.snap index abe6197e3f6..972276fb8b7 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-auth-login.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-auth-login.snap @@ -11,6 +11,7 @@ Flags --client-secret string : The client secret for the service principal to authenticate with. Set to the empty string to read the value from the console. --federated-credential-provider string : The provider to use to acquire a federated token to authenticate with. --managed-identity : Use a managed identity to authenticate. + -o, --output string : The output format (the supported formats are json, none). --redirect-port int : Choose the port to be used as part of the redirect URI during interactive login. --tenant-id string : The tenant id or domain name to authenticate with. --use-device-code : When true, log in by using a device code instead of a browser. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-config-get.snap b/cli/azd/cmd/testdata/TestUsage-azd-config-get.snap index 4b448e83cd5..3584966503e 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-config-get.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-config-get.snap @@ -4,6 +4,9 @@ Gets a configuration. Usage azd config get [flags] +Flags + -o, --output string : The output format (the supported formats are json). + Global Flags -C, --cwd string : Sets the current working directory. --debug : Enables debugging and diagnostics logging. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-config-show.snap b/cli/azd/cmd/testdata/TestUsage-azd-config-show.snap index b4970a7919f..02f5fef2836 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-config-show.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-config-show.snap @@ -4,6 +4,9 @@ Show all the configuration values. Usage azd config show [flags] +Flags + -o, --output string : The output format (the supported formats are json). + Global Flags -C, --cwd string : Sets the current working directory. --debug : Enables debugging and diagnostics logging. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-deploy.snap b/cli/azd/cmd/testdata/TestUsage-azd-deploy.snap index f56dde06875..0ae5e150580 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-deploy.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-deploy.snap @@ -12,6 +12,7 @@ Flags --all : Deploys all services that are listed in azure.yaml -e, --environment string : The name of the environment to use. --from-package string : Deploys the packaged service located at the provided path. Supports zipped file packages (file path) or container images (image tag). + -o, --output string : The output format (the supported formats are json, none). Global Flags -C, --cwd string : Sets the current working directory. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-down.snap b/cli/azd/cmd/testdata/TestUsage-azd-down.snap index f29b692ce83..ae068d4e6f9 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-down.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-down.snap @@ -7,6 +7,7 @@ Usage Flags -e, --environment string : The name of the environment to use. --force : Does not require confirmation before it deletes resources. + -o, --output string : The output format (the supported formats are json, none). --purge : Does not require confirmation before it permanently deletes resources that are soft-deleted by default (for example, key vaults). Global Flags diff --git a/cli/azd/cmd/testdata/TestUsage-azd-env-get-values.snap b/cli/azd/cmd/testdata/TestUsage-azd-env-get-values.snap index 7c8296ba56d..966eb7d7243 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-get-values.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-get-values.snap @@ -6,6 +6,7 @@ Usage Flags -e, --environment string : The name of the environment to use. + -o, --output string : The output format (the supported formats are json, dotenv). Global Flags -C, --cwd string : Sets the current working directory. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-env-list.snap b/cli/azd/cmd/testdata/TestUsage-azd-env-list.snap index 9159323e8a0..cddff865660 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-list.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-list.snap @@ -4,6 +4,9 @@ List environments. Usage azd env list [flags] +Flags + -o, --output string : The output format (the supported formats are json, table). + Global Flags -C, --cwd string : Sets the current working directory. --debug : Enables debugging and diagnostics logging. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-env-refresh.snap b/cli/azd/cmd/testdata/TestUsage-azd-env-refresh.snap index dcf4cebe0a8..6055211b07e 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-env-refresh.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-env-refresh.snap @@ -7,6 +7,7 @@ Usage Flags -e, --environment string : The name of the environment to use. --hint string : Hint to help identify the environment to refresh + -o, --output string : The output format (the supported formats are json, none). Global Flags -C, --cwd string : Sets the current working directory. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-infra-synth.snap b/cli/azd/cmd/testdata/TestUsage-azd-infra-synth.snap index 14da149cfb7..ba87fbd5438 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-infra-synth.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-infra-synth.snap @@ -7,6 +7,7 @@ Usage Flags -e, --environment string : The name of the environment to use. --force : Overwrite any existing files without prompting + -o, --output string : The output format (the supported formats are none). Global Flags -C, --cwd string : Sets the current working directory. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-package.snap b/cli/azd/cmd/testdata/TestUsage-azd-package.snap index 46e5ed27b47..b45eda6edbd 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-package.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-package.snap @@ -11,6 +11,7 @@ Usage Flags --all : Packages all services that are listed in azure.yaml -e, --environment string : The name of the environment to use. + -o, --output string : The output format (the supported formats are json, none). --output-path string : File or folder path where the generated packages will be saved. Global Flags diff --git a/cli/azd/cmd/testdata/TestUsage-azd-provision.snap b/cli/azd/cmd/testdata/TestUsage-azd-provision.snap index 3a8c2942df0..138cf8ec1fa 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-provision.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-provision.snap @@ -12,6 +12,7 @@ Usage Flags -e, --environment string : The name of the environment to use. --no-state : Do not use latest Deployment State (bicep only). + -o, --output string : The output format (the supported formats are json, none). --preview : Preview changes to Azure resources. Global Flags diff --git a/cli/azd/cmd/testdata/TestUsage-azd-restore.snap b/cli/azd/cmd/testdata/TestUsage-azd-restore.snap index 7c571438a97..6a8284afa3f 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-restore.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-restore.snap @@ -10,6 +10,7 @@ Usage Flags --all : Restores all services that are listed in azure.yaml -e, --environment string : The name of the environment to use. + -o, --output string : The output format (the supported formats are json, none). Global Flags -C, --cwd string : Sets the current working directory. diff --git a/cli/azd/cmd/testdata/TestUsage-azd-show.snap b/cli/azd/cmd/testdata/TestUsage-azd-show.snap index a7477e56c9a..44b3da9599a 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-show.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-show.snap @@ -6,6 +6,7 @@ Usage Flags -e, --environment string : The name of the environment to use. + -o, --output string : The output format (the supported formats are json, none). --show-secrets : Unmask secrets in output. Global Flags diff --git a/cli/azd/cmd/testdata/TestUsage-azd-template-list.snap b/cli/azd/cmd/testdata/TestUsage-azd-template-list.snap index c02d3e7ecc0..23b09b94310 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-template-list.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-template-list.snap @@ -6,6 +6,7 @@ Usage Flags -f, --filter strings : The tag(s) used to filter template results. Supports comma-separated values. + -o, --output string : The output format (the supported formats are json, table). -s, --source string : Filters templates by source. Global Flags diff --git a/cli/azd/cmd/testdata/TestUsage-azd-template-show.snap b/cli/azd/cmd/testdata/TestUsage-azd-template-show.snap index 328c50b52d0..eafcdf17a7e 100644 --- a/cli/azd/cmd/testdata/TestUsage-azd-template-show.snap +++ b/cli/azd/cmd/testdata/TestUsage-azd-template-show.snap @@ -4,6 +4,9 @@ Show details for a given template. (Beta) Usage azd template show