diff --git a/bash_completion/debian-goodies.pkgnames b/bash_completion/debian-goodies.pkgnames new file mode 100644 index 0000000..8143a2f --- /dev/null +++ b/bash_completion/debian-goodies.pkgnames @@ -0,0 +1,12 @@ +_pkg_names() +{ + local cur prev opts + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + + COMPREPLY=( $( apt-cache pkgnames $cur 2> /dev/null ) ) + + return 0 +} + +complete -F _pkg_names which-pkg-broke dhomepage debget diff --git a/debian/changelog b/debian/changelog index ba6011b..41c7e31 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,9 @@ * [bash_completion] - Install debmany bash completion file to /etc/bash_completion.d instead of as example. Rename it for easier use of dh_install. + - Add bash package name completion for which-pkg-broke (Closes: + #641877), dhomepage, and debget. (Based on devscript's package name + completion which is under GPLv2+, too) * Thanks Jakub Wilk for many bugfix patches! -- diff --git a/debian/install b/debian/install index 7362a27..dbfd163 100644 --- a/debian/install +++ b/debian/install @@ -1 +1,2 @@ debmany/bash_completion/debmany etc/bash_completion.d +bash_completion/debian-goodies.pkgnames etc/bash_completion.d