su8 / pinky-bar

Gather some system information and show it in this program
GNU General Public License v3.0
14 stars 5 forks source link

Make error strings more consistent #14

Closed lasers closed 6 years ago

lasers commented 6 years ago

Hi. I ran into minor inconsistency with py3status pinkybar module.

When error, display pinkybar: unrecognized options: --su8. NICE When error, display pinkybar: program with --su8 and --lasers. NOT NICE

The header pinkybar: comes from py3status's module name. The message comes from pinkybar error message.

The problem is that when I get unrecognized options, I saw header and version too, pinkybar: 1.00.00, so I skipped first two words in my code. The second message does not have header and version... is which why it skipped recompile the message. This should be:

When error, display pinkybar: recompile the program with --su8 and --lasers. NICE Real example, --with-alsa or --with-oss.

See if we can make error strings "as_fn_error" more consistent. Keep in mind that the code to skip first two words can be removed too.

su8 commented 6 years ago
# compiled --without-alsa
src/pinkybar --volume

output

recompile the program --with-alsa or --with-oss

I don't see what's wrong with this.

su8 commented 6 years ago

So you want the error message to start with pinkybar: recompile the program --with-this-and-that ?

lasers commented 6 years ago

For py3status pinkybar module, yes.

Print pinkybar 1.00.00: recompile the program --with-alsa or --with-oss.

This also make pinkybar error message looks nice in terminal.

su8 commented 6 years ago

And for the error messages that --without-net prints, e.g "Error: recompile the program --with-net", do I have to add pinkybar: infront too ?

lasers commented 6 years ago

Yes, probably. Everything should be consistent. --bandwidth and --ipmac prints pinkybar 1.00: okay, but not sure about option. So maybe other arguments are missing option too.... or not. Either way, everything still should be consistent.

lasers commented 6 years ago

Well, I realized this is more of a different message than others, so it make sense to leave it alone. EDIT: Or not... I don't know. >_>

su8 commented 6 years ago

Thanks for the suggestion, it should be fixed in the latest commit.

lasers commented 6 years ago

Missing version? Got pinkybar: the program --with-alsa or --without oss. If you prefer, I can skip only 1 word.

su8 commented 6 years ago

Yes that would be great, because I might bump up the version in configure.ac and someone might ping me that pinkybar is using the old version.

lasers commented 6 years ago

Will the versions be removed in --bandwidth, --ipmac, etc too?

su8 commented 6 years ago

That's handled by the library argp. Will bring the version back.

lasers commented 6 years ago

Got pinkybar: recompile the program --with-alsa or --with-oss. Is nice now. If I run into this problem again with any other arguments, I'll ping you here. Many thanks. >:-}~