summaryrefslogtreecommitdiff
path: root/Completion
diff options
context:
space:
mode:
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Base/_arguments1
-rw-r--r--Completion/Linux/_rpm12
2 files changed, 8 insertions, 5 deletions
diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments
index 5581e5bd9..da7a7ad4a 100644
--- a/Completion/Base/_arguments
+++ b/Completion/Base/_arguments
@@ -319,6 +319,7 @@ if (( $# )) && comparguments -i "$autod" "$@"; then
compadd -QqS= - "${PREFIX}${SUFFIX}"
else
tmp1=( "$next[@]" "$direct[@]" "$odirect[@]" "$equal[@]" )
+ [[ "$PREFIX" != --* ]] && tmp1=( "${(@)tmp1:#--*}" )
tmp3=( "${(M@)tmp1:#[-+]?[^:]*}" )
tmp1=( "${(M@)tmp1:#[-+]?(|:*)}" )
tmp2=( "${PREFIX}${(@M)^${(@)${(@)tmp1%%:*}#[-+]}:#?}" )
diff --git a/Completion/Linux/_rpm b/Completion/Linux/_rpm
index adcfa341b..ba18c8c17 100644
--- a/Completion/Linux/_rpm
+++ b/Completion/Linux/_rpm
@@ -117,6 +117,8 @@ while [[ -n "$state" ]]; do
case "$lstate" in
query)
+ # --dump requires on of -{l,c,d}
+ # --triggers requires --script
_arguments -s \
-q "${commonopts[@]}" "${packageopts[@]}" "${pathopts[@]}" \
'--queryformat:RPM query format:->tags' \
@@ -126,11 +128,11 @@ while [[ -n "$state" ]]; do
'-s[show file states]' \
'-d[documentation files only]' \
'-c[configuration files only]' \
- '--dump[show all information]' # Requires one of -{l,c,d} ... \
+ '--dump[show all information]' \
--provides \
-{R,-requires}'[list dependencies]' \
'--scripts[show (un)install scripts]' \
- '--triggers[show trigger scripts]' # Requires --scripts ... \
+ '--triggers[show trigger scripts]' \
'*:RPM package:->package_or_file' && ret=0
;;
setattrs)
@@ -195,14 +197,14 @@ while [[ -n "$state" ]]; do
;;
target)
_wanted target expl 'Target platforms' \
- compadd $(_call target rpm --showrc |grep 'compatible archs'|sed 's/.*: //') && ret=0
+ compadd $(_call target rpm --showrc 2> /dev/null |grep 'compatible archs'|sed 's/.*: //') && ret=0
;;
package_or_file)
state=package_file
;&
package)
_wanted packages expl 'RPM package' \
- compadd -M 'r:|-=* r:|=*' - $(_call packages rpm -qa) && ret=0
+ compadd -M 'r:|-=* r:|=*' - $(_call packages rpm -qa 2> /dev/null) && ret=0
;;
spec_file)
_wanted specfiles expl 'spec file' \
@@ -224,7 +226,7 @@ while [[ -n "$state" ]]; do
if compset -P '*%*\{'; then
_wanted tags expl 'RPM tag' \
compadd -M 'm:{a-z}={A-Z}' -S '\}' - \
- "${(@)${(@f)$(_call tags rpm --querytags)}#RPMTAG_}" && ret=0
+ "${(@)${(@f)$(_call tags rpm --querytags 2> /dev/null)}#RPMTAG_}" && ret=0
else
_message 'RPM format'
fi