marioortizmanero / polybar-pulseaudio-control

A feature-full Polybar module to control PulseAudio
MIT License
466 stars 49 forks source link

CLI flag followed by value removes the value #63

Closed Aerion closed 2 years ago

Aerion commented 2 years ago

Hello,

When the last CLI flag is one that doesn't expect any argument (e.g. --osd), the last CLI argument is not taken into accound.

To reproduce, in its simplest form

# Expected results: displays the output
$ pulseaudio-control --osd output
Unrecognised action:
# Expected results: throws an error as this_argument_is_ignored is invalid
$ pulseaudio-control --osd this_argument_is_ignored output
64% Sink #69

There is a workaround: to either follow it with a random arg that will get discarded, or ensure that the following argument is a one starting with --.

Best,

marioortizmanero commented 2 years ago

Oh, you're right. I don't know how we hadn't caught this before, thanks. The logic in the argument parser is wrong, it's fixed in #66. Take a look and let me know if that fixes your issue.