Created attachment 127833 [details] [review] updated tab completion for pasuspender zsh tabcompletion of pasuspender suggests -C although -C is supposed to be an option for _arguments and not a suggestion for pasuspender. The fix is trivial by reordering - _arguments -S -A "-*" -C \ + _arguments -C -S -A "-*" \ (the other completions in _pulseaudio already have the option in this order). Additional suggestions for pasuspender: The current completion keeps suggesting options, even if they won't do anyhting, e.g. pasuspender --help --v<tab> will suggest --version. This can be removed by adding '(-)' at the beginning of the argument. As enhancement one can add "--" to the suggestions and afterwards switch to standard tab completion to suggest programs and their completion. Here it gets tricky as "--" should not get suggested after "--help" or "--version" but it should get suggested after "--server=<hostname>". patch attached.
Thanks! I applied the patch to the "next" branch.
Urgh, I realized the function can be written easier, without the ugly shift counting: _pasuspender_completion() { # parenthesis expressions specify which options should not get suggested afterwards # e.g. after -s, help and version will not get suggested, -- remains the only valid argument # after "--" external commands get suggested _arguments -C \ '(-)'{-h,--help}'[display help and exit]' \ '(-)--version[show version and exit]' \ '(-h --help --version -s --server)'{-s,--server=}'[name of server to connect to]:host:_hosts' \ '(-)--[program]:program: _command_names -e:*::program arguments: _normal' }
Would you like to send another patch?
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.