diff options
author | Sean E. Russell <ser@ser1.net> | 2020-06-20 08:33:01 -0500 |
---|---|---|
committer | Sean E. Russell <ser@ser1.net> | 2020-06-20 08:33:01 -0500 |
commit | 9a56571373eb5a9ea9261afb39bebaf7ddeb700f (patch) | |
tree | 594855544e7fdfc3c1d502d8397b38c7e9a8b4a5 /cmd | |
parent | c0a06128a2c69daf07c399a25d44a1e923ddb7ef (diff) |
Fixes the help text issue. Moved some hard-coded strings to the translation files.
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/gotop/main.go | 32 |
1 files changed, 5 insertions, 27 deletions
diff --git a/cmd/gotop/main.go b/cmd/gotop/main.go index 5e1cd09..2d718bd 100644 --- a/cmd/gotop/main.go +++ b/cmd/gotop/main.go @@ -21,8 +21,8 @@ import ( "github.com/VictoriaMetrics/metrics" jj "github.com/cloudfoundry-attic/jibber_jabber" ui "github.com/gizak/termui/v3" + "github.com/jdkeke142/lingo-toml" "github.com/shibukawa/configdir" - "github.com/xxxserxxx/lingo" "github.com/xxxserxxx/opflag" "github.com/xxxserxxx/gotop/v4" @@ -107,9 +107,9 @@ func parseArgs() error { if *list != "" { switch *list { case "layouts": - fmt.Println(_layouts) + fmt.Println(tr.Value("help.layouts")) case "colorschemes": - fmt.Println(_colorschemes) + fmt.Println(tr.Value("help.colorschemes")) case "paths": fmt.Println(tr.Value("help.paths")) paths := make([]string, 0) @@ -122,9 +122,9 @@ func parseArgs() error { case "devices": listDevices() case "keys": - fmt.Println(tr.Value("widget.help")) + fmt.Println(tr.Value("help.help")) case "widgets": - fmt.Println(_widgets) + fmt.Println(tr.Value("help.widgets")) default: fmt.Printf(tr.Value("error.unknownopt", *list)) os.Exit(1) @@ -508,25 +508,3 @@ func listDevices() { } } } - -const _layouts = `Built-in layouts: - default - minimal - battery - kitchensink` -const _colorschemes = `Built-in colorschemes: - default - default-dark (for white background) - solarized - solarized16-dark - solarized16-light - monokai - vice` -const _widgets = `Widgets that can be used in layouts: - cpu - CPU load graph - mem - Physical & swap memory use graph - temp - Sensor temperatures - disk - Physical disk partition use - power - A battery bar - net - Network load - procs - Interactive process list` |