From fbdbd7736c798c02bcb136db2845d2cea98125bf Mon Sep 17 00:00:00 2001 From: Chris Baker <1675087+cgbaker@users.noreply.github.com> Date: Wed, 3 Feb 2021 21:29:05 +0000 Subject: [PATCH] bad boolean logic for List-on-Info commands --- command/alloc_status.go | 2 +- command/eval_status.go | 2 +- command/job_inspect.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/command/alloc_status.go b/command/alloc_status.go index ed388da23..aabcaaf43 100644 --- a/command/alloc_status.go +++ b/command/alloc_status.go @@ -115,7 +115,7 @@ func (c *AllocStatusCommand) Run(args []string) int { } // If args not specified but output format is specified, format and output the allocations data list - if len(args) == 0 && json || len(tmpl) > 0 { + if len(args) == 0 && (json || len(tmpl) > 0) { allocs, _, err := client.Allocations().List(nil) if err != nil { c.Ui.Error(fmt.Sprintf("Error querying allocations: %v", err)) diff --git a/command/eval_status.go b/command/eval_status.go index 881bb9dbe..967ff6efd 100644 --- a/command/eval_status.go +++ b/command/eval_status.go @@ -106,7 +106,7 @@ func (c *EvalStatusCommand) Run(args []string) int { } // If args not specified but output format is specified, format and output the evaluations data list - if len(args) == 0 && json || len(tmpl) > 0 { + if len(args) == 0 && (json || len(tmpl) > 0) { evals, _, err := client.Evaluations().List(nil) if err != nil { c.Ui.Error(fmt.Sprintf("Error querying evaluations: %v", err)) diff --git a/command/job_inspect.go b/command/job_inspect.go index 7f030f67a..6966f04e8 100644 --- a/command/job_inspect.go +++ b/command/job_inspect.go @@ -94,7 +94,7 @@ func (c *JobInspectCommand) Run(args []string) int { } // If args not specified but output format is specified, format and output the jobs data list - if len(args) == 0 && json || len(tmpl) > 0 { + if len(args) == 0 && (json || len(tmpl) > 0) { jobs, _, err := client.Jobs().List(nil) if err != nil { c.Ui.Error(fmt.Sprintf("Error querying jobs: %v", err))