Skip to content

Commit

Permalink
fix: disabled table output
Browse files Browse the repository at this point in the history
  • Loading branch information
ADorigi committed Sep 16, 2024
1 parent 9204301 commit 390a28a
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 390a28a

Please sign in to comment.