Skip to content

Commit

Permalink
refactor: table format to constants (#19)
Browse files Browse the repository at this point in the history
This is a minor styling/semantics thing, as it does make more sense for them to be placed into constants rather than vars.
  • Loading branch information
jdockerty authored Dec 6, 2022
1 parent f353d1c commit 5d665f4
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions cmd/plugin/cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ var (
// Only 'time' is supported currently.
sortField string

// When using the namespace provided by the `--namespace/-n` flag or current context.
// This represents: Pod, Container, Request, Limit, and Termination Time
singleNamespaceFormatting = "%s\t%s\t%s\t%s\t%s\n"

// When using the `all-namespaces` flag, we must show which namespace the pod was in, this becomes an extra column.
// This represents: Namespace, Pod, Container, Request, Limit, and Termination Time
allNamespacesFormatting = "%s\t%s\t%s\t%s\t%s\t%s\n"

// Formatting for table output, similar to other kubectl commands.
t = tabwriter.NewWriter(os.Stdout, 10, 1, 5, ' ', 0)
Expand All @@ -53,6 +46,14 @@ const (

// Sort by termination timestamp in ascending order.
sortFieldTerminationTime = "time"

// When using the namespace provided by the `--namespace/-n` flag or current context.
// This represents: Pod, Container, Request, Limit, and Termination Time
singleNamespaceFormatting = "%s\t%s\t%s\t%s\t%s\n"

// When using the `all-namespaces` flag, we must show which namespace the pod was in, this becomes an extra column.
// This represents: Namespace, Pod, Container, Request, Limit, and Termination Time
allNamespacesFormatting = "%s\t%s\t%s\t%s\t%s\t%s\n"
)

func RootCmd() *cobra.Command {
Expand Down

0 comments on commit 5d665f4

Please sign in to comment.