FS#44522 - [beets] bash and zsh completion missing

Attached to Project: Community Packages
Opened by Simon Désaulniers (sim590) - Friday, 10 April 2015, 02:04 GMT
Last edited by Maxime Gauduin (Alucryd) - Monday, 13 April 2015, 08:15 GMT
Task Type Feature Request
Category Packages
Status Closed
Assigned To Maxime Gauduin (Alucryd)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

Bash completion
---------------
Yes. Completion can be added in a user's personnal bash session writing eval "$(beet completion)" in his ~/.bashrc but this is not clean solution while it should be included in the package. This is one line feature to add to the PKGBUILD.

Zsh completion
--------------
This is missing. Here's the source for getting it from the project's github repository : https://raw.githubusercontent.com/sampsyo/beets/master/extra/_beet

All information was gathered from the project's online doc : http://beets.readthedocs.org/en/latest/reference/cli.html

Additional info:
* package version(s) : 1.3.11-1
This task depends upon

Closed by  Maxime Gauduin (Alucryd)
Monday, 13 April 2015, 08:15 GMT
Reason for closing:  Fixed
Additional comments about closing:  1.3.11-3
Comment by P. Ulp (pulp) - Monday, 13 April 2015, 03:16 GMT
  • Field changed: Percent Complete (100% → 0%)
Please revert this change as it leads to several issues. See: https://github.com/sampsyo/beets/issues/1414

Unless another solution is found, the bash completion should not be system wide.
Comment by Simon Désaulniers (sim590) - Monday, 13 April 2015, 05:17 GMT
There is no problem for the bash-completion to be system wide. The problem occurs because beet completion is generated, by beet, each time bash tries to get completion script. Completion script should be generated at packaging state and saved to a file. Simply replace the line :

echo 'eval "$(beet completion)"' > "${pkgdir}"/etc/bash_completion.d/beet

by :

beet completion >"${pkgdir}"/etc/bash_completion.d/beet

Problem solved.
Comment by Maxime Gauduin (Alucryd) - Monday, 13 April 2015, 08:12 GMT
Or not. Beet is not installed at packaging time so your solution will fail. Generating at install time is also not an option. The completion is dynamically generated depending on what plugins you have enabled, generating the file at install time would not work either as completion for plugins you enable afterwards would not exist.
This was the only solution, but since it causes issues, I'll revert it. Please use your .bashrc if you want to enable completion for bash.

Loading...