Skip to content

Autocomplete --name with discovered speaker rooms#1

Merged
steipete merged 3 commits intosteipete:mainfrom
JaviSoto:javi/name-flag-completion
Dec 14, 2025
Merged

Autocomplete --name with discovered speaker rooms#1
steipete merged 3 commits intosteipete:mainfrom
JaviSoto:javi/name-flag-completion

Conversation

@JaviSoto
Copy link
Copy Markdown
Contributor

@JaviSoto JaviSoto commented Dec 13, 2025

This adds dynamic shell completion for the --name flag (Cobra RegisterFlagCompletionFunc) so room names are suggested based on discovery.

  • Fixes bash completion for speaker names with spaces (e.g. Living Room) by escaping values.
  • Adds a small disk cache (30s TTL) for completion results to reduce network discovery on repeated TAB.
  • Adds unit tests by stubbing discovery (including names with spaces + cache behavior).
  • Fixes a test race in internal/sonos/http_fallback_test.go (tests mutate a global function, so t.Parallel() caused cross-test interference).

Note: Codex with GPT-5.2 did the whole thing autonomously.

@steipete
Copy link
Copy Markdown
Owner

Thank you!

@steipete steipete merged commit 7e76ebc into steipete:main Dec 14, 2025
2 checks 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