shell-completion: zsh: Use -S and -A with _arguments

-S makes the option parser to not try parsing arguments as options
after "--" has appeared in the command line.

-A "-*" makes the option parser to not try parsing arguments as
options after the first non-option argument. The "-*" pattern means
that if there are unrecognized parameters that look like options
(i.e. start with a dash), those should not terminate the option
parsing.
This commit is contained in:
Tanu Kaskinen 2014-08-16 14:48:18 +03:00
parent cd3cae9285
commit db6d5011cd

View file

@ -275,7 +275,7 @@ _pactl_completion() {
'cards: list available cards'
)
_arguments -C \
_arguments -C -S -A '-*' \
{-h,--help}'[display help and exit]' \
'--version[show version and exit]' \
{-s,--server}'[name of server to connect to]:host:_hosts' \
@ -369,7 +369,7 @@ _pacmd_completion() {
_describe 'pacmd commands' _pacmd_commands
}
_arguments -C \
_arguments -C -S -A "-*" \
{-h,--help}'[display help and exit]' \
'--version[show version and exit]' \
'::pacmd commands:_pacmd_command' \
@ -403,14 +403,14 @@ _pacmd_completion() {
}
_pasuspender_completion() {
_arguments -C \
_arguments -S -A "-*" -C \
{-h,--help}'[display help and exit]' \
'--version[show version and exit]' \
{-s,--server}'[name of server to connect to]:host:_hosts' \
}
_padsp_completion() {
_arguments -C \
_arguments -C -S -A "-*" \
'-h[display help and exit]' \
'-s[name of server to connect to]:host:_hosts' \
'-n[client name to use]:name:' \
@ -429,7 +429,7 @@ _pacat_completion() {
_pacat_sample_formats=('s16le' 's16be' 'u8' 'float32le' 'float32be'
'ulaw' 'alaw' 's32le' 's32be' 's24le' 's24-32le' 's24-32be')
_arguments -C \
_arguments -C -S -A "-*" \
{-h,--help}'[display this help and exit]' \
'--version[show version and exit]' \
{-r,--record}'[create a connection for recording]' \