# Copyright 2026 Nadeŭka <me+oss@nadevko.cc>
# Distributed under the terms of the GNU General Public License v2
EAPI=9

inherit git-r3

DESCRIPTION='Script to fix bash auto-completion for aliases'
HOMEPAGE=https://github.com/cykerway/complete-alias
EGIT_REPO_URI=https://github.com/cykerway/${PN}.git
LICENSE=GPL-3

SLOT=0

RDEPEND='
	>=app-shells/bash-4.4
	app-shells/bash-completion
'

src_install() {
	insinto /usr/share/${PN}
	doins complete_alias
	einstalldocs
}

pkg_postinst() {
	elog "To activate ${PN}, add the following lines to ~/.bashrc:"
	elog "  source /usr/share/${PN}/complete_alias"
	elog '  complete -F _complete_alias "${!BASH_ALIASES[@]}"'
}