MusicPlayerDaemon / mpc

Command-line client for MPD
GNU General Public License v2.0
191 stars 36 forks source link

Can't save queue to a playlist with dash (minus) at the beginning of the playlist name #104

Closed Schlaefer closed 8 months ago

Schlaefer commented 11 months ago

Steps to reproduce

Try to save the current queue to a new playlist providing a playlist name starting with -

mpc --host=<host> save "- test"

Observed result

mpc: invalid option - test

No playlist is created

Expected result

The mpd instance should create a new playlist with the name - test

Environment

mpc version 0.34 mpd version 0.23.12

Delapouite commented 11 months ago

Hi. I don't have mpc on my current machine to test it right now. Usually in CLI tools needing this kind of disambiguation between flags and other arguments, you can use --. So it may works:

mpc --host=<host> save -- "- test"
MaxKellermann commented 11 months ago

Thanks @Delapouite, that's exactly how it works - mpc follows the GNU convention here. But this fact isn't documented in the manpage, so this is a bug, though only a documentation bug.

Schlaefer commented 11 months ago

Thanks, that works (same with rm for removing). - Leave the ticket open as "documentation reminder" or close?

MaxKellermann commented 11 months ago

Leave open.