bad boolean logic for List-on-Info commands

This commit is contained in:
Chris Baker
2021-02-03 21:29:05 +00:00
parent 32c7b7d9c3
commit fbdbd7736c
3 changed files with 3 additions and 3 deletions

View File

@@ -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))

View File

@@ -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))

View File

@@ -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))