Module: Jerakia::CLI::Config

Included in:
Jerakia::CLI
Defined in:
lib/jerakia/cli/config.rb

Class Method Summary collapse

Class Method Details

.included(thor) ⇒ Object


4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/jerakia/cli/config.rb', line 4

def self.included(thor)
  thor.class_eval do
    desc 'config <options>', 'Print the runtime configuration options'
    option :config,
           aliases: :c,
           type: :string,
           desc: 'Configuration file'
    def config
      require 'yaml'
      jerakia = Jerakia.new(:config => options[:config])
      puts jerakia.config.to_hash.to_yaml
    end
  end
end