summaryrefslogtreecommitdiff
path: root/completions/_yum
diff options
context:
space:
mode:
authorGabriel F. T. Gomes <gabriel@inconstante.eti.br>2017-09-25 23:46:54 -0300
committerGabriel F. T. Gomes <gabriel@inconstante.eti.br>2017-09-25 23:46:54 -0300
commit6d88f1055806932d9291f96847d2b691cccda2cd (patch)
tree0ff79eedaa8a239331256048981deedbd0721965 /completions/_yum
parent059a87a5936cfebfd2d71ab8057002cafb2ea051 (diff)
downloadbash-completion-6d88f1055806932d9291f96847d2b691cccda2cd.tar.gz
New upstream version 2.7upstream/2.7
Diffstat (limited to 'completions/_yum')
-rw-r--r--completions/_yum27
1 files changed, 13 insertions, 14 deletions
diff --git a/completions/_yum b/completions/_yum
index 7b3f76a4..f3a104bd 100644
--- a/completions/_yum
+++ b/completions/_yum
@@ -9,12 +9,12 @@ _yum_list()
# Try to strip in between headings like "Available Packages"
# This will obviously only work for English :P
COMPREPLY=( $( yum -d 0 -C list $1 "$cur*" 2>/dev/null | \
- sed -ne '/^Available /d' -e '/^Installed /d' -e '/^Updated /d' \
+ command sed -ne '/^Available /d' -e '/^Installed /d' -e '/^Updated /d' \
-e 's/[[:space:]].*//p' ) )
else
# Drop first line (e.g. "Updated Packages")
COMPREPLY=( $( yum -d 0 -C list $1 "$cur*" 2>/dev/null | \
- sed -ne 1d -e 's/[[:space:]].*//p' ) )
+ command sed -ne 1d -e 's/[[:space:]].*//p' ) )
fi
}
@@ -24,13 +24,13 @@ _yum_repolist()
# http://yum.baseurl.org/ticket/83
# Drop first ("repo id repo name") and last ("repolist: ...") rows
yum --noplugins -C repolist $1 2>/dev/null | \
- sed -ne '/^repo\s\s*id/d' -e '/^repolist:/d' -e 's/[[:space:]].*//p'
+ command sed -ne '/^repo\s\s*id/d' -e '/^repolist:/d' -e 's/[[:space:]].*//p'
}
_yum_plugins()
{
command ls /usr/lib/yum-plugins/*.py{,c,o} 2>/dev/null \
- | sed -ne 's|.*/\([^./]*\)\.py[co]\{0,1\}$|\1|p' | sort -u
+ | command sed -ne 's|.*/\([^./]*\)\.py[co]\{0,1\}$|\1|p' | sort -u
}
_yum()
@@ -50,25 +50,25 @@ _yum()
if [[ "$cur" == @(*/|[.~])* && \
"$special" == @(deplist|install|update|upgrade) ]]; then
_filedir rpm
- return 0
+ return
fi
case $special in
install)
_yum_list available
- return 0
+ return
;;
deplist|info)
_yum_list all
- return 0
+ return
;;
upgrade|update)
_yum_list updates
- return 0
+ return
;;
remove|erase)
# _rpm_installed_packages is not arch-qualified
_yum_list installed
- return 0
+ return
;;
esac
fi
@@ -117,11 +117,11 @@ _yum()
;;
-R|-x|--exclude)
# argument required but no completions available
- return 0
+ return
;;
-h|--help|--version)
# no other options useful with these
- return 0
+ return
;;
*)
COMPREPLY=( $( compgen -W 'install update check-update upgrade
@@ -132,14 +132,13 @@ _yum()
;;
esac
- $split && return 0
+ $split && return
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
[[ $COMPREPLY == *= ]] && compopt -o nospace
- return 0
fi
} &&
complete -F _yum yum
-# ex: ts=4 sw=4 et filetype=sh
+# ex: filetype=sh