Class: SkillBench::Cli::RunCommand

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

Overview

Handles the skill-bench run subcommand. Parses options and delegates to Commands::Run.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ RunCommand

Returns a new instance of RunCommand.

Parameters:

  • argv (Array<String>)

    Raw CLI arguments



18
19
20
# File 'lib/skill_bench/cli/run_command.rb', line 18

def initialize(argv)
  @argv = argv
end

Class Method Details

.call(argv) ⇒ Integer

Returns Exit code.

Parameters:

  • argv (Array<String>)

    Raw CLI arguments

Returns:

  • (Integer)

    Exit code



13
14
15
# File 'lib/skill_bench/cli/run_command.rb', line 13

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

Instance Method Details

#callInteger

Parses options and runs the eval(s).

Returns:

  • (Integer)

    Exit code



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

def call
  options = { skill_names: [] }
  parser = build_parser(options)
  parser.parse!(@argv)

  return run_batch(options) if batch_requested?(options)

  run_single(options)
rescue HelpRequested
  0
rescue StandardError => e
  warn "Error: #{e.message}"
  1
end