Class: Vpsctl::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/vpsctl/cli.rb

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ CLI

Returns a new instance of CLI.



5
6
7
# File 'lib/vpsctl/cli.rb', line 5

def initialize(argv)
  @argv = argv
end

Instance Method Details

#callObject



9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/vpsctl/cli.rb', line 9

def call
  case @argv.first
  when "version", "--version", "-v"
    puts Vpsctl::VERSION
  when "help", "--help", "-h", nil
    puts help
  else
    warn "Unknown command: #{@argv.first}"
    warn
    warn help
    1
  end
end