Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 843875 - Proposal: New eclass 'shell-completion'
Summary: Proposal: New eclass 'shell-completion'
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Default Assignee for New Packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-12 12:20 UTC by Jonas Frei
Modified: 2023-07-02 12:43 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas Frei 2022-05-12 12:20:43 UTC
A lot of packages install shell completion files. Today there is an eclass for bash: bash-completion-r1. It installs the completion files for bash in the correct location. However, there is no equivalent for popular shells like fish or zsh.

My proposal is to create a new eclass that introduces new commands `do<shell>comp` and `new<shell>comp`, like with bash-completion-r1. The new eclass would inherit the existing bash-completion-r1 eclass, thus by using the new eclass you may use the bash commands as well.

The eclass could look like this (kudos to @parona:matrix.org): https://gist.github.com/freijon/5136b346bb06b1784c2851c46f98ca2b

The advantages would be:
- Have a standardised location to install all completion files for all popular shells (eliminate the risk to install the files to the wrong folder)
- Package maintainers don't have to lookup the correct install location of these files

Example: If you run:
`qgrep -e "insinto .*/fish" | awk '{print $2 " " $3}' | sort | uniq`

...you can see that the fish completions are installed in several locations. This could be a tool to prevent this.