Class: SkillBench::Cli::SkillCommand
- Inherits:
-
Object
- Object
- SkillBench::Cli::SkillCommand
- Defined in:
- lib/skill_bench/cli/skill_command.rb
Overview
Handles the ‘skill-bench skill` subcommand. Parses options and delegates to Commands::SkillNew.
Class Method Summary collapse
-
.call(argv) ⇒ Integer
Parses argv and executes the skill command.
Instance Method Summary collapse
-
#call ⇒ Object
Dispatches to the appropriate skill action.
-
#initialize(argv) ⇒ SkillCommand
constructor
A new instance of SkillCommand.
Constructor Details
#initialize(argv) ⇒ SkillCommand
Returns a new instance of SkillCommand.
19 20 21 |
# File 'lib/skill_bench/cli/skill_command.rb', line 19 def initialize(argv) @argv = argv end |
Class Method Details
.call(argv) ⇒ Integer
Parses argv and executes the skill command.
14 15 16 |
# File 'lib/skill_bench/cli/skill_command.rb', line 14 def self.call(argv) new(argv).call end |
Instance Method Details
#call ⇒ Object
Dispatches to the appropriate skill action.
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/skill_bench/cli/skill_command.rb', line 25 def call action = @argv.shift case action when 'new' handle_new(@argv) when '-h', '--help', 'help', nil print_help 0 else warn "Unknown skill action: #{action}" 1 end end |