From 9cd3e07fc522120bcfe57353e30d185926da0891 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Sat, 6 Feb 2016 10:29:30 +0100 Subject: show: Fix --pref-only --- python.eselect.in | 10 +++++----- 1 file 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} -- cgit v1.2.3-65-gdbad