-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Area
Code Quality / Refactoring
Motivation
The CommandHandler<TOptions>
base class needs to be updated to support the new System.CommandLine 2.0.0-beta5 API patterns. The new version introduces breaking changes that affect:
- Handler method signatures (now use
ParseResult
instead of individual parameters) - SetHandler replaced with SetAction
- Updated option creation patterns
- Changes to how commands are structured and invoked
Task Description
Review and update the CommandHandler<TOptions>
base class in src/GenAIDBExplorer/GenAIDBExplorer.Console/CommandHandlers/CommandHandler.cs
to ensure compatibility with the new System.CommandLine 2.0.0-beta5 API.
Specific Changes Required:
- Update handler method signatures to use
ParseResult
parameter - Replace
SetHandler
withSetAction
method calls - Ensure compatibility with new option creation patterns
- Update any base functionality used by derived command handlers
- Verify that the generic options pattern still works correctly
Files to Review/Modify:
src/GenAIDBExplorer/GenAIDBExplorer.Console/CommandHandlers/CommandHandler.cs
src/GenAIDBExplorer/GenAIDBExplorer.Console/CommandHandlers/ICommandHandler.cs
- Any related interface or base class files
Acceptance Criteria
- Base class compiles without errors with new System.CommandLine version
- Handler method signatures are updated to use
ParseResult
parameter -
SetAction
is used instead ofSetHandler
where applicable - Generic options pattern continues to work with derived classes
- No breaking changes introduced to the command handler interface
- Base functionality remains available to all derived command handlers
Impact / Risk
- Dependencies: Requires completion of issues [Chore]: Update System.CommandLine package reference to 2.0.0-beta5 #15 and [Chore]: Migrate Program.cs to System.CommandLine 2.0.0-beta5 API #16 first
- Risk Level: High - Changes to base class affect all command handlers
- Breaking Changes: Could affect all command handler implementations
- Testing: Requires testing with at least one derived command handler
Related Issues:
- Depends on [Chore]: Update System.CommandLine package reference to 2.0.0-beta5 #15 (Update System.CommandLine package reference)
- Depends on [Chore]: Migrate Program.cs to System.CommandLine 2.0.0-beta5 API #16 (Migrate Program.cs to new API)
- Blocks all individual command handler updates
- Part of the larger System.CommandLine upgrade effort as outlined in plan-upgrade-system-commandline-beta5.md
Copilot