Class: Elevage::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/elevage.rb

Overview

Start of main CLI

Instance Method Summary collapse

Instance Method Details

#list(item) ⇒ Object

Process the ‘list` command



31
32
33
34
35
36
37
38
39
40
# File 'lib/elevage.rb', line 31

def list(item)
  # errors handled in class methods
  if LIST_CMDS.include?(item)
    puts Elevage::Platform.new.send(item).to_yaml
  else
    fail(IOError, ERR[:not_list_cmd]) unless File.file?(ENV_FOLDER + item + '.yml')
    environment = Elevage::Environment.new(item)
    puts options[:nodes] ? environment.list_nodes : environment
  end
end

#versionObject

Display the version



21
22
23
# File 'lib/elevage.rb', line 21

def version
  puts VERSION
end