Skip to content

Commit

Permalink
update help (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskim06 authored Feb 11, 2023
1 parent 65cb355 commit b845db6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions internal/cmd/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ var (
Use: "pod",
Aliases: []string{"pods"},
Short: "Show pod metrics",
Long: addKeyboardShortcutsToDescription(`Show various widgets for pod metrics.
Long: addKeyboardShortcutsToDescription(`Show pod metrics.
CPU and memory percentages are calculated by getting the sum of the container
limits/requests for a given pod.`),
limits for a given pod.`),
Args: cobra.NoArgs,
RunE: func(_ *cobra.Command, args []string) error {
app := ui.New(metrics.POD, interval, podOpts, flags)
Expand Down
5 changes: 2 additions & 3 deletions internal/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ var (
Short: "Prettier kubectl top output",
Long: addKeyboardShortcutsToDescription(`Render kubectl top output with fancier widgets!
This shows separate lists of gauges for the CPU and memory. It also has a panel
that displays the CPU and memory percentage graphs for the lifespan of the
command invocation. The standard top output is also displayed.`),
This shows standard top output along with a graph showing cpu and memory utilization for
the currently selected pod or node. You can also view the selected pod or node spec.`),
SilenceUsage: true,
SilenceErrors: true,
Args: cobra.NoArgs,
Expand Down
6 changes: 4 additions & 2 deletions internal/cmd/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ import (

const (
selectorHelpStr = "Selector (label query) to filter on, supports '=', '==', and '!=' (e.g. -l key1=value1,key2=value2)."
intervalHelpStr = "The interval in seconds between getting metrics (defaults to 5)."
intervalHelpStr = "The interval in seconds between getting metrics (defaults to 3)."
keyboardShortcuts = `
Keyboard Shortcuts:
- q: quit
- j: scroll down
- k: scroll up`
- k: scroll up
- ?: display help modal
- enter: view spec for selected item`
)

func addKeyboardShortcutsToDescription(usage string) string {
Expand Down

0 comments on commit b845db6

Please sign in to comment.