Skip to content

Conversation

Tyrrrz
Copy link
Owner

@Tyrrrz Tyrrrz commented May 12, 2025

Closes #156

@Tyrrrz Tyrrrz requested a review from Copilot May 12, 2025 19:45
@Tyrrrz Tyrrrz added the bug Something isn't working label May 12, 2025
Copy link

@Copilot 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 enables user-defined options to override the implicit "--help" and "--version" options by renaming the implicit options and updating their inclusion logic.

  • Rename “HelpOption” and “VersionOption” to “ImplicitHelpOption” and “ImplicitVersionOption” respectively.
  • Update the command schema logic to conditionally include implicit options based on whether a command explicitly defines them.
  • Update tests to verify both the positive and negative binding scenarios with the new implicit options.

Reviewed Changes

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

Show a summary per file
File Description
CliFx/Schema/OptionSchema.cs Renamed static properties to better reflect their implicit usage.
CliFx/Schema/CommandSchema.cs Modified logic to include implicit options only when not overridden by command-defined options.
CliFx/Input/OptionInput.cs Updated option checks to use implicit options.
CliFx/CliApplication.cs Adjusted help and version option checks to match the renamed properties.
CliFx.Tests/OptionBindingSpecs.cs Added tests for binding when using identifiers that match implicit options.
CliFx.Tests/HelpTextSpecs.cs Updated test names and behaviors to validate the new implicit option behavior.

Copy link

codecov bot commented May 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.91%. Comparing base (3fb2a23) to head (d54aa58).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #159      +/-   ##
==========================================
+ Coverage   92.89%   92.91%   +0.01%     
==========================================
  Files          84       84              
  Lines        2279     2285       +6     
  Branches      336      339       +3     
==========================================
+ Hits         2117     2123       +6     
  Misses         94       94              
  Partials       68       68              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate options when user defines an option with --help or --version identifier, and no way to pass value
1 participant