Skip to content

Some small enhancements to cli.hosting handling command and options validation results#66

Merged
darthsharp merged 2 commits into
mainfrom
feature/smallclienhancements
Dec 25, 2025
Merged

Some small enhancements to cli.hosting handling command and options validation results#66
darthsharp merged 2 commits into
mainfrom
feature/smallclienhancements

Conversation

@darthsharp

Copy link
Copy Markdown
Contributor

No description provided.

…and `OptionsValidationResult`

- Introduce `Success` property and implicit conversion operator in `CommandResult`.
- Add static `Valid` and `Invalid` methods in `OptionsValidationResult` for easier initialization.
- Create comprehensive unit tests to validate the new changes.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 convenience methods to the CLI core classes to simplify creating validation and command results. The changes introduce static factory methods for OptionsValidationResult, a static success property and implicit operator for CommandResult, along with comprehensive test coverage for these enhancements.

  • Added factory methods Valid() and Invalid() to OptionsValidationResult for cleaner result creation
  • Added Success static property and implicit int operator to CommandResult for more ergonomic usage
  • Introduced unit tests to validate the new functionality

Reviewed changes

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

File Description
source/Cli/CreativeCoders.Cli.Core/OptionsValidationResult.cs Adds static factory methods Valid() and Invalid() to simplify creation of validation results
source/Cli/CreativeCoders.Cli.Core/CommandResult.cs Adds static Success property and implicit operator from int for more concise command result creation
tests/CreativeCoders.Cli.Tests/Core/OptionsValidationResultTests.cs Provides test coverage for the new Valid() and Invalid() factory methods, including null handling
tests/CreativeCoders.Cli.Tests/Core/CommandResultTests.cs Validates the implicit operator with various exit code values including edge cases

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

Comment thread tests/CreativeCoders.Cli.Tests/Core/CommandResultTests.cs Outdated
Comment thread tests/CreativeCoders.Cli.Tests/Core/CommandResultTests.cs
Comment thread source/Cli/CreativeCoders.Cli.Core/OptionsValidationResult.cs
…nd usability

- Add comprehensive XML documentation for `CommandResult`, `OptionsValidationResult`, `ICliHost`, `ICliCommandContext`, and `ICliHostBuilder`.
- Update affected files to align with enhanced documentation standards.
@darthsharp darthsharp merged commit d96f12e into main Dec 25, 2025
6 checks passed
@darthsharp darthsharp deleted the feature/smallclienhancements branch December 25, 2025 12:22
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