diff options
Diffstat (limited to 'urpmi.bash-completion')
-rw-r--r-- | urpmi.bash-completion | 48 |
1 files changed, 3 insertions, 45 deletions
diff --git a/urpmi.bash-completion b/urpmi.bash-completion index 84bd1072..2aec2e60 100644 --- a/urpmi.bash-completion +++ b/urpmi.bash-completion @@ -20,39 +20,6 @@ _urpmi_medias() COMPREPLY=( $( compgen -W '${medias[@]}' -- $cur ) ) } -_urpmi_packages() -{ - # return list of available packages - local medias i j IFS=$'\t\n,' - - # start with full media list - _urpmi_get_medias active - - # find media selection options - for (( i=1; i < COMP_CWORD; i++ )); do - if [[ "${COMP_WORDS[i]}" == --excludemedia ]]; then - for media in ${COMP_WORDS[i+1]}; do - for (( j=0; j < ${#medias[@]}; j++ )); do - [ "${medias[j]}" == "$media" ] && medias[j]='' - done - done - i=$(($i+1)) - fi - if [[ "${COMP_WORDS[i]}" == --media ]]; then - medias=( ${COMP_WORDS[i+1]} ) - i=$(($i+1)) - fi - if [[ "${COMP_WORDS[i]}" == --update ]]; then - _urpmi_get_medias update - fi - done - - # get matching packages - for media in ${medias[@]}; do - COMPREPLY=( ${COMPREPLY[@]:-} $( grep "^$cur" /var/lib/urpmi/names.${media//\\/} 2>/dev/null ) ) - done -} - _urpmi_aliases() { # return list of available aliases @@ -123,14 +90,8 @@ _urpmi() fi COMPREPLY=( $( compgen -W "$options" -- $cur ) ) else - # return available packages only - if [[ ${COMP_WORDS[0]} == *rurpmi ]]; then - _urpmi_packages - else - # return available packages (unless it is clearly a file) and rpm files - if [[ "$cur" != */* ]]; then - _urpmi_packages - fi + if [[ ${COMP_WORDS[0]} != *rurpmi ]]; then + # return rpm files (can't list available packages anymore) _filedir rpm fi fi @@ -182,10 +143,7 @@ _urpmq() --skip --prefer \ --use-distrib --searchmedia --ignorearch" -- $cur)) else - # return available packages (unless it is clearly a file) and rpm files - if [[ "$cur" != */* ]]; then - _urpmi_packages - fi + # return rpm files (can't list available packages anymore) _filedir rpm fi } |