Skip to content

Fix kebab-case conversion for multi-word CLI options - #5

Merged
cowboyd merged 1 commit into
mainfrom
kebab-case-fix
Mar 12, 2026
Merged

cowboyd merged 1 commit into
mainfrom
kebab-case-fix

Conversation

@cowboyd

@cowboyd cowboyd commented Mar 5, 2026

Copy link
Copy Markdown
Collaborator

Motivation

toKebabCase used String.replace("_", "-") which only replaces the first underscore. This meant camelCase options with 3+ words (e.g. inspectWatchScopes) produced --inspect-watch_scopes instead of --inspect-watch-scopes.

Approach

Switch from replace to replaceAll so all underscores are converted to hyphens. Added a test case for a three-word camelCase option to prevent regression.

@cowboyd
cowboyd requested a review from jbolda March 5, 2026 20:32
@cowboyd
cowboyd merged commit 235606a into main Mar 12, 2026
2 of 3 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