summaryrefslogtreecommitdiffstats
path: root/TOOLS/zsh.pl
Commit message (Collapse)AuthorAgeFilesLines
* zsh completion: move generation to runtime and improvePhilip Sequeira2019-09-271-283/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The completion function itself now parses --list-options on the first tab press and caches the results. This does mean a slight delay on that first tab press, but it will only do this if the argument being completed looks like an option (i.e. starts with "-"), so there is never a delay when just completing a file name. I've also put some effort into making it reasonably fast; on my machine it's consistently under 100 ms, more than half of which is mpv itself. Installation of zsh completion is now done unconditionally because it's nothing more than copying a file. If you really don't want it installed, set zshdir to empty: `./waf configure --zshdir= ...` Improvements in functionality compared to the old script: * Produces the right results for mpv binaries other than the one it was installed with (like a dev build for testing changes). * Does not require running mpv at build time, so it won't cause problems with cross compilation. * Handles aliases. * Slightly nicer handling of options that take comma-separated values and/or sub-options: A space is now inserted at the end instead of a comma, allowing you to immediately start typing the next argument, but typing a comma will still remove the automatically added space, and = and : will now do that too, so you can immediately add a sub-option. * More general/flexible handling of values for options that print their possible values with --option=help. The code as is could handle quite a few more options (*scale, demuxers, decoders, ...), but nobody wants to maintain that list here so we'll just stick with what the old completion script already did.
* options: slightly improve filter help output for lavfi bridgewm42018-02-031-4/+4
| | | | | | | | | | | | | | --vf=help will now list libavfilter filters, and e.g. --vf=yadif=help will list libavfilter filter options. The latter is rather bare, because the AVOption API is really awful (holy shit how is it so bad), and would require us to handle _every_ option type manually. Alternatively we could call av_opt_show2(), which ffmpeg uses for help output in its CLI tools and which is much more detailed. But it's rather foreign and forces output through av_log(), so I don't really want to use it.
* TOOLS: change license of some scripts involved in build to LGPLwm42017-06-241-0/+17
| | | | | wscript calls them directly, and thus are probably part of the build system. They seem to be fully covered by relicensing agreements.
* TOOLS/zsh.pl: don't leak regex match variablesPhilip Sequeira2017-03-061-0/+3
|
* TOOLS/zsh.pl: don't filter files by extensionPhilip Sequeira2016-09-101-2/+1
| | | | | | | 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
* TOOLS/zsh.pl: die if we can't parse main optionsPhilip Sequeira2016-09-101-0/+3
| | | | | | | | | | | | | | | | 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.
* TOOLS/zsh.pl: add m4a to zsh completion filetype listwgmk2016-08-261-1/+1
|
* TOOLS/zsh.pl: add .f4v extension in zsh completionsYen Chi Hsuan2016-05-271-1/+1
|
* TOOLS/zsh.pl: complete --audio-devicePhilip Sequeira2016-04-161-6/+22
|
* TOOLS/zsh.pl: properly escape last changePhilip Sequeira2016-04-081-2/+2
| | | | | | I'm an idiot. Fixes #3032.
* TOOLS/zsh.pl: don't complete URLs by defaultPhilip Sequeira2016-04-081-1/+7
| | | | | | | ...unless no files match. Fixes #2892. To get the old behaviour back, use something like: zstyle ':completion:*:*:mpv:*' tag-order
* TOOLS/zsh.pl: add .wv extension in zsh completionsMartin Herkt2016-03-261-1/+1
|
* TOOLS/zsh.pl: add .opus extension in zsh completionsEric G2015-12-291-1/+1
|
* TOOLS/zsh.pl: only check the actual exit code when calling mpvPhilip Sequeira2015-09-201-2/+2
| | | | | Ignore the other bits of $?. Apparently they can be set even if the command succeeded.
* TOOLS/zsh.pl: die loudly if mpv fails to runPhilip Sequeira2015-07-191-2/+13
|
* TOOLS/zsh.pl: complete multiple values for ao, vo, af, vfPhilip Sequeira2015-03-311-21/+9
| | | | It still doesn't deal with sub-options, but that's for another day.
* TOOLS/zsh.pl: cosmeticsPhilip Sequeira2015-03-311-26/+25
|
* TOOLS/zsh.pl: use --no-config when calling mpvPhilip Sequeira2015-03-311-8/+8
|
* TOOLS/zsh.pl: complete options based on typesPhilip Sequeira2015-01-061-31/+70
| | | | | | | | | | 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.
* TOOLS/zsh.pl: complete options that take file namesPhilip Sequeira2014-09-131-0/+7
|
* TOOLS/zsh.pl: protect global environmentPhilip Sequeira2014-08-171-0/+4
|
* TOOLS/zsh.pl: fix a ret that hadn't been changed to rcPhilip Sequeira2014-08-171-1/+1
|
* TOOLS/zsh.pl: complete profilesPhilip Sequeira2014-08-171-0/+36
| | | | Implemented in shell, because it has to be done at runtime.
* TOOLS/zsh.pl: properly set the return valueAlessandro Ghedini2014-08-131-9/+12
| | | | | | 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.
* TOOLS/zsh.pl: properly return non-zero when no matches are foundc_142014-08-131-0/+1
| | | | | | | | 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.
* TOOLS/zsh.pl: complete URL schemes based on --list-protocolsAlessandro Ghedini2014-07-031-2/+7
|
* TOOLS/zsh.pl: sort options in reverse order by lengthAlessandro Ghedini2014-07-031-0/+9
| | | | | This stops options that are prefixes of other options from blocking completion of values for the longer ones.
* TOOLS/zsh.pl: untabifyPhilip Sequeira2014-07-031-26/+26
|
* TOOLS/zsh.pl: fix _arguments linePhilip Sequeira2014-07-031-1/+1
| | | | | | | | | 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 "--".
* TOOLS/zsh.pl: don't consume extra argumentsPhilip Sequeira2014-07-031-10/+18
| | | | | | | | | | | | 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.
* TOOLS/zsh.pl: escape all colons in option descriptionsPhilip Sequeira2014-07-031-1/+1
|
* TOOLS: add script for generating a zsh completion scriptAlessandro Ghedini2014-06-081-0/+129
As discussed in #775