Skip to content

Add multi char support for short names in cli options#74

Merged
darthsharp merged 3 commits intomainfrom
feature/multicharclioptions
Jan 31, 2026
Merged

Add multi char support for short names in cli options#74
darthsharp merged 3 commits intomainfrom
feature/multicharclioptions

Conversation

@darthsharp
Copy link
Copy Markdown
Contributor

No description provided.

…ames and update related tests for validation
Copy link
Copy Markdown
Contributor

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 short names in CLI option parameters. Previously, short names were limited to single characters (e.g., -t), but now they can be multiple characters (e.g., -te). The implementation changes the ShortName property type from char? to string? in OptionParameterAttribute while maintaining backward compatibility through constructor overloads.

Changes:

  • Modified OptionParameterAttribute to accept string short names instead of char, with backward-compatible constructors
  • Updated OptionParameterProperty comparison logic to work with string short names
  • Added test case demonstrating multi-character short name functionality
  • Refactored code to use primary constructors and modern C# syntax (collection expressions, removed null-forgiving operators)

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
TestOptionForParser.cs Added test property using multi-character short name "te"
OptionParserTests.cs Added test for multi-char short names; cleaned up null-forgiving operators and modernized collection syntax
OptionParameterProperty.cs Removed ToString() call on ShortName comparison; refactored to primary constructor
OptionParameterAttribute.cs Changed ShortName from char? to string?; added string constructor overload

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@darthsharp darthsharp changed the title Add support für multi char shot names for cli options Add multi char support for short names in cli options Jan 31, 2026
…Attribute` using `Ensure.IsNotNullOrWhitespace`. Update related test data for consistency.
@darthsharp darthsharp merged commit a1411ee into main Jan 31, 2026
6 checks passed
@darthsharp darthsharp deleted the feature/multicharclioptions branch January 31, 2026 11:51
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