--- bash-completion-1.2/contrib/rpm 2010-06-13 12:21:19.000000000 +0200 +++ bash-completion-1.2/contrib/rpm.fix 2011-02-02 22:14:45.000000000 +0100 @@ -142,7 +142,7 @@ -- "$cur" ) ) return 0 ;; - --define|-D) + --define|-D|--fileid|--hdrid|--pkgid) # argument required but no completions available return 0 ;; @@ -180,12 +180,11 @@ # 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}" != "$COMP_LINE" ]; then + if [[ $COMP_LINE == *\ -@(*([^ -])f|-file )* ]]; then # -qf completion if [[ "$cur" == -* ]]; then COMPREPLY=( $( compgen -W "$opts --dbpath --fscontext \ @@ -193,23 +192,26 @@ else _filedir fi - elif [ "${COMP_LINE#* -*([^ -])g}" != "$COMP_LINE" ]; then + elif [[ $COMP_LINE == *\ -@(*([^ -])g|-group )* ]]; then # -qg completion _rpm_groups - elif [ "${COMP_LINE#* -*([^ -])p}" != "$COMP_LINE" ]; then + elif [[ $COMP_LINE == *\ -@(*([^ -])p|-package )* ]]; then # -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" ) ) - elif [ "${COMP_LINE#* -*([^ -])a}" == "$COMP_LINE" ]; then + 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 fi @@ -229,11 +231,11 @@ --nofiles --noscripts --nomd5 --querytags --specfile \ --whatrequires --whatprovides" -- "$cur" ) ) # check whether we're doing file completion - elif [ "${COMP_LINE#* -*([^ -])f}" != "$COMP_LINE" ]; then + elif [[ $COMP_LINE == *\ -@(*([^ -])f|-file )* ]]; then _filedir - elif [ "${COMP_LINE#* -*([^ -])g}" != "$COMP_LINE" ]; then + elif [[ $COMP_LINE == *\ -@(*([^ -])g|-group )* ]]; then _rpm_groups - elif [ "${COMP_LINE#* -*([^ -])p}" != "$COMP_LINE" ]; then + elif [[ $COMP_LINE == *\ -@(*([^ -])p|-package )* ]]; then _filedir 'rpm' else _rpm_installed_packages "$nodig" "$nosig"