Class: SkillBench::Cli::RunCommand
- Inherits:
-
Object
- Object
- SkillBench::Cli::RunCommand
- 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
-
.call(argv) ⇒ Integer
Exit code.
Instance Method Summary collapse
-
#call ⇒ Integer
Parses options and runs the eval.
-
#initialize(argv) ⇒ RunCommand
constructor
A new instance of RunCommand.
Constructor Details
#initialize(argv) ⇒ RunCommand
Returns a new instance of RunCommand.
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.
13 14 15 |
# File 'lib/skill_bench/cli/run_command.rb', line 13 def self.call(argv) new(argv).call end |
Instance Method Details
#call ⇒ Integer
Parses options and runs the eval.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/skill_bench/cli/run_command.rb', line 25 def call = { skill_names: [] } parser = build_parser() parser.parse!(@argv) eval_name = @argv.shift return error_missing_eval unless eval_name return error_missing_skill if [:skill_names].empty? [:eval_name] = eval_name = .reject { |key| key == :format } result = Commands::Run.run(**) ResultPrinter.call(result, format: [:format] || :human) rescue HelpRequested 0 rescue StandardError => e warn "Error: #{e.}" 1 end |