diff --git a/format.go b/format.go index b2085d6..0ce6215 100644 --- a/format.go +++ b/format.go @@ -104,7 +104,7 @@ func (a *App) diff(change *tfjson.Change) string { jsondiffprinter.WithTerraformDefaults(), jsondiffprinter.WithWriter(buf), jsondiffprinter.WithIndentation(" "), - jsondiffprinter.WithHideUnchanged(true), + jsondiffprinter.WithHideUnchanged(!a.showUnchanged), jsondiffprinter.WithJSONinJSONCompare(compare), jsondiffprinter.WithColor(!a.noColor), jsondiffprinter.WithPatchSeriesPostProcess(func(diff jsondiffprinter.Patch) jsondiffprinter.Patch { diff --git a/main.go b/main.go index 02d4924..2488c27 100644 --- a/main.go +++ b/main.go @@ -46,6 +46,11 @@ Resource actions are indicated with the following symbols: Usage: "Disable colorized output", Destination: &app.noColor, }, + &cli.BoolFlag{ + Name: "show-unchanged", + Usage: "Show unchanged attributes", + Destination: &app.showUnchanged, + }, }, CustomAppHelpTemplate: cli.AppHelpTemplate + executionPlanLegend, @@ -56,7 +61,8 @@ Resource actions are indicated with the following symbols: } type App struct { - noColor bool + noColor bool + showUnchanged bool } func (a *App) Reveal(c *cli.Context) error {