rpm: Add --whatenhances/recommends/suggests/supplements and --recommends/supplements completions
parent
fa1ad7dff9
commit
81acda727a
|
@ -89,27 +89,24 @@ _rpm()
|
||||||
_filedir spec
|
_filedir spec
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
--whatprovides)
|
--whatenchances|--whatprovides|--whatrecommends|--whatrequires|\
|
||||||
|
--whatsuggests|--whatsupplements)
|
||||||
if [[ "$cur" == */* ]]; then
|
if [[ "$cur" == */* ]]; then
|
||||||
_filedir
|
_filedir
|
||||||
else
|
else
|
||||||
# complete on capabilities
|
# complete on capabilities
|
||||||
local IFS=$'\n'
|
local IFS=$'\n' fmt
|
||||||
|
case $prev in
|
||||||
|
*enhances) fmt=ENHANCENAME ;;
|
||||||
|
*provides) fmt=PROVIDENAME ;;
|
||||||
|
*recommends) fmt=RECOMMENDNAME ;;
|
||||||
|
*requires) fmt=REQUIRENAME ;;
|
||||||
|
*suggests) fmt=SUGGESTNAME ;;
|
||||||
|
*supplements) fmt=SUPPLEMENTNAME ;;
|
||||||
|
esac
|
||||||
COMPREPLY=( $( compgen -W "$( $1 -qa --nodigest --nosignature \
|
COMPREPLY=( $( compgen -W "$( $1 -qa --nodigest --nosignature \
|
||||||
--queryformat='%{PROVIDENAME}\n' 2>/dev/null )" \
|
--queryformat=\"%{$fmt}\\n\" 2>/dev/null |
|
||||||
-- "$cur" ) )
|
command grep -vF '(none)' )" -- "$cur" ) )
|
||||||
fi
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
--whatrequires)
|
|
||||||
if [[ "$cur" == */* ]]; then
|
|
||||||
_filedir
|
|
||||||
else
|
|
||||||
# complete on capabilities
|
|
||||||
local IFS=$'\n'
|
|
||||||
COMPREPLY=( $( compgen -W "$( $1 -qa --nodigest --nosignature \
|
|
||||||
--queryformat='%{REQUIRENAME}\n' 2>/dev/null )" \
|
|
||||||
-- "$cur" ) )
|
|
||||||
fi
|
fi
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
|
@ -153,7 +150,8 @@ _rpm()
|
||||||
--enhances --filesbypkg --filecaps --fileclass --filecolor
|
--enhances --filesbypkg --filecaps --fileclass --filecolor
|
||||||
--fileprovide --filerequire --filesbypkg --info --list
|
--fileprovide --filerequire --filesbypkg --info --list
|
||||||
--obsoletes --pipe --provides --queryformat= --requires
|
--obsoletes --pipe --provides --queryformat= --requires
|
||||||
--scripts --suggests --triggers --xml"
|
--scripts --suggests --triggers --xml --recommends
|
||||||
|
--supplements"
|
||||||
|
|
||||||
if [[ ${words[@]} == *\ -@(*([^ -])f|-file )* ]]; then
|
if [[ ${words[@]} == *\ -@(*([^ -])f|-file )* ]]; then
|
||||||
# -qf completion
|
# -qf completion
|
||||||
|
@ -180,7 +178,9 @@ _rpm()
|
||||||
COMPREPLY=( $( compgen -W "$opts --all --file --fileid
|
COMPREPLY=( $( compgen -W "$opts --all --file --fileid
|
||||||
--dbpath --fscontext --ftswalk --group --hdrid --last
|
--dbpath --fscontext --ftswalk --group --hdrid --last
|
||||||
--package --pkgid --root= --specfile --state
|
--package --pkgid --root= --specfile --state
|
||||||
--triggeredby --whatprovides --whatrequires" \
|
--triggeredby --whatenhances --whatprovides
|
||||||
|
--whatrecommends --whatrequires --whatsuggests
|
||||||
|
--whatsupplements" \
|
||||||
-- "$cur" ) )
|
-- "$cur" ) )
|
||||||
elif [[ ${words[@]} != *\ -@(*([^ -])a|-all )* ]]; then
|
elif [[ ${words[@]} != *\ -@(*([^ -])a|-all )* ]]; then
|
||||||
_rpm_installed_packages $1
|
_rpm_installed_packages $1
|
||||||
|
@ -200,7 +200,9 @@ _rpm()
|
||||||
COMPREPLY=( $( compgen -W "$opts --root= --dbpath --nodeps
|
COMPREPLY=( $( compgen -W "$opts --root= --dbpath --nodeps
|
||||||
--nogroup --nolinkto --nomode --nomtime --nordev --nouser
|
--nogroup --nolinkto --nomode --nomtime --nordev --nouser
|
||||||
--nofiles --noscripts --nomd5 --querytags --specfile
|
--nofiles --noscripts --nomd5 --querytags --specfile
|
||||||
--whatrequires --whatprovides" -- "$cur" ) )
|
--whatenhances --whatprovides --whatrecommends
|
||||||
|
--whatrequires --whatsuggests --whatsupplements" \
|
||||||
|
-- "$cur" ) )
|
||||||
# check whether we're doing file completion
|
# check whether we're doing file completion
|
||||||
elif [[ ${words[@]} == *\ -@(*([^ -])f|-file )* ]]; then
|
elif [[ ${words[@]} == *\ -@(*([^ -])f|-file )* ]]; then
|
||||||
_filedir
|
_filedir
|
||||||
|
|
Loading…
Reference in New Issue