Class: SkillBench::Cli::EvalCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/skill_bench/cli/eval_command.rb

Overview

Handles the ‘skill-bench eval` subcommand. Dispatches to appropriate command handlers.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ EvalCommand

Returns a new instance of EvalCommand.

Parameters:

  • argv (Array<String>)

    Raw CLI arguments



21
22
23
# File 'lib/skill_bench/cli/eval_command.rb', line 21

def initialize(argv)
  @argv = argv
end

Class Method Details

.call(argv) ⇒ Integer

Parses argv and executes eval command.

Parameters:

  • argv (Array<String>)

    Raw CLI arguments

Returns:

  • (Integer)

    Exit code



16
17
18
# File 'lib/skill_bench/cli/eval_command.rb', line 16

def self.call(argv)
  new(argv).call
end

Instance Method Details

#callObject

Dispatches to appropriate eval action.



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/skill_bench/cli/eval_command.rb', line 27

def call
  action = @argv.shift
  command_class = Eval::EvalCommandRegistry.get_command(action)

  if command_class
    command_class.new.call(@argv)
  else
    warn "Unknown eval action: #{action}"
    1
  end
end