Merged
Conversation
Owner
boneskull
commented
Jan 7, 2026
- Register multi-char aliases as separate options with parseArgs()
- Collapse alias values into canonical names after parsing
- Detect conflicts when both alias and canonical provided for non-array options
- Merge values for array options when both alias and canonical provided
- Validate aliases don't conflict with canonical option names
- Validate aliases don't conflict with auto-generated boolean negations
- Display multi-character aliases in help output
- Update README.md documentation with aliases section
- Register multi-char aliases as separate options with parseArgs() - Collapse alias values into canonical names after parsing - Detect conflicts when both alias and canonical provided for non-array options - Merge values for array options when both alias and canonical provided - Validate aliases don't conflict with canonical option names - Validate aliases don't conflict with auto-generated boolean negations - Display multi-character aliases in help output - Update README.md documentation with aliases section
There was a problem hiding this comment.
Pull request overview
This PR adds support for multi-character aliases for CLI options, expanding beyond the previous single-character limitation. The implementation registers multi-character aliases as separate options in Node.js parseArgs(), then collapses them back to canonical names after parsing.
Key changes:
- Multi-character aliases are now validated and supported alongside single-character aliases
- Conflict detection ensures aliases don't collide with option names or auto-generated boolean negations
- Array options merge values from all aliases; non-array options detect conflicts when both alias and canonical are used
- Help text displays multi-character aliases sorted by length
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/validate.ts |
Added validation to check aliases against canonical names and boolean negations; removed single-character restriction |
src/parser.ts |
Implemented collapseAliases() function to merge multi-char alias values into canonical names; registers multi-char aliases as separate parseArgs options |
src/opt.ts |
Enhanced alias conflict validation to check against canonical names and boolean negations |
src/help.ts |
Updated help formatting to display multi-character aliases sorted by length alongside short aliases |
src/types.ts |
Updated documentation for the aliases property to describe both short and long alias support |
test/validate.test.ts |
Added comprehensive tests for multi-char alias validation, conflicts, and error cases |
test/parser.test.ts |
Added tests for parsing multi-char aliases, conflict detection, and array value merging |
test/opt.test.ts |
Added tests for alias conflict detection in the opt builder API |
test/help.test.ts |
Added tests to verify multi-char aliases appear correctly in help output |
README.md |
Added dedicated "Aliases" section with examples of short and long alias usage, conflict behavior, and array merging |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Fix README example to show actual array merge order (canonical/short first, multi-char aliases appended) instead of command-line order - Improve error message for alias-negation conflicts to show which boolean option generates the conflicting negation - Update test comments to clarify merge order is documented behavior 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
