Class: Smith::CLI
- Inherits:
-
Object
- Object
- Smith::CLI
- Defined in:
- lib/smith/cli.rb
Instance Method Summary collapse
-
#initialize(argv) ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
#initialize(argv) ⇒ CLI
Returns a new instance of CLI.
8 9 10 |
# File 'lib/smith/cli.rb', line 8 def initialize(argv) @argv = argv.dup end |
Instance Method Details
#run ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/smith/cli.rb', line 12 def run command = @argv.shift || "doctor" case command when "doctor" then run_doctor when "install" then run_install when "version" then run_version when "--help", "-h" then run_help else warn "Unknown command: #{command}" warn usage 1 end end |