Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install shell completion files to correct locations #1410

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

carlwgeorge
Copy link

Bash completion files should be installed to /usr/share/bash-completion/completions, with a file name matching the command name. Zsh completion files should be installed to /usr/share/zsh/site-functions, with a file name matching the command name prefixed with an underscore.

Resolves #271

https://github.com/scop/bash-completion/blob/master/README.md#faq
http://zsh.sourceforge.net/Doc/Release/Completion-System.html

Bash completion files should be installed to
/usr/share/bash-completion/completions, with a file name matching the
command name.  Zsh completion files should be installed to
/usr/share/zsh/site-functions, with a file name matching the command
name prefixed with an underscore.

Resolves ggreer#271

https://github.com/scop/bash-completion/blob/master/README.md#faq
http://zsh.sourceforge.net/Doc/Release/Completion-System.html
@okapia
Copy link

okapia commented May 27, 2021

For the zsh completion, _the_silver_searcher is the correct naming.

In zsh, the naming typically follows that of rpm/deb package naming rather than the command names. This is partly because functions often handle multiple commands so, for example, _subversion handles completion for svn and svn-admin and _ansible handles all of ansible-playbook, ansible-inventory etc. Also note that in zsh, a completion function can handle other contexts like environment variable values which would not fit
a command-name-only naming scheme. So for example, _ansible also handles completion after an ANSIBLE_STDOUT_CALLBACK= assignment.

I can't find anything in the zsh documentation chapter that you reference to back up what you state. If there is something there that I missed, let me know and I'll arrange to fix it.

Note that it was me that contributed the original zsh completion function. There's also PR #1145 to update it which has not been merged. By now further updates are likely applicable.

@carlwgeorge
Copy link
Author

I'm not sure what I saw on that page back in September of 2020 that led me to use that as a reference. Most other packages in Fedora seem to follow the convention of that file being named after the command they apply to, not the package name. I understand your point about handling multiple commands, but in this case there is only one command, so why does it matter? Over email you suggested to me that the point was to have the file match the package name, but I was already considering renaming the Fedora package from the_silver_searcher to ag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bash completion scripts gets installed in the wrong place
2 participants