Bug 85810

Summary: pactl command line parameter parsing is broken for decreasing volume
Product: PulseAudio Reporter: Réczey Bálint <balint>
Component: toolsAssignee: pulseaudio-bugs
Status: RESOLVED FIXED QA Contact: pulseaudio-bugs
Severity: normal    
Priority: medium CC: lennart
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Réczey Bálint 2014-11-03 15:17:27 UTC
$ pactl set-sink-volume  0 -3%
pactl: invalid option -- '3'
The following works fine:
$ pactl -- set-sink-volume  0 -3%

Probably options should not be reordered.
Comment 1 Peter Meerwald 2014-11-17 11:03:46 UTC
this is getopt() behaviour

getopt() should stop processing after the first non-option argument is encountered

setting the environment variable POSIXLY_CORRECT should also work around the issue

we could/should check at compile time if getopt() supports "+" as the first character of optstring (GNU extension)
Comment 2 Peter Meerwald 2014-11-17 11:17:51 UTC
fixed with commit 997e3696 (post v5.0) which adds the "+" to getopt()'s optstring

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.