Commit Graph

28 Commits

Author SHA1 Message Date
Philip Sequeira eec7660274 TOOLS/zsh.pl: don't filter files by extension
Closes #2273. See that issue for explanation/discussion.

I'll add examples on how to filter in your own config to the wiki soon:
https://github.com/mpv-player/mpv/wiki/Zsh-completion-customization
2016-09-10 21:46:03 +02:00
Philip Sequeira defcb9047e TOOLS/zsh.pl: die if we can't parse main options
This will catch cases where mpv runs without error, but the
--list-options output isn't what we expect. Otherwise, we'll make a
broken completion file that will result in cryptic errors when pressing
tab, like:

_mpv:18: command not found: *:files:->mfiles

That's been the case for most of the zsh completion issues we've had
reported, that I can remember.

Also make uninitialized variable access fatal so that failures to parse
other options will also make the script die eventually, albeit with a
less nice message.
2016-09-10 21:46:01 +02:00
wgmk a05f20ea1e TOOLS/zsh.pl: add m4a to zsh completion filetype list 2016-08-26 21:17:24 +02:00
Yen Chi Hsuan 72e94941c9 TOOLS/zsh.pl: add .f4v extension in zsh completions 2016-05-27 17:03:00 +02:00
Philip Sequeira d797f7def9 TOOLS/zsh.pl: complete --audio-device 2016-04-16 18:47:15 +02:00
Philip Sequeira a2db0105ab TOOLS/zsh.pl: properly escape last change
I'm an idiot.

Fixes #3032.
2016-04-08 19:48:12 +02:00
Philip Sequeira 4561649f2d TOOLS/zsh.pl: don't complete URLs by default
...unless no files match. Fixes #2892.

To get the old behaviour back, use something like:
zstyle ':completion:*:*:mpv:*' tag-order
2016-04-08 10:57:54 +02:00
Martin Herkt d5c5a2b05e
TOOLS/zsh.pl: add .wv extension in zsh completions 2016-03-26 18:23:37 +01:00
Eric G fb185e4e79 TOOLS/zsh.pl: add .opus extension in zsh completions 2015-12-29 19:30:57 +01:00
Philip Sequeira bad743aed5 TOOLS/zsh.pl: only check the actual exit code when calling mpv
Ignore the other bits of $?. Apparently they can be set even if the
command succeeded.
2015-09-20 14:21:03 +02:00
Philip Sequeira 2cf019ed70 TOOLS/zsh.pl: die loudly if mpv fails to run 2015-07-19 22:04:45 +02:00
Philip Sequeira 8158dfc9e8 TOOLS/zsh.pl: complete multiple values for ao, vo, af, vf
It still doesn't deal with sub-options, but that's for another day.
2015-03-31 15:05:09 +02:00
Philip Sequeira d6b102cab0 TOOLS/zsh.pl: cosmetics 2015-03-31 15:05:08 +02:00
Philip Sequeira 638a398d62 TOOLS/zsh.pl: use --no-config when calling mpv 2015-03-31 15:05:08 +02:00
Philip Sequeira db30c3a3fe TOOLS/zsh.pl: complete options based on types
No more equals signs for options that don't take values.

Complete values for options with preset choices.

Complete --no-whatever where applicable.

Fixes #997.
2015-01-06 06:57:52 +01:00
Philip Sequeira 7c77f0b803 TOOLS/zsh.pl: complete options that take file names 2014-09-13 02:03:09 +02:00
Philip Sequeira b36ed6d9f9 TOOLS/zsh.pl: protect global environment 2014-08-17 12:51:10 +02:00
Philip Sequeira c7e67d008a TOOLS/zsh.pl: fix a ret that hadn't been changed to rc 2014-08-17 12:51:10 +02:00
Philip Sequeira 4b8f512217 TOOLS/zsh.pl: complete profiles
Implemented in shell, because it has to be done at runtime.
2014-08-17 12:51:10 +02:00
Alessandro Ghedini e7cab32fae TOOLS/zsh.pl: properly set the return value
The previous commit made the completion script always return non-zero, even when
a match is found. This explicitly sets the return value to zero whenever a match
is found but defaults to non-zero in case nothing is matched.
2014-08-13 23:42:38 +02:00
c_14 fd98863b1f TOOLS/zsh.pl: properly return non-zero when no matches are found
Returning a non-zero value signals to the zsh completion system that no matches
were added by the script so that it can try the user-defined matchers (e.g.
those defined with matcher-list).

Fixes #1008.
2014-08-13 22:57:59 +02:00
Alessandro Ghedini 29b047da6f TOOLS/zsh.pl: complete URL schemes based on --list-protocols 2014-07-03 11:03:56 +02:00
Alessandro Ghedini 17d65f9aff TOOLS/zsh.pl: sort options in reverse order by length
This stops options that are prefixes of other options from blocking
completion of values for the longer ones.
2014-07-03 11:03:56 +02:00
Philip Sequeira e940afec15 TOOLS/zsh.pl: untabify 2014-07-03 11:03:56 +02:00
Philip Sequeira 7450a7f531 TOOLS/zsh.pl: fix _arguments line
Don't use _x_arguments, as we don't support X arguments.

Get rid of -s, because we don't support multiple single-letter options
in one argument.

Add -S, because we ignore options after "--".
2014-07-03 11:03:56 +02:00
Philip Sequeira bbc005825a TOOLS/zsh.pl: don't consume extra arguments
Completion now uses "--opt=value" instead of "--opt value". Once the
user presses space and starts a new argument, the option just
completed is out of the picture, whether or not it was given an
argument. This handles options with no arguments or optional arguments
much better; previously, completing such an option would effectively
disable completion for the next argument.

Custom completed options such as "--ao" and friends will no longer
claim to consume an extra argument.
2014-07-03 11:03:56 +02:00
Philip Sequeira fd09578f0f TOOLS/zsh.pl: escape all colons in option descriptions 2014-07-03 11:03:56 +02:00
Alessandro Ghedini da27eceb85 TOOLS: add script for generating a zsh completion script
As discussed in #775
2014-06-08 20:48:39 +02:00