Improve rpm query option completions.
Add --nomanifest, --all, --file, --fileid, --ftswalk, --group, --hdrid, --package, --pkgid, and --specfile; suggest --triggeredby, --whatprovides, and --whatrequires only in installed package query mode.
This commit is contained in:
parent
c8fb5f2eb1
commit
a26e92e6f3
1
CHANGES
1
CHANGES
@ -17,6 +17,7 @@ bash-completion (2.x)
|
||||
* Add *.xsd, *.xsl, *.rng, and *.wsdl to xmllint filename completions.
|
||||
* Recognize rpm query mode based on the --file, --group, --package, and
|
||||
--all long options (RedHat: #630328).
|
||||
* Improve rpm query option completions.
|
||||
|
||||
[ Freddy Vulto ]
|
||||
* Added _tilde(), fix ~username completion (Alioth: #312613, Debian: #587095)
|
||||
|
18
contrib/rpm
18
contrib/rpm
@ -142,7 +142,7 @@ _rpm()
|
||||
-- "$cur" ) )
|
||||
return 0
|
||||
;;
|
||||
--define|-D)
|
||||
--define|-D|--fileid|--hdrid|--pkgid)
|
||||
# argument required but no completions available
|
||||
return 0
|
||||
;;
|
||||
@ -180,10 +180,9 @@ _rpm()
|
||||
# options common to all query types
|
||||
opts="$opts --changelog --configfiles --conflicts --docfiles
|
||||
--dump --enhances --filesbypkg --filecaps --fileclass
|
||||
--filecolor --fileprovide --filerequire --filesbypkg
|
||||
--info --list --obsoletes --pipe --provides
|
||||
--queryformat --rcfile --requires --scripts --suggests
|
||||
--triggeredby --triggers --whatprovides --whatrequires --xml"
|
||||
--filecolor --fileprovide --filerequire --filesbypkg --info
|
||||
--list --obsoletes --pipe --provides --queryformat --rcfile
|
||||
--requires --scripts --suggests --triggers --xml"
|
||||
|
||||
if [[ $COMP_LINE == *\ -@(*([^ -])f|-file )* ]]; then
|
||||
# -qf completion
|
||||
@ -200,15 +199,18 @@ _rpm()
|
||||
# -qp; uninstalled package completion
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W "$opts --ftpport --ftpproxy \
|
||||
--httpport --httpproxy" -- "$cur" ) )
|
||||
--httpport --httpproxy --nomanifest" -- "$cur" ) )
|
||||
else
|
||||
_filedir 'rpm'
|
||||
fi
|
||||
else
|
||||
# -q; installed package completion
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W "$opts --dbpath --fscontext \
|
||||
--last --root --state" -- "$cur" ) )
|
||||
COMPREPLY=( $( compgen -W "$opts --all --file --fileid
|
||||
--dbpath --fscontext --ftswalk --group --hdrid --last
|
||||
--package --pkgid --root --specfile --state
|
||||
--triggeredby --whatprovides --whatrequires" \
|
||||
-- "$cur" ) )
|
||||
elif [[ $COMP_LINE != *\ -@(*([^ -])a|-all )* ]]; then
|
||||
_rpm_installed_packages "$nodig" "$nosig"
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user