Skip to content

Commit

Permalink
Merge pull request #9 from ADorigi/fix/disable-table
Browse files Browse the repository at this point in the history
fix: disabled table output
  • Loading branch information
ADorigi authored Sep 16, 2024
2 parents 9204301 + 390a28a commit e87fd74
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 deletions.
20 changes: 9 additions & 11 deletions cmd/get/benchmarks.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
"io"
"net/http"

"github.com/adorigi/checkctl/pkg/output/tables"

"github.com/adorigi/checkctl/pkg/config"
"github.com/adorigi/checkctl/pkg/request"
"github.com/adorigi/checkctl/pkg/types"
Expand Down Expand Up @@ -80,17 +78,17 @@ to quickly create a Cobra application.`,
return err
}

if outputFormat == "table" {
rows := utils.GenerateBenchmarkRows(getBenchmarksResponse.Items)
// if outputFormat == "table" {
// rows := utils.GenerateBenchmarkRows(getBenchmarksResponse.Items)

tables.PrintBenchmarksTable(rows)
} else {
js, err := json.MarshalIndent(getBenchmarksResponse.Items, "", " ")
if err != nil {
return err
}
fmt.Print(string(js))
// tables.PrintBenchmarksTable(rows)
// } else {
js, err := json.MarshalIndent(getBenchmarksResponse.Items, "", " ")
if err != nil {
return err
}
fmt.Print(string(js))
// }

fmt.Printf(
"\n\n\n\nNext Page: \n\tcheckctl get benchmarks --page-size %d --page-number %d --output %s\n",
Expand Down
20 changes: 9 additions & 11 deletions cmd/get/controls.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
"io"
"net/http"

"github.com/adorigi/checkctl/pkg/output/tables"

"github.com/adorigi/checkctl/pkg/config"
"github.com/adorigi/checkctl/pkg/request"
"github.com/adorigi/checkctl/pkg/types"
Expand Down Expand Up @@ -78,17 +76,17 @@ to quickly create a Cobra application.`,
return err
}

if outputFormat == "table" {
rows := utils.GenerateControlRows(getControlsResponse.Items)
// if outputFormat == "table" {
// rows := utils.GenerateControlRows(getControlsResponse.Items)

tables.PrintControlsTable(rows)
} else {
js, err := json.MarshalIndent(getControlsResponse.Items, "", " ")
if err != nil {
return err
}
fmt.Print(string(js))
// tables.PrintControlsTable(rows)
// } else {
js, err := json.MarshalIndent(getControlsResponse.Items, "", " ")
if err != nil {
return err
}
fmt.Print(string(js))
// }

fmt.Printf(
"\n\n\n\nNext Page: \n\tcheckctl get controls --page-size %d --page-number %d --output %s\n",
Expand Down

0 comments on commit e87fd74

Please sign in to comment.