Skip to content

Commit 1196233

Browse files
authored
[CLI] az bicep decompile-params: Add --force option to overwrite existing output
1 parent 9a9b4bc commit 1196233

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/azure-cli/azure/cli/command_modules/resource/_help.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2410,6 +2410,8 @@
24102410
text: az bicep decompile-params --file {json_template_file}
24112411
- name: Attempts to decompile a parameters .json file to .bicepparam using the bicep file given.
24122412
text: az bicep decompile-params --file {json_template_file} --bicep-file {bicep_file}
2413+
- name: Attempts to decompile a parameters .json file to .bicepparam and overwrite existing output.
2414+
text: az bicep decompile-params --file {json_template_file} --force
24132415
- name: Attempts to decompile a parameters .json file to .bicepparam and print all output to stdout.
24142416
text: az bicep decompile-params --file {json_template_file} --stdout
24152417
- name: Attempts to decompile a parameters .json file to .bicepparam and print all output to stdout and save the result to the specified directory.

src/azure-cli/azure/cli/command_modules/resource/custom.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4198,7 +4198,7 @@ def decompile_bicep_file(cmd, file, force=None):
41984198
run_bicep_command(cmd.cli_ctx, args)
41994199

42004200

4201-
def decompileparams_bicep_file(cmd, file, bicep_file=None, outdir=None, outfile=None, stdout=None):
4201+
def decompileparams_bicep_file(cmd, file, bicep_file=None, outdir=None, outfile=None, stdout=None, force=None):
42024202
ensure_bicep_installation(cmd.cli_ctx)
42034203

42044204
minimum_supported_version = "0.18.4"
@@ -4212,6 +4212,8 @@ def decompileparams_bicep_file(cmd, file, bicep_file=None, outdir=None, outfile=
42124212
args += ["--outfile", outfile]
42134213
if stdout:
42144214
args += ["--stdout"]
4215+
if force:
4216+
args += ["--force"]
42154217

42164218
output = run_bicep_command(cmd.cli_ctx, args)
42174219

0 commit comments

Comments
 (0)