From ad9512a7474da145e77dc161ffd7a225c8b83322 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Wed, 21 Dec 2022 15:20:01 -0600 Subject: [PATCH] refactor: issues with build_id matching first --- src/viv/viv.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/viv/viv.py b/src/viv/viv.py index 9e7aac3..a8ae501 100755 --- a/src/viv/viv.py +++ b/src/viv/viv.py @@ -551,6 +551,7 @@ class Viv: self.vivenvs = get_venvs() def _match_vivenv(self, name_id: str) -> ViVenv: + # TODO: improve matching algorithm to favor names over id's matches = [] for k, v in self.vivenvs.items(): if name_id == k or v.name == name_id: @@ -562,7 +563,7 @@ class Viv: if not matches: error(f"no matches found for {name_id}", code=1) elif len(matches) > 1: - echo(f"matches {','.join(matches)}", hue="red") + echo(f"matches {','.join((match.name for match in matches))}", hue="red") error("too many matches maybe try a longer name?", code=1) else: return matches[0]