diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-01-27 11:10:04 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-01-27 11:10:04 +0000 |
commit | a2e352a80301a243c139f50b75a5bdfcafd86ad9 (patch) | |
tree | f39ba5c4303d4ce6d1579e65561d0e73cb7ff1d3 /urpmi.bash-completion | |
parent | de30d10b40a5db24883762c45897bd9d8d3fb9b9 (diff) | |
download | urpmi-a2e352a80301a243c139f50b75a5bdfcafd86ad9.tar urpmi-a2e352a80301a243c139f50b75a5bdfcafd86ad9.tar.gz urpmi-a2e352a80301a243c139f50b75a5bdfcafd86ad9.tar.bz2 urpmi-a2e352a80301a243c139f50b75a5bdfcafd86ad9.tar.xz urpmi-a2e352a80301a243c139f50b75a5bdfcafd86ad9.zip |
Patch by Guillaume Rousse to improve bash-completion for media names, via
adding new optional arguments to the --list-media option of urpmq.
Diffstat (limited to 'urpmi.bash-completion')
-rw-r--r-- | urpmi.bash-completion | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/urpmi.bash-completion b/urpmi.bash-completion index 4687ad87..ea1d6895 100644 --- a/urpmi.bash-completion +++ b/urpmi.bash-completion @@ -5,7 +5,7 @@ # utility functions _urpmi_get_medias() { - medias=( $( sed -ne 's/^\(.\+\) \+[^{]\+{$/\1/p' /etc/urpmi/urpmi.cfg 2>/dev/null | sed -e 's/(/\\(/g' -e 's/)/\\)/g' -e 's/ /\\ /g' ) ) + medias=( $( urpmq --list-media $1 2>/dev/null | sed -e 's/(/\\(/g' -e 's/)/\\)/g' -e 's/ /\\ /g' ) ) } _urpmi_medias() @@ -13,7 +13,7 @@ _urpmi_medias() # return list of available media local medias IFS=$'\t\n' # get medias list - _urpmi_get_medias + _urpmi_get_medias all # return matching ones COMPREPLY=( $( compgen -W '${medias[@]}' -- $cur ) ) } @@ -23,8 +23,8 @@ _urpmi_packages() # return list of available packages local medias i j IFS=$'\t\n,' - # get medias list - _urpmi_get_medias + # start with full media list + _urpmi_get_medias active # find media selection options for (( i=1; i < COMP_CWORD; i++ )); do @@ -41,8 +41,7 @@ _urpmi_packages() i=$(($i+1)) fi if [[ "${COMP_WORDS[i]}" == --update ]]; then - COMPREPLY=( $( urpmq --update --list 2>/dev/null | grep "^$cur" ) ) - return 0 + _urpmi_get_medias update fi done |