summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2016-02-06 10:29:30 +0100
committerMichał Górny <mgorny@gentoo.org>2016-02-06 10:29:30 +0100
commit9cd3e07fc522120bcfe57353e30d185926da0891 (patch)
tree4b3238d97d9f836cb6dfe1c6d1516358ad4b220b
parentAdd edit action (diff)
downloadeselect-python-9cd3e07fc522120bcfe57353e30d185926da0891.tar.gz
eselect-python-9cd3e07fc522120bcfe57353e30d185926da0891.tar.bz2
eselect-python-9cd3e07fc522120bcfe57353e30d185926da0891.zip
show: Fix --pref-only
-rw-r--r--python.eselect.in10
1 files changed, 5 insertions, 5 deletions
diff --git a/python.eselect.in b/python.eselect.in
index bbe024f..2bf6e30 100644
--- a/python.eselect.in
+++ b/python.eselect.in
@@ -216,14 +216,14 @@ do_show() {
done
local preferred=( $(get_preferred_pythons ${filter}) )
- local installed=()
- if [[ ! ${pref_only} ]]; then
- installed=( $(get_installed_pythons ${filter}) )
- fi
+ local installed=( $(get_installed_pythons ${filter}) )
+ local all=( "${preferred[@]}" )
# preferred are preferred, but fall back to anything
+ [[ ${pref_only} ]] || all+=( "${installed[@]}" )
+
local i
- for i in "${preferred[@]}" "${installed[@]}"; do
+ for i in "${all[@]}"; do
# skip if not installed
has "${i}" "${installed[@]}" || continue
interpreter=${i}