Skip to content

Commit 61f5e0d

Browse files
committed
add individual flags for raw and json format
1 parent 5fe67b3 commit 61f5e0d

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

cli/commands/stack/command.go

+18-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const (
1111
CommandName = "stack"
1212
OutputFormatFlagName = "format"
1313
OutputFormatEnvName = "TERRAGRUNT_STACK_OUTPUT_FORMAT"
14+
JsonFormatFlagName = "json"
15+
RawFormatFlagName = "json"
1416

1517
generate = "generate"
1618
run = "run"
@@ -23,14 +25,29 @@ const (
2325
// NewFlags builds the flags for stack.
2426
func NewFlags(opts *options.TerragruntOptions) cli.Flags {
2527
return cli.Flags{
26-
// Stack flags
2728
&cli.GenericFlag[string]{
2829
Name: OutputFormatFlagName,
2930
EnvVar: OutputFormatEnvName,
3031

3132
Destination: &opts.StackOutputFormat,
3233
Usage: "Stack output format. Valid values are: json, raw",
3334
},
35+
&cli.BoolFlag{
36+
Name: RawFormatFlagName,
37+
Usage: "Stack output in raw format",
38+
Action: func(ctx *cli.Context, value bool) error {
39+
opts.StackOutputFormat = rawOutputFormat
40+
return nil
41+
},
42+
},
43+
&cli.BoolFlag{
44+
Name: JsonFormatFlagName,
45+
Usage: "Stack output in json format",
46+
Action: func(ctx *cli.Context, value bool) error {
47+
opts.StackOutputFormat = jsonOutputFormat
48+
return nil
49+
},
50+
},
3451
}
3552
}
3653

0 commit comments

Comments
 (0)