@@ -11,6 +11,8 @@ const (
11
11
CommandName = "stack"
12
12
OutputFormatFlagName = "format"
13
13
OutputFormatEnvName = "TERRAGRUNT_STACK_OUTPUT_FORMAT"
14
+ JsonFormatFlagName = "json"
15
+ RawFormatFlagName = "json"
14
16
15
17
generate = "generate"
16
18
run = "run"
@@ -23,14 +25,29 @@ const (
23
25
// NewFlags builds the flags for stack.
24
26
func NewFlags (opts * options.TerragruntOptions ) cli.Flags {
25
27
return cli.Flags {
26
- // Stack flags
27
28
& cli.GenericFlag [string ]{
28
29
Name : OutputFormatFlagName ,
29
30
EnvVar : OutputFormatEnvName ,
30
31
31
32
Destination : & opts .StackOutputFormat ,
32
33
Usage : "Stack output format. Valid values are: json, raw" ,
33
34
},
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
+ },
34
51
}
35
52
}
36
53
0 commit comments