Skip to content

[Chore]: Update CommandHandler base class for System.CommandLine 2.0.0-beta5 #17

@ahmedig

Description

@ahmedig

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 with SetAction 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 of SetHandler 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

Related Issues:

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions