Skip to content

Conversation

@boneskull
Copy link
Owner

  • 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
Copilot AI review requested due to automatic review settings January 7, 2026 06:03
Copy link
Owner Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@boneskull boneskull merged commit 4a77c03 into main Jan 7, 2026
9 checks passed
@boneskull boneskull deleted the feat/multi-char-aliases branch January 7, 2026 19:37
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