Improve rpm group completion.
Displayed completions are still wrong but now at least real ones containing spaces do work and unusual input does not cause grep errors. http://lists.alioth.debian.org/pipermail/bash-completion-devel/2009-May/001486.html
This commit is contained in:
parent
d677dfe33b
commit
2e641b5c6f
1
CHANGES
1
CHANGES
@ -87,6 +87,7 @@ bash-completion (1.x)
|
|||||||
* Split FreeBSD pkg_* completion to contrib/pkg_install.
|
* Split FreeBSD pkg_* completion to contrib/pkg_install.
|
||||||
* Split FreeBSD portupgrade and friends completion to contrib/portupgrade.
|
* Split FreeBSD portupgrade and friends completion to contrib/portupgrade.
|
||||||
* Split Slackware pkgtools completion to contrib/pkgtools.
|
* Split Slackware pkgtools completion to contrib/pkgtools.
|
||||||
|
* Improve rpm group completion (displayed completions are still wrong).
|
||||||
|
|
||||||
[ Todd Zullinger ]
|
[ Todd Zullinger ]
|
||||||
* Make yum complete on filenames after install, deplist, update and upgrade
|
* Make yum complete on filenames after install, deplist, update and upgrade
|
||||||
|
12
contrib/rpm
12
contrib/rpm
@ -22,13 +22,11 @@ _rpm_installed_packages()
|
|||||||
|
|
||||||
_rpm_groups()
|
_rpm_groups()
|
||||||
{
|
{
|
||||||
local IFS=$'\t'
|
# TODO: shown completions are wrong but real ones work nevertheless
|
||||||
# remove trailing backslash, or grep will complain
|
# http://lists.alioth.debian.org/pipermail/bash-completion-devel/2009-May/001486.html
|
||||||
cur=${cur%"\\"}
|
local IFS=$'\n'
|
||||||
COMPREPLY=( $( rpm -qa $nodig $nosig --queryformat '%{group}\n' | \
|
COMPREPLY=( $( compgen -W "$( rpm -qa $nodig $nosig --queryformat \
|
||||||
grep "^$cur" ) )
|
'%{group}\n' )" -- $cur ) )
|
||||||
# backslash escape spaces and translate newlines to tabs
|
|
||||||
COMPREPLY=( $( echo "${COMPREPLY[@]}" | sed 's/ /\\ /g' | tr '\n' '\t' ) )
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_rpm_nodigsig()
|
_rpm_nodigsig()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user