Skip to content

Commit

Permalink
Merge pull request #13 from breml/show-unchanged
Browse files Browse the repository at this point in the history
Add show-unchanged flag
  • Loading branch information
breml authored Aug 9, 2024
2 parents cbe275c + c7a4af1 commit b13c8ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion format.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
8 changes: 7 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand All @@ -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 {
Expand Down

0 comments on commit b13c8ce

Please sign in to comment.