Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---------------------

Expand Down
2 changes: 1 addition & 1 deletion VERSION.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.15.0
v0.15.1
7 changes: 7 additions & 0 deletions lib/helper/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
8 changes: 8 additions & 0 deletions lib/helper/transform_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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],
},
},
}
Expand Down