Package Details: mpv-bash-completion-git 8:3.3.18-1

Git Clone URL: https://aur.archlinux.org/mpv-bash-completion-git.git (read-only, click to copy)
Package Base: mpv-bash-completion-git
Description: Bash completion for the mpv video player
Upstream URL: https://github.com/2ion/mpv-bash-completion
Keywords: bash mpv
Licenses: GPL
Conflicts: mpv-bash-completion
Provides: mpv-bash-completion
Submitter: 2ion
Maintainer: 2ion
Last Packager: 2ion
Votes: 23
Popularity: 0.21
First Submitted: 2015-03-12 15:14
Last Updated: 2020-01-11 12:51

Latest Comments

1 2 Next › Last »

2ion commented on 2020-01-29 09:12

@sl1pkn07: You're surely referring to https://github.com/mpv-player/mpv/blob/3259494d9e58b710592e34b0f739942f0f941acb/etc/mpv.bash-completion. But no. The version in the tree is a simpler, and more limited version than this one, not written by me. You'll be totally fine with the upstream version if all you need is basic --option completion; it has limited support for completing option defaults, choices and no support for filter argument completion. If you want to have a completion that allows you to 'explore' the CLI more fully, use my version; if all you need is the simple version, use the upstream one.

That being said, besides being more featureful this one is not 'better' than the upstream version because it's a dirty hack that is begging for a rewrite as a mpv Lua or Pyethon plugin, but who has the time.

sl1pkn07 commented on 2020-01-29 01:53

this package now comes bundled with mpv +0.32, rigth?

2ion commented on 2020-01-11 12:52

Build should now be fixed for mpv > 0.31.0 (mpv-git).

2ion commented on 2020-01-09 07:49

@laichaheng Can't reproduce with mpv 0.31.0 and lua 5.3.5. Could you please specify the versions of these softwares and additionally tell me the output of locale? That is, the complete output of this little script (please use a pastebin!):

locale
mpv --version
lua -v
echo "========= default locale ==========="
env MPV_BASHCOMPGEN_VERBOSE=1 /usr/lib/mpv-bash-completion/generate
echo "========= C locale ==========="
env MPV_BASHCOMPGEN_VERBOSE=1 LANG=C LC_ALL=C /usr/lib/mpv-bash-completion/generate

Can you try running /usr/lib/mpv-bash-completion/generate directly from the console and observe if the issue happens in this context again, and can you run it again as LC_ALL=C LANG=C /usr/lib/mpv-bash-completion/generate and observe if there's a difference?

laichiaheng commented on 2020-01-09 02:01

lua: attempt to index a nil value

stack traceback:

[C]: in for iterator 'for iterator'

/usr/lib/mpv-bash-completion/generate:83: in upvalue 'map'

/usr/lib/mpv-bash-completion/generate:89: in function </usr/lib/mpv-bash-completion/generate:89>
(...tail calls...)

/usr/lib/mpv-bash-completion/generate:662: in upvalue 'createScript'

/usr/lib/mpv-bash-completion/generate:749: in local 'main'

/usr/lib/mpv-bash-completion/generate:753: in main chunk

[C]: in ?

錯誤: 命令未能被正確執行

2ion commented on 2018-08-29 20:10

@gesh: Why would you want to retain a completion definition if you uninstalled the package? I can't think of a good reason right now.

Besides, due to how /usr/share/bash-completion/bash_completion works, the file will be sourced regardless of its extension, so now you'd end up with a .pacsave that's still getting sourced and need to care about it -- one more thing to think about.

I don't see any upside in terms of user experience in your suggestion.

gesh commented on 2018-08-29 18:44

Hi. Instead of deleting /etc/bash_completion.d/mpv using a .install file, wouldn't it be possible to just install an empty file in the package and use the hook to populate it? Judging by pacman(8)'s description of how it handles .pacnew files, this should Just Work(TM), but I haven't actually tried it. Thanks for the package!

2ion commented on 2017-10-29 15:23

@sl1pkn07:

1. Both zsh.pl and mpv-bash-completion are ugly hacks. They both rely on parsing mpv --list-options or mpv --$option help, the format of which changes all the time, there's no standard, just patterns to cobble together. Something is broken all the time. The thing that's ultimately needed is an API which exports the mpv option tree completely, options plus parameters plus parameter defaults plus parameter types plus alias information, following some defined schema, which can be used as the input for any completion generator. I don't want to upstream ugly hacks.

2. mpv-bash-completion is more complex than zsh.pl, part of that being due to Bash providing almost no completion framework at all and part being due to mpv-bash-completion probably having more features (filter and object parameter completion) (I didn't check). To upstream it, the code would need refactoring and documentation. And then it needs to be maintained, with frequent fixes due to (1), which brings me to

3. I don't want to relinquish ownership of the code and go through mpv maintainers all the time to fix things. Again, if we had solved (1), the code could be written correctly, upstreamed and just work.

I'm hoping to invest time into (1) at some point, but that'll happen in 2018 at the earliest.

sl1pkn07 commented on 2017-10-28 16:59

Hi

one question. why not try to make include this into mpv sources like zsh completion?

greetings

2ion commented on 2016-06-27 15:08

Version 3 is a full rewrite in Lua which fixes many incorrect or missing completions. Also, this package installs a pacman hook which automatically updates the completion between mpv version upgrades.