summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/ISSUE_TEMPLATE/enhancement.md33
-rw-r--r--.github/workflows/release.yml7
-rw-r--r--CHANGELOG.md11
-rw-r--r--README.md96
-rw-r--r--cmd/gotop/main.go84
-rw-r--r--config.go57
-rw-r--r--devices/cpu_cpu.go2
-rw-r--r--devices/temp_freebsd.go2
-rw-r--r--go.mod20
-rw-r--r--go.sum170
-rw-r--r--translations/en_US.toml44
-rw-r--r--widgets/battery.go23
-rw-r--r--widgets/batterygauge.go29
-rw-r--r--widgets/cpu.go42
-rw-r--r--widgets/disk.go22
-rw-r--r--widgets/mem.go41
-rw-r--r--widgets/metrics.go19
-rw-r--r--widgets/net.go25
-rw-r--r--widgets/temp.go22
19 files changed, 322 insertions, 427 deletions
diff --git a/.github/ISSUE_TEMPLATE/enhancement.md b/.github/ISSUE_TEMPLATE/enhancement.md
new file mode 100644
index 0000000..1fa2020
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/enhancement.md
@@ -0,0 +1,33 @@
+### Is your proposal related to a problem?
+
+<!--
+ Provide a clear and concise description of what the problem is.
+ For example, "I'm always frustrated when..."
+-->
+
+(Write your answer here.)
+
+### Describe the solution you'd like
+
+<!--
+ Provide a clear and concise description of what you want to happen.
+-->
+
+(Describe your proposed solution here.)
+
+### Describe alternatives you've considered
+
+<!--
+ Let us know about other solutions you've tried or researched.
+-->
+
+(Write your answer here.)
+
+### Additional context
+
+<!--
+ Is there anything else you can add about the proposal?
+ You might want to link to related issues here, if you haven't already.
+-->
+
+(Write your answer here.)
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 6390f46..a90118a 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -29,3 +29,10 @@ jobs:
repository: xxxserxxx/gotop-linux
event-type: my-release
client-payload: '{"tag": "${{ steps.tag_name.outputs.tag }}"}'
+
+ - name: Update and inform Homebrew
+ uses: dawidd6/action-homebrew-bump-formula@v3
+ with:
+ token: ${{ secrets.homebrew }}
+ formula: gotop
+ revision: ${{ steps.tag_name.outputs.tag }}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b40b415..318c4f0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -31,12 +31,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Adds ability to filter reported temperatures (#92)
- Command line option to list layouts, paths, colorschemes, hotkeys, and filterable devices
- Adds ability to write out a configuration file
+- Adds a command for specifying the configuration file to use
### Changed
- Log files stored in \$XDG_CACHE_HOME; DATA, CONFIG, CACHE, and RUNTIME are the only directories specified by the FreeDesktop spec.
- Extensions are now built with a build tool; this is an interim solution until issues with the Go plugin API are resolved.
- Command line help text is cleaned up.
+- Version bump of gopsutil
+- Prometheus client replaced by [VictoriaMetrics/metrics](https://github.com/VictoriaMetrics/metrics). This eliminated 6 indirect package dependencies and saved 3.5MB (25%) of the compiled binary size.
### Removed
@@ -54,7 +57,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Config file loading from `~/.config/gotop` wasn't working
- There were a number of minor issues with the config file that have been cleaned up.
-## [3.5.1] - 2020-04-09
+## [3.5.2] - 2020-04-28
+
+### Fixed
+
+- Fixes (an embarrasing) null map bug on FreeBSD (#94)
+
+## [3.5.1] - 2020-04-09
This is a bug fix release.
diff --git a/README.md b/README.md
index fd37437..4d3e571 100644
--- a/README.md
+++ b/README.md
@@ -23,56 +23,25 @@ Working and tested on Linux, FreeBSD and MacOS. Windows binaries are provided, b
If you install gotop by hand, or you download or create new layouts or colorschemes, you will need to put the layout files where gotop can find them. To see the list of directories gotop looks for files, run `gotop -h`. The first directory is always the directory from which gotop is run.
-### Arch
-
-AUR contains entries for `gotop` and `gotop-bin`. `gotop-git` still points at the old, unmaintained, repository for the moment.
-
-```
-yay -S gotop-bin
-```
-
-There is also a build-from-source package:
-
-```
-yay -S gotop
-```
+- **Arch**: Install from AUR, e.g. `yay -S gotop-bin`. There is also `gotop` and `gotop-git`
+- **Gentoo**: gotop is available on [guru](https://gitweb.gentoo.org/repo/proj/guru.git) overlay.
+ ```shell
+ sudo layman -a guru
+ sudo emerge gotop
+ ```
+- **OSX**: gotop is in *homebrew-core*. `brew install gotop`. Make sure to uninstall and untap any previous installations or taps.
+- **Prebuilt binaries**: Binaries for most systems can be downloaded from [the github releases page](https://github.com/xxxserxxx/gotop/releases). RPM and DEB packages are also provided.
+- **Source**: This requires Go >= 1.14. `go get -u github.com/xxxserxxx/gotop/cmd/gotop`
-### Gentoo
+### Console Users Note
-`gotop` is available on [guru](https://gitweb.gentoo.org/repo/proj/guru.git) overlay. It's currently required to add this overlay in order to install `gotop`:
+gotop requires a font that has braille and block character Unicode code points; some distributions do not provide this. In the gotop repository is a `pcf` font that has these points, and setting this font may improve how gotop renders in your console. To use this, run these commands:
```shell
-sudo layman -a guru
-sudo emerge gotop
+$ curl -O -L https://raw.githubusercontent.com/xxxserxxx/gotop/master/fonts/Lat15-VGA16-braille.psf
+$ setfont Lat15-VGA16-braille.psf
```
-### OSX
-
-gotop can be installed with [Homebrew](https://brew.sh/); you'll need to tap the recipe. If you'd previously tapped cjbassi's recipe, you'll want to untap that first. The old version of gotop is also included in Homebrew's core library, and that will always be chosen before any taps, so you have to specify the tap specifically.
-
-```
-brew uninstall gotop # If previously installed
-brew untap cjbassi/gotop # If previously tapped
-brew tap xxxserxxx/gotop
-brew install xxxserxxx/gotop/gotop
-```
-
-### Prebuilt binaries
-
-This doesn't require Go, is easy, and works across distributions. You have to manually upgrade the executable yourself, though, so using your distribution's package (if one is available) is a better approach.
-
-Visit [the releases page](https://github.com/xxxserxxx/gotop/releases) with your web browser and download the appropriate file for your OS and architecture. Unzip it (the archive contains a single file) and then move the resulting `gotop` binary into your `$PATH` somewhere. If you're on a Debian or Redhat derivative, you can download an `.rpm` or `.deb` and install that.
-
-### Source
-
-This requires Go, and at the moment, Go 1.14 specifically.
-
-```bash
-go get -u github.com/xxxserxxx/gotop/cmd/gotop
-```
-
-If you don't have Go 1.14, you will want to follow the Building instructions in the next section.
-
### Building
This is the download & compile approach.
@@ -90,44 +59,14 @@ Move `gotop` to somewhere in your `$PATH`.
## Usage
-### Keybinds
-
-- Quit: `q` or `<C-c>`
-- Process navigation:
- - `k` and `<Up>`: up
- - `j` and `<Down>`: down
- - `<C-u>`: half page up
- - `<C-d>`: half page down
- - `<C-b>`: full page up
- - `<C-f>`: full page down
- - `gg` and `<Home>`: jump to top
- - `G` and `<End>`: jump to bottom
-- Process actions:
- - `<Tab>`: toggle process grouping
- - `dd`: kill selected process or group of processes with SIGTERM
- - `d3`: kill selected process or group of processes with SIGQUIT
- - `d9`: kill selected process or group of processes with SIGKILL
-- Process sorting
- - `c`: CPU
- - `m`: Mem
- - `p`: PID
-- Process filtering:
- - `/`: start editing filter
- - (while editing):
- - `<Enter>` accept filter
- - `<C-c>` and `<Escape>`: clear filter
-- CPU and Mem graph scaling:
- - `h`: scale in
- - `l`: scale out
-- `?`: toggles keybind help menu
-- `b`: toggles display of network traffic in mbps or TX (or RX) per second
-
-### Mouse
+Run with `-h` to get an extensive list of command line arguments. Many of these can be configured by creating a configuration file; see the next section for more information. Key bindings can be viewed while gotop is running by pressing the `?` key, or they can be printed out by using the `--list keys` command.
+
+In addition to the key bindings, the mouse can be used to control the process list:
- click to select process
- mouse wheel to scroll through processes
-### Config file
+## Config file
Most command-line settings can be persisted into a configuration file. The config file is named `gotop.conf` and can be located in several places. The first place gotop will look is in the current directory; after this, the locations depend on the OS and distribution. On Linux using XDG, for instance, the home location of `~/.config/gotop/gotop.conf` is the second location. The last location is a system-wide global location, such as `/etc/gotop/gotop.conf`. The `-h` help command will print out all of the locations, in order. Command-line options override values in any config files, and only the first config file found is loaded.
@@ -290,6 +229,7 @@ Run `gotop -h` to see the list of all command line options.
- [shirou/gopsutil](https://github.com/shirou/gopsutil)
- [goreleaser/nfpm](https://github.com/goreleaser/nfpm)
- [distatus/battery](https://github.com/distatus/battery)
+- [VictoriaMetrics/metrics](https://github.com/VictoriaMetrics/metrics) Check this out! The API is clean, elegant, introduces many fewer indirect dependencies than the Prometheus client, and adds 50% less size to binaries.
## History
diff --git a/cmd/gotop/main.go b/cmd/gotop/main.go
index 1cbc50d..dc869ce 100644
--- a/cmd/gotop/main.go
+++ b/cmd/gotop/main.go
@@ -1,6 +1,8 @@
package main
import (
+ "bufio"
+ "flag"
"fmt"
"io"
"log"
@@ -15,10 +17,10 @@ import (
//_ "net/http/pprof"
+ "github.com/VictoriaMetrics/metrics"
ui "github.com/gizak/termui/v3"
- "github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/shibukawa/configdir"
- flag "github.com/xxxserxxx/opflag"
+ "github.com/xxxserxxx/opflag"
"github.com/xxxserxxx/gotop/v4"
"github.com/xxxserxxx/gotop/v4/colorschemes"
@@ -50,49 +52,50 @@ var (
stderrLogger = log.New(os.Stderr, "", 0)
)
-func parseArgs(conf *gotop.Config) error {
+func parseArgs() error {
cds := conf.ConfigDir.QueryFolders(configdir.All)
cpaths := make([]string, len(cds))
for i, p := range cds {
cpaths[i] = p.Path
}
- help := flag.BoolP("help", "h", false, "Show this screen.")
- color := flag.StringP("color", "c", conf.Colorscheme.Name, "Set a colorscheme.")
- flag.IntVarP(&conf.GraphHorizontalScale, "graphscale", "S", conf.GraphHorizontalScale, "Graph scale factor, >0")
- version := flag.BoolP("version", "v", false, "Print version and exit.")
- versioN := flag.BoolP("", "V", false, "Print version and exit.")
- flag.BoolVarP(&conf.PercpuLoad, "percpu", "p", conf.PercpuLoad, "Show each CPU in the CPU widget.")
- flag.BoolVarP(&conf.AverageLoad, "averagecpu", "a", conf.AverageLoad, "Show average CPU in the CPU widget.")
- fahrenheit := flag.BoolP("fahrenheit", "f", conf.TempScale == 'F', "Show temperatures in fahrenheit.Show temperatures in fahrenheit.")
- flag.BoolVarP(&conf.Statusbar, "statusbar", "s", conf.Statusbar, "Show a statusbar with the time.")
- flag.DurationVarP(&conf.UpdateInterval, "rate", "r", conf.UpdateInterval, "Number of times per second to update CPU and Mem widgets.")
- flag.StringVarP(&conf.Layout, "layout", "l", conf.Layout, `Name of layout spec file for the UI. Use "-" to pipe.`)
- flag.StringVarP(&conf.NetInterface, "interface", "i", "all", "Select network interface. Several interfaces can be defined using comma separated values. Interfaces can also be ignored using `!`")
- flag.StringVarP(&conf.ExportPort, "export", "x", conf.ExportPort, "Enable metrics for export on the specified port.")
- flag.BoolVarP(&conf.Mbps, "mbps", "", conf.Mbps, "Show network rate as mbps.")
+ help := opflag.BoolP("help", "h", false, "Show this screen.")
+ color := opflag.StringP("color", "c", conf.Colorscheme.Name, "Set a colorscheme.")
+ opflag.IntVarP(&conf.GraphHorizontalScale, "graphscale", "S", conf.GraphHorizontalScale, "Graph scale factor, >0")
+ version := opflag.BoolP("version", "v", false, "Print version and exit.")
+ versioN := opflag.BoolP("", "V", false, "Print version and exit.")
+ opflag.BoolVarP(&conf.PercpuLoad, "percpu", "p", conf.PercpuLoad, "Show each CPU in the CPU widget.")
+ opflag.BoolVarP(&conf.AverageLoad, "averagecpu", "a", conf.AverageLoad, "Show average CPU in the CPU widget.")
+ fahrenheit := opflag.BoolP("fahrenheit", "f", conf.TempScale == 'F', "Show temperatures in fahrenheit.Show temperatures in fahrenheit.")
+ opflag.BoolVarP(&conf.Statusbar, "statusbar", "s", conf.Statusbar, "Show a statusbar with the time.")
+ opflag.DurationVarP(&conf.UpdateInterval, "rate", "r", conf.UpdateInterval, "Number of times per second to update CPU and Mem widgets.")
+ opflag.StringVarP(&conf.Layout, "layout", "l", conf.Layout, `Name of layout spec file for the UI. Use "-" to pipe.`)
+ opflag.StringVarP(&conf.NetInterface, "interface", "i", "all", "Select network interface. Several interfaces can be defined using comma separated values. Interfaces can also be ignored using `!`")
+ opflag.StringVarP(&conf.ExportPort, "export", "x", conf.ExportPort, "Enable metrics for export on the specified port.")
+ opflag.BoolVarP(&conf.Mbps, "mbps", "", conf.Mbps, "Show network rate as mbps.")
// FIXME Where did this go??
- //conf.Band = flag.IntP("bandwidth", "B", 100, "Specify the number of bits per seconds.")
- flag.BoolVar(&conf.Test, "test", conf.Test, "Runs tests and exits with success/failure code.")
- list := flag.String("list", "", `List <devices|layouts|colorschemes|paths|keys>
+ //conf.Band = opflag.IntP("bandwidth", "B", 100, "Specify the number of bits per seconds.")
+ opflag.BoolVar(&conf.Test, "test", conf.Test, "Runs tests and exits with success/failure code.")
+ opflag.StringP("", "C", "", "Config file to use instead of default (MUST BE FIRST ARGUMENT)")
+ list := opflag.String("list", "", `List <devices|layouts|colorschemes|paths|keys>
devices: Prints out device names for filterable widgets
layouts: Lists build-in layouts
colorschemes: Lists built-in colorschemes
paths: List out configuration file search paths
- widgets: Widgets that can be used in a layout
+ widgets: Widgets that can be used in a layout
keys: Show the keyboard bindings.`)
- wc := flag.Bool("write-config", false, "Write out a default config file.")
- flag.SortFlags = false
- flag.Usage = func() {
+ wc := opflag.Bool("write-config", false, "Write out a default config file.")
+ opflag.SortFlags = false
+ opflag.Usage = func() {
fmt.Fprintf(os.Stderr, "Usage: %s [options]\n\nOptions:\n", os.Args[0])
- flag.PrintDefaults()
+ opflag.PrintDefaults()
}
- flag.Parse()
+ opflag.Parse()
if *version || *versioN {
fmt.Printf("gotop %s (%s)\n", Version, BuildDate)
os.Exit(0)
}
if *help {
- flag.Usage()
+ opflag.Usage()
os.Exit(0)
}
cs, err := colorschemes.FromName(conf.ConfigDir, *color)
@@ -331,14 +334,17 @@ func eventLoop(c gotop.Config, grid *layout.MyGrid) {
}
}
-// TODO: Add fans
-// TODO: mpd visualizer widget
+// TODO: @devices fans
+// TODO: @devices mpd visualizer
+// TODO: @devices color bars for memory, a-la bashtop
// TODO: Add tab completion for Linux https://gist.github.com/icholy/5314423
// TODO: state:merge #135 linux console font (cmatsuoka/console-font)
// TODO: Abstract out the UI toolkit. mum4k/termdash, VladimirMarkelov/clui, gcla/gowid, rivo/tview, marcusolsson/tui-go might work better for some OS/Archs. Performance/memory use comparison would be interesting.
-// TODO: all of the go vet stuff, more unit tests, benchmarks, finish remote.
-// TODO: color bars for memory, a-la bashtop
+// TODO: more unit tests, benchmarks
+// TODO: README is getting long. Move to wiki.
// TODO: add verbose debugging option
+// TODO: find VMs for FreeBSD, etc for testing gotop
+// TODO: add README about extensions, and wiki page for writing extensions
func main() {
// For performance testing
//go func() {
@@ -359,15 +365,23 @@ func main() {
}
func run() int {
- conf := gotop.NewConfig()
+ conf = gotop.NewConfig()
// Find the config file; look in (1) local, (2) user, (3) global
+ // Check the last argument first
+ fs := flag.NewFlagSet("config", flag.ContinueOnError)
+ cfg := fs.String("C", "", "Config file")
+ fs.SetOutput(bufio.NewWriter(nil))
+ fs.Parse(os.Args[1:])
+ if *cfg != "" {
+ conf.ConfigFile = *cfg
+ }
err := conf.Load()
if err != nil {
fmt.Printf("failed to parse config file: %s\n", err)
return 2
}
// Override with command line arguments
- err = parseArgs(&conf)
+ err = parseArgs()
if err != nil {
fmt.Printf("parsing CLI args: %s\n", err)
return 2
@@ -433,7 +447,9 @@ func run() int {
if conf.ExportPort != "" {
go func() {
- http.Handle("/metrics", promhttp.Handler())
+ http.HandleFunc("/metrics", func(w http.ResponseWriter, req *http.Request) {
+ metrics.WritePrometheus(w, true)
+ })
http.ListenAndServe(conf.ExportPort, nil)
}()
}
diff --git a/config.go b/config.go
index 6a109e0..758b8c2 100644
--- a/config.go
+++ b/config.go
@@ -5,7 +5,9 @@ import (
"bytes"
"fmt"
"io"
+ "io/ioutil"
"log"
+ "os"
"path/filepath"
"strconv"
"strings"
@@ -16,6 +18,9 @@ import (
"github.com/xxxserxxx/gotop/v4/widgets"
)
+// CONFFILE is the name of the default config file
+const CONFFILE = "gotop.conf"
+
type Config struct {
ConfigDir configdir.ConfigDir
GraphHorizontalScale int
@@ -34,6 +39,7 @@ type Config struct {
Temps []string
Test bool
ExtensionVars map[string]string
+ ConfigFile string
}
func NewConfig() Config {
@@ -54,20 +60,29 @@ func NewConfig() Config {
ExtensionVars: make(map[string]string),
}
conf.Colorscheme, _ = colorschemes.FromName(conf.ConfigDir, "default")
+ folder := conf.ConfigDir.QueryFolderContainsFile(CONFFILE)
+ if folder != nil {
+ conf.ConfigFile = filepath.Join(folder.Path, CONFFILE)
+ }
return conf
}
func (conf *Config) Load() error {
var in []byte
+ if conf.ConfigFile == "" {
+ return nil
+ }
var err error
- cfn := "gotop.conf"
- folder := conf.ConfigDir.QueryFolderContainsFile(cfn)
- if folder != nil {
- if in, err = folder.ReadFile(cfn); err != nil {
- return err
+ if _, err = os.Stat(conf.ConfigFile); os.IsNotExist(err) {
+ // Check for the file in the usual suspects
+ folder := conf.ConfigDir.QueryFolderContainsFile(conf.ConfigFile)
+ if folder == nil {
+ return nil
}
- } else {
- return nil
+ conf.ConfigFile = filepath.Join(folder.Path, conf.ConfigFile)
+ }
+ if in, err = ioutil.ReadFile(conf.ConfigFile); err != nil {
+ return err
}
return load(bytes.NewReader(in), conf)
}
@@ -169,21 +184,35 @@ func load(in io.Reader, conf *Config) error {
return nil
}
+// Write serializes the configuration to a file.
+// The configuration written is based on the loaded configuration, plus any
+// command-line changes, so it can be used to update an existing configuration
+// file. The file will be written to the specificed `--config` argument file,
+// if one is set; otherwise, it'll create one in the user's config directory.
func (conf *Config) Write() (string, error) {
- cfn := "gotop.conf"
- ds := conf.ConfigDir.QueryFolders(configdir.Global)
- if len(ds) == 0 {
- ds = conf.ConfigDir.QueryFolders(configdir.Local)
+ var dir *configdir.Config
+ var file string = CONFFILE
+ if conf.ConfigFile == "" {
+ ds := conf.ConfigDir.QueryFolders(configdir.Global)
if len(ds) == 0 {
- return "", fmt.Errorf("error locating config folders")
+ ds = conf.ConfigDir.QueryFolders(configdir.Local)
+ if len(ds) == 0 {
+ return "", fmt.Errorf("error locating config folders")
+ }
}
+ ds[0].CreateParentDir(CONFFILE)
+ dir = ds[0]
+ } else {
+ dir = &configdir.Config{}
+ dir.Path = filepath.Dir(conf.ConfigFile)
+ file = filepath.Base(conf.ConfigFile)
}
marshalled := marshal(conf)
- err := ds[0].WriteFile(cfn, marshalled)
+ err := dir.WriteFile(file, marshalled)
if err != nil {
return "", err
}
- return filepath.Join(ds[0].Path, cfn), nil
+ return filepath.Join(dir.Path, file), nil
}
func marshal(c *Config) []byte {
diff --git a/devices/cpu_cpu.go b/devices/cpu_cpu.go
index 42eff2e..a959e32 100644
--- a/devices/cpu_cpu.go
+++ b/devices/cpu_cpu.go
@@ -7,6 +7,8 @@ import (
psCpu "github.com/shirou/gopsutil/cpu"
)
+// FIXME: broken % under Linux. Doesn't reflect reality *at all*.
+// FIXME: gotop CPU use high -- gopsutils again? Try rolling back.
func init() {
f := func(cpus map[string]int, iv time.Duration, l bool) map[string]error {
cpuCount, err := psCpu.Counts(l)
diff --git a/devices/temp_freebsd.go b/devices/temp_freebsd.go
index 03eb770..196a6d7 100644
--- a/devices/temp_freebsd.go
+++ b/devices/temp_freebsd.go
@@ -21,7 +21,7 @@ var sensorOIDS = map[string]string{
}
func update(temps map[string]int) map[string]error {
- var errors map[string]error
+ errors := make(map[string]error)
for k, v := range sensorOIDS {
if _, ok := temps[k]; !ok {
diff --git a/go.mod b/go.mod
index 29a5919..1763e3d 100644
--- a/go.mod
+++ b/go.mod
@@ -1,25 +1,19 @@
module github.com/xxxserxxx/gotop/v4
require (
- github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect
+ github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect
+ github.com/VictoriaMetrics/metrics v1.11.2
github.com/distatus/battery v0.9.0
- github.com/docopt/docopt.go v0.0.0-20180111231733-ee0de3bc6815
github.com/gizak/termui/v3 v3.0.0
- github.com/go-ole/go-ole v1.2.1 // indirect
+ github.com/go-ole/go-ole v1.2.4 // indirect
github.com/mattn/go-runewidth v0.0.4
- github.com/mitchellh/go-wordwrap v1.0.0 // indirect
- github.com/prometheus/client_golang v1.4.1
github.com/shibukawa/configdir v0.0.0-20170330084843-e180dbdc8da0
- github.com/shirou/gopsutil v2.18.11+incompatible
- github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 // indirect
+ github.com/shirou/gopsutil v2.20.3+incompatible
github.com/stretchr/testify v1.4.0
github.com/xxxserxxx/iSMC v1.0.1
- github.com/xxxserxxx/opflag v1.0.3
- golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a // indirect
- golang.org/x/tools v0.0.0-20200425043458-8463f397d07c // indirect
- golang.org/x/tools/gopls v0.4.0 // indirect
- howett.net/plist v0.0.0-20181124034731-591f970eefbb // indirect
- mvdan.cc/xurls/v2 v2.2.0 // indirect
+ github.com/xxxserxxx/opflag v1.0.5
+ golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25 // indirect
+ howett.net/plist v0.0.0-20200419221736-3b63eb3a43b5 // indirect
)
go 1.14
diff --git a/go.sum b/go.sum
index 2410a27..d698b71 100644
--- a/go.sum
+++ b/go.sum
@@ -1,52 +1,18 @@
-github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
-github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
-github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 h1:fLjPD/aNc3UIOA6tDi6QXUemppXK3P9BI7mr2hd6gx8=
-github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
-github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
-github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
-github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
-github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
-github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
-github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
-github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
-github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
-github.com/cespare/xxhash/v2 v2.1.1 h1:6MnRN8NT7+YBpUIWxHtefFZOKTAPgGjpQSxqLNn0+qY=
-github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
+github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk=
+github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
+github.com/VictoriaMetrics/metrics v1.11.2 h1:t/ceLP6SvagUqypCKU7cI7+tQn54+TIV/tGoxihHvx8=
+github.com/VictoriaMetrics/metrics v1.11.2/go.mod h1:LU2j9qq7xqZYXz8tF3/RQnB2z2MbZms5TDiIg9/NHiQ=
github.com/cjbassi/drawille-go v0.0.0-20190126131713-27dc511fe6fd h1:XtfPmj9tQRilnrEmI1HjQhxXWRhEM+m8CACtaMJE/kM=
github.com/cjbassi/drawille-go v0.0.0-20190126131713-27dc511fe6fd/go.mod h1:vjcQJUZJYD3MeVGhtZXSMnCHfUNZxsyYzJt90eCYxK4=
+github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
-github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/distatus/battery v0.9.0 h1:8NS5o00/j3Oh2xgocA6pQROTp5guoR+s8CZlWzHC4QM=
github.com/distatus/battery v0.9.0/go.mod h1:gGO7GxHTi1zlRT+cAj8uGG0/8HFiqAeH0TJvoipnuPs=
-github.com/docopt/docopt.go v0.0.0-20180111231733-ee0de3bc6815 h1:HMAfwOa33y82IaQEKQDfUCiwNlxtM1iw7HLM9ru0RNc=
-github.com/docopt/docopt.go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:l7JNRynTRuqe45tpIyItHNqZWTxywYjp87MWTOnU5cg=
github.com/gizak/termui/v3 v3.0.0 h1:NYTUG6ig/sJK05O5FyhWemwlVPO8ilNpvS/PgRtrKAE=
github.com/gizak/termui/v3 v3.0.0/go.mod h1:uinu2dMdtMI+FTIdEFUJQT5y+KShnhQRshvPblXq3lY=
-github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
-github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
-github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
-github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
-github.com/go-ole/go-ole v1.2.1 h1:2lOsA72HgjxAuMlKpFiCbHTvu44PIVkZ5hqm3RSdI/E=
-github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8=
-github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
-github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
-github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
-github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
-github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
-github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
-github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
-github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
+github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI=
+github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
-github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
-github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
-github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
-github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
-github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
-github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
@@ -55,128 +21,38 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y=
github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
-github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
-github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
+github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 h1:DpOJ2HYzCv8LZP15IdmG+YdwD2luVPHITV96TkirNBM=
github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
-github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4=
-github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo=
-github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
-github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
-github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
-github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
-github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d h1:x3S6kxmy49zXVVyhcnrFqxvNVCBPb2KZ9hV2RBdS840=
github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d/go.mod h1:IuKpRQcYE1Tfu+oAQqaLisqDeXgjyyltCfsaoYN18NQ=
github.com/panotza/gosmc v0.0.0-20190601191911-810267459a2a h1:P0QSyHOubLI2e6hccBBEjVX0vPWXoXui5QCAVNWdJSk=
github.com/panotza/gosmc v0.0.0-20190601191911-810267459a2a/go.mod h1:u8Q8dpnMAam0MElxP2KjEROzXMk9G8X168RTpAZ9tPc=
-github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
-github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
-github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
-github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
-github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
-github.com/prometheus/client_golang v1.4.1 h1:FFSuS004yOQEtDdTq+TAOLP5xUq63KqAFYyOi8zA+Y8=
-github.com/prometheus/client_golang v1.4.1/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU=
-github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
-github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M=
-github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
-github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
-github.com/prometheus/common v0.9.1 h1:KOMtN28tlbam3/7ZKEYKHhKoJZYYj3gMH4uc62x7X7U=
-github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4=
-github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
-github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
-github.com/prometheus/procfs v0.0.8 h1:+fpWZdT24pJBiqJdAwYBjPSk+5YmQzYNPYzQsdzLkt8=
-github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A=
-github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
-github.com/rogpeppe/go-internal v1.5.2/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
-github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
-github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/shibukawa/configdir v0.0.0-20170330084843-e180dbdc8da0 h1:Xuk8ma/ibJ1fOy4Ee11vHhUFHQNpHhrBneOCNHVXS5w=
github.com/shibukawa/configdir v0.0.0-20170330084843-e180dbdc8da0/go.mod h1:7AwjWCpdPhkSmNAgUv5C7EJ4AbmjEB3r047r3DXWu3Y=
-github.com/shirou/gopsutil v2.18.11+incompatible h1:PMFTKnFTr/YTRW5rbLK4vWALV3a+IGXse5nvhSjztmg=
-github.com/shirou/gopsutil v2.18.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
-github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 h1:udFKJ0aHUL60LboW/A+DfgoHVedieIzIXE8uylPue0U=
-github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc=
-github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
-github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
-github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
+github.com/shirou/gopsutil v2.20.3+incompatible h1:0JVooMPsT7A7HqEYdydp/OfjSOYSjhXV7w1hkKj/NPQ=
+github.com/shirou/gopsutil v2.20.3+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
-github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
-github.com/xxxserxxx/gotop v0.0.0-20200228201131-d16cf1c6d2b9 h1:Sn+TuKkfF+CVaJjm4oVmeADtrOaHtrWpgqVLtsMpUqg=
-github.com/xxxserxxx/gotop/v3 v3.5.1 h1:aBf++Oxg7qCZpKqYpPPnXKFOxT1KYLPtiEXRh57ywu0=
-github.com/xxxserxxx/gotop/v3 v3.5.1/go.mod h1:DGPTiAmUhqE21xvokK64BuMxW+EmnOptaxpdOlqiH6s=
+github.com/valyala/fastrand v1.0.0 h1:LUKT9aKer2dVQNUi3waewTbKV+7H17kvWFNKs2ObdkI=
+github.com/valyala/fastrand v1.0.0/go.mod h1:HWqCzkrkg6QXT8V2EXWvXCoow7vLwOFN002oeRzjapQ=
+github.com/valyala/histogram v1.0.1 h1:FzA7n2Tz/wKRMejgu3PV1vw3htAklTjjuoI6z3d4KDg=
+github.com/valyala/histogram v1.0.1/go.mod h1:lQy0xA4wUz2+IUnf97SivorsJIp8FxsnRd6x25q7Mto=
github.com/xxxserxxx/iSMC v1.0.1 h1:M9Gkwnnkl+evvnugoB5yRYrbUP+cRIVOPM+xrHZc3Hs=