Skip to content

fix: resolve_display_name handles multi-hyphen tags#10

Merged
aannoo merged 1 commit intoaannoo:mainfrom
bloodcarter:fix/multi-hyphen-tag
Mar 14, 2026
Merged

fix: resolve_display_name handles multi-hyphen tags#10
aannoo merged 1 commit intoaannoo:mainfrom
bloodcarter:fix/multi-hyphen-tag

Conversation

@bloodcarter
Copy link
Copy Markdown
Contributor

Summary

resolve_display_name used split_once('-') to separate tag from suffix, which only tried the first hyphen. For tags like vc-p0-p1-parallel, the lookup failed because it searched for tag vc + suffix p0-p1-parallel-vani instead of iterating all split points.

Now iterates all hyphen positions so compound tags resolve correctly.

What changed

  • src/instances.rs: replaced split_once('-') with a loop over all split points, trying each (tag, suffix) combination until a match is found.
  • Added test test_resolve_display_name_multi_hyphen.

Test plan

  • cargo test resolve_display — new test covers multi-hyphen tags
  • Manual: hcom list correctly resolves vc-p0-p1-parallel-vani to its display name

Resubmitted from #8 — cleaned up to contain only this fix.

🤖 Generated with Claude Code

split_once('-') only tried the first hyphen, failing for tags like
"vc-p0-p1-parallel-vani". Now iterates all split points so compound
tags resolve correctly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@aannoo
Copy link
Copy Markdown
Owner

aannoo commented Mar 14, 2026

thanks

@aannoo aannoo merged commit c3d128b into aannoo:main Mar 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants