Class: Rubydex::CLI::Command::Skill

Inherits:
Command
  • Object
show all
Defined in:
lib/rubydex/cli/command/skill.rb

Overview

rdx skill [ID] — lists available skill ids, or loads and prints a skill's body by id.

Instance Method Summary collapse

Instance Method Details

#runObject

: -> void



17
18
19
20
21
22
23
24
25
26
# File 'lib/rubydex/cli/command/skill.rb', line 17

def run
  parse_options!

  id = argv.shift
  abort_with_usage("unexpected argument: #{argv.first}") unless argv.empty?

  id ? print_skill(id) : list_skills
rescue Rubydex::SkillError => e
  abort(e.message)
end