altdesktop / playerctl

🎧 mpris media player command-line controller for vlc, mpv, RhythmBox, web browsers, cmus, mpd, spotify and others.
GNU Lesser General Public License v3.0
2.43k stars 79 forks source link

Suggestion: `playerctl --list-all` should output nothing if there are no players running #257

Closed jmcantrell closed 2 years ago

jmcantrell commented 2 years ago

If there are no players running, then the output is "No players found". When using this output in a script, there's no good way to tell if there are no players running, except to compare the output to that string. In my opinion, this is very brittle, and the standard/expected result when running a list command is that if there is nothing to list, then there should be no output.

acrisci commented 2 years ago

That's printed to stdout. Just filter that out and you will get what you want.

jmcantrell commented 2 years ago

Right, stdout would be the correct place to output it. I still think it's non-standard to output something when there's nothing to output. What purpose does it serve?

acrisci commented 2 years ago

It's standard to output useful diagnostic messages in stderr. It's useful in this case because it's probably the number one reported message on this issue tracker, and it's easier to report and understand than "exit 0 with no output" which may be confused with some other problem if you aren't familiar with the project.

jmcantrell commented 2 years ago

Thanks for the explanation.