Skip to content

Commit

Permalink
-no-outputs is enabled by default
Browse files Browse the repository at this point in the history
  • Loading branch information
dex4er committed Sep 13, 2023
1 parent 1f13bf2 commit 94ad12f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ messages about progress and shows short indicator (default), `-dots` hides
messages about progress and shows single dot or character for each line,
`-verbatim` keeps original messages about progress, `-verbose` adds counters
to original messages (default if `TF_IN_AUTOMATION=1`), `-no-outputs` hides
outputs.
outputs (default, `-no-outputs=false` shows it again).

The command accepts resource name as an argument without `-target=` option. If
argument misses quotes inside square brackets then they will be added.
Expand Down Expand Up @@ -144,7 +144,7 @@ messages about progress and shows short indicator (default), `-dots` hides
messages about progress and shows single dot or character for each line,
`-verbatim` keeps original messages about progress, `-verbose` adds counters
to original messages (default if `TF_IN_AUTOMATION=1`), `-no-outputs` hides
outputs.
outputs (default, `-no-outputs=false` shows it again).

The command accepts resource name as an argument without `-target=` option. If
argument misses quotes inside square brackets then they will be added.
Expand Down Expand Up @@ -232,7 +232,7 @@ messages about progress and shows short indicator (default), `-dots` hides
messages about progress and shows single dot or character for each line,
`-verbatim` keeps original messages about progress, `-verbose` adds counters
to original messages (default if `TF_IN_AUTOMATION=1`), `-no-outputs` hides
outputs.
outputs (default, `-no-outputs=false` shows it again).

The command accepts resource name as an argument without `-target=` option. If
argument misses quotes inside square brackets then they will be added.
Expand Down
4 changes: 3 additions & 1 deletion run/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ func Show(args []string) error {
resources := []string{}
newArgs := []string{}

noOutputs := false
noOutputs := true

for _, arg := range args {
if arg == "-no-output" || arg == "-no-outputs" {
noOutputs = true
} else if arg == "-no-output=false" || arg == "-no-outputs=false" {
noOutputs = false
} else if strings.HasPrefix(arg, "-") {
newArgs = append(newArgs, arg)
} else {
Expand Down
8 changes: 6 additions & 2 deletions run/terraform_with_progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func terraformWithProgress(command string, args []string) error {
patternStillOperation := `(?:.\[0m.\[1m)?(.*?): Still (.).*ing\.\.\..*?(?:\r?\n|$)`
patternStopOperation := `(?:.\[0m.\[1m)?(.*?): (.)(?:ead|reation|estruction|odifications) complete after.*?(?:\r?\n|$)`

patternIgnoreOutputs := `^(Changes to )?Outputs:(\n|$)`
patternIgnoreOutputs := `^Outputs:(\n|$)`

reIgnoreLine := regexp.MustCompile(patternIgnoreLine)
reIgnoreNextLine := regexp.MustCompile(patternIgnoreNextLine)
Expand All @@ -120,7 +120,7 @@ func terraformWithProgress(command string, args []string) error {
planFormat := "short"
progressFormat := "counters"
noColor := false
noOutputs := false
noOutputs := true

if TF_IN_AUTOMATION == "1" {
progressFormat = "verbose"
Expand Down Expand Up @@ -164,6 +164,10 @@ func terraformWithProgress(command string, args []string) error {
noOutputs = true
case "-no-outputs":
noOutputs = true
case "-no-output=false":
noOutputs = false
case "-no-outputs=false":
noOutputs = false
case "-quiet":
progressFormat = "quiet"
case "-short":
Expand Down

0 comments on commit 94ad12f

Please sign in to comment.