summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Rousse <guillomovitch@mandriva.org>2007-01-11 09:37:07 +0000
committerGuillaume Rousse <guillomovitch@mandriva.org>2007-01-11 09:37:07 +0000
commite77a0070a9e7682c6d5c9d84fcab8ce1212bd634 (patch)
tree13c8322d001da2eb557aff42a3189a59376d3d24
parent2047e73bd5393eef883f3bb828e9d63bc1292ac9 (diff)
downloadurpmi-e77a0070a9e7682c6d5c9d84fcab8ce1212bd634.tar
urpmi-e77a0070a9e7682c6d5c9d84fcab8ce1212bd634.tar.gz
urpmi-e77a0070a9e7682c6d5c9d84fcab8ce1212bd634.tar.bz2
urpmi-e77a0070a9e7682c6d5c9d84fcab8ce1212bd634.tar.xz
urpmi-e77a0070a9e7682c6d5c9d84fcab8ce1212bd634.zip
fix urpmi context-dependent options
-rw-r--r--urpmi.bash-completion45
1 files changed, 29 insertions, 16 deletions
diff --git a/urpmi.bash-completion b/urpmi.bash-completion
index e3f3229c..00fde1f0 100644
--- a/urpmi.bash-completion
+++ b/urpmi.bash-completion
@@ -61,7 +61,7 @@ _urpmi_aliases()
#
_urpmi()
{
- local cur prev
+ local cur prev options
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
@@ -92,25 +92,38 @@ _urpmi()
if [[ "$cur" == -* ]]; then
# return list of available options
- COMPREPLY=( $( compgen -W '-a -p -P -y -s -q -v -h --help \
- --update --media --excludemedia --sortmedia \
- --synthesis --auto --auto-select --no-uninstall \
- --split-level --split-length --fuzzy --src \
- --install-src --clean --noclean --parallel --wget --prozilla \
- --curl --limit-rate --proxy --proxy-user --bug \
+ options='-a -p -P -y -s -q -v -h --help --update --media \
+ --excludemedia --sortmedia --synthesis --auto \
+ --auto-select --no-uninstall --split-level \
+ --split-length --fuzzy --src --install-src --clean \
+ --noclean --parallel --wget --prozilla --curl \
+ --limit-rate --proxy --proxy-user --bug \
--no-verify-rpm --no-install --test --excludepath \
--excludedocs --searchmedia --ignoresize --ignorearch \
- --strict-arch --wget-options --curl-options --prozilla-options \
- --rsync-options --resume --retry --skip --nolock \
- --more-choices --no-md5sum --force-key' -- $cur ) )
+ --strict-arch --wget-options --curl-options \
+ --prozilla-options --rsync-options --resume --retry \
+ --skip --nolock --more-choices'
# add dangereous option for everything else as rurpmi
if [[ ${COMP_WORDS[0]} != *rurpmi ]]; then
- COMPREPLY=( $( compgen -W '${COMPREPLY[@]} --root \
- --use-distrib --env --allow-nodeps \
- --allow-force --force --noscripts \
- --auto-update --keep --nokeep --verify-rpm' \
- -- $cur ) )
- fi
+ options="$options --root --use-distrib --env \
+ --allow-nodeps --allow-force --force \
+ --noscripts --auto-update --keep --nokeep \
+ --verify-rpm"
+ for (( i=1; i < COMP_CWORD; i++ )); do
+ case ${COMP_WORDS[i]} in
+ --use-distrib)
+ options="$options \
+ --probe-synthesis \
+ --probe-hdlist"
+ ;;
+ ----auto-update)
+ options="$options --no-md5sum \
+ --force-key"
+ ;;
+ esac
+ done
+ fi
+ COMPREPLY=( $( compgen -W "$options" -- $cur ) )
else
# return available packages only
if [[ ${COMP_WORDS[0]} == *rurpmi ]]; then