From fc39bd0874a0382583ce0736787c4a2c18b0be46 Mon Sep 17 00:00:00 2001 From: codybuell Date: Thu, 8 Jan 2026 09:14:15 -0500 Subject: [PATCH 1/2] Add index for plain name lookups This is to support calling favorites directly in the cli via their alias as an argument. --- lib/helper/transform.go | 7 +++++++ lib/helper/transform_test.go | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/lib/helper/transform.go b/lib/helper/transform.go index a245830..c4d3d8f 100644 --- a/lib/helper/transform.go +++ b/lib/helper/transform.go @@ -123,6 +123,13 @@ func MapFavs(favs []structs.Favorite) ([]string, map[string]structs.Favorite) { for _, fav := range favs { fNames = append(fNames, fav.DescriptiveName) fMap[fav.DescriptiveName] = fav + // Also index by plain name to support command-line argument lookups + if fav.Name != "" { + // Only set if not already present (first match wins for name conflicts) + if _, exists := fMap[fav.Name]; !exists { + fMap[fav.Name] = fav + } + } } sort.Strings(fNames) diff --git a/lib/helper/transform_test.go b/lib/helper/transform_test.go index c12d67d..e2a1db7 100644 --- a/lib/helper/transform_test.go +++ b/lib/helper/transform_test.go @@ -184,12 +184,20 @@ func TestMapFavs(t *testing.T) { "fav two [local] (121212121212 car two web)", }, map[string]structs.Favorite{ + // Indexed by DescriptiveName "fav one [local] (111111111111 car one web)": kionTestFavorites[0], "fav two [local] (121212121212 car two web)": kionTestFavorites[1], "fav three [local] (131313131313 car three web)": kionTestFavorites[2], "fav four [local] (141414141414 car four web)": kionTestFavorites[3], "fav five [local] (151515151515 car five web)": kionTestFavorites[4], "fav six [local] (161616161616 car six web)": kionTestFavorites[5], + // Also indexed by plain Name for CLI argument lookup + "fav one": kionTestFavorites[0], + "fav two": kionTestFavorites[1], + "fav three": kionTestFavorites[2], + "fav four": kionTestFavorites[3], + "fav five": kionTestFavorites[4], + "fav six": kionTestFavorites[5], }, }, } From e180969b61e2e3235d6e3810de63339e792756d9 Mon Sep 17 00:00:00 2001 From: codybuell Date: Thu, 8 Jan 2026 09:18:26 -0500 Subject: [PATCH 2/2] Prep for release of 0.15.1 --- CHANGELOG.md | 7 +++++++ VERSION.md | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef8309d..a78ee32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,13 @@ Notes for upgrading... ### Fixed +[0.15.1] - 2025.01.08 +--------------------- + +### Fixed + +- Fixed favorite lookup by name when passed as a command-line argument (e.g., `kion f myfavorite`) [kionsoftware/kion-cli/pull/109] + [0.15.0] - 2025.12.30 --------------------- diff --git a/VERSION.md b/VERSION.md index 86dd09a..5f1dd0a 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -v0.15.0 +v0.15.1