xxxserxxx / gotop

A terminal based graphical activity monitor inspired by gtop and vtop
Other
2.69k stars 138 forks source link

Help text for --bytes is not shown correctly in some translations #224

Open andypiper opened 2 years ago

andypiper commented 2 years ago
gotop version:

gotop 4.1.3 (20220214T213516)

OS/Arch:
ProductName:    macOS
ProductVersion: 12.4
BuildVersion:   21F79
Terminal emulator:

iTerm 2

The output from gotop -h shows this (affected section only shown) - I'm running on a system where the language is set to English.

  -x, --export=         Enable metrics for export on the specified port.
  --mbps                Show network rate as mbps.
  --bytes               args.no-mbps <--- this is the issue
  --test                Runs tests and exits with success/failure code.
  --no-test             Disable tests.

As shown, the help text for the --bytes option shows the text args.no-mbps. This appears to be caused by this line of code:

https://github.com/xxxserxxx/gotop/blob/b0fd8ac8cd8ba8f6351fd1ef798ebb9db80fc42a/cmd/gotop/main.go#L84

As shown, the parser attempts to print the translated text for the value of args.no-mbps which in some of the translations has been set, but in the English translation has instead been defined as the text for arg.bytes.

I'm not choosing to send a PR at this time as this affects several language translation files (most of which I'm not proficient with!) and also, the arg name has been set to no-mbps in some of the files, but left as bytes in other files. The fix itself should just be a case of choosing whether the arg name should be no-mbps or bytes; and then setting that arg name consistently across cmd/gotop/main.go and dict/*.toml.

Hope this helps!