Class: SkillBench::Cli::InitCommand
- Inherits:
-
Object
- Object
- SkillBench::Cli::InitCommand
- Defined in:
- lib/skill_bench/cli/init_command.rb
Overview
Handles the ‘skill-bench init` subcommand. Parses options and delegates to Commands::Init.
Class Method Summary collapse
-
.call(argv) ⇒ Integer
Exit code.
Instance Method Summary collapse
-
#call ⇒ Integer
Parses options and runs init.
-
#initialize(argv) ⇒ InitCommand
constructor
A new instance of InitCommand.
Constructor Details
#initialize(argv) ⇒ InitCommand
Returns a new instance of InitCommand.
18 19 20 |
# File 'lib/skill_bench/cli/init_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/init_command.rb', line 13 def self.call(argv) new(argv).call end |
Instance Method Details
#call ⇒ Integer
Parses options and runs init.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/skill_bench/cli/init_command.rb', line 25 def call = { force: false, provider: nil } parser = build_parser() parser.parse!(@argv) return error_missing_provider unless [:provider] Commands::Init.run(**) puts "Created #{SkillBench::Config::CONFIG_FILENAME}" 0 rescue SkillBench::HelpRequested 0 rescue StandardError => e warn "Error: #{e.}" 1 end |