Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add show-unchanged flag #13

Merged
merged 1 commit into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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