summaryrefslogtreecommitdiffstats
path: root/cmd/gotop/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/gotop/main.go')
-rw-r--r--cmd/gotop/main.go18
1 files changed, 13 insertions, 5 deletions
diff --git a/cmd/gotop/main.go b/cmd/gotop/main.go
index 5dbcd3e..5728128 100644
--- a/cmd/gotop/main.go
+++ b/cmd/gotop/main.go
@@ -74,12 +74,13 @@ Options:
-b, --battery Show battery level widget ('minimal' turns off). (DEPRECATED, use -l battery)
-B, --bandwidth=bits Specify the number of bits per seconds.
-l, --layout=NAME Name of layout spec file for the UI. Looks first in $XDG_CONFIG_HOME/gotop, then as a path. Use "-" to pipe.
- -i, --interface=NAME Select network interface [default: all]. Several interfaces can be defined using comma separated values. Interfaces can also be ignored using !
+ -i, --interface=NAME Select network interface [default: all]. Several interfaces can be defined using comma separated values. Interfaces can also be ignored using !
-x, --export=PORT Enable metrics for export on the specified port.
- -X, --extensions=NAMES Enables the listed extensions. This is a comma-separated list without the .so suffix. The current and config directories will be searched.
- --test Runs tests and exits with success/failure code
- --print-paths List out the paths that gotop will look for gotop.conf, layouts, color schemes, and extensions
- --print-keys Show the keyboard bindings
+ -X, --extensions=NAMES Enables the listed extensions. This is a comma-separated list without the .so suffix. The current and config directories will be searched.
+ --mbps Net widget shows mb(its)ps for RX/TX instead of scaled bytes per second.
+ --test Runs tests and exits with success/failure code.
+ --print-paths List out the paths that gotop will look for gotop.conf, layouts, color schemes, and extensions.
+ --print-keys Show the keyboard bindings.
Built-in layouts:
default
@@ -184,6 +185,9 @@ Log files are stored in %s
}
conf.GraphHorizontalScale = scl
}
+ if args["--mbps"].(bool) {
+ conf.Mbps = true
+ }
if args["--print-paths"].(bool) {
paths := make([]string, 0)
for _, d := range conf.ConfigDir.QueryFolders(configdir.All) {
@@ -308,6 +312,10 @@ func eventLoop(c gotop.Config, grid *layout.MyGrid) {
ui.Render(item)
}
}
+ case "b":
+ if grid.Net != nil {
+ grid.Net.Mbps = !grid.Net.Mbps
+ }
case "<Resize>":
ui.Render(grid)
if statusbar {