Module: R10K::CLI::Deploy::Display

Defined in:
lib/r10k/cli/deploy.rb

Class Method Summary collapse

Class Method Details

.commandObject



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/r10k/cli/deploy.rb', line 116

def self.command
  @cmd ||= Cri::Command.define do
    name  'display'
    usage 'display'
    summary 'Display environments and modules in the deployment'

    flag :p, :puppetfile, 'Display Puppetfile modules'
    flag :h, :help, 'Show help for this command' do |value, cmd|
      puts cmd.help
      exit 0
    end

    run do |opts, args, cmd|
      deploy = R10K::Deployment.load_config(opts[:config])

      task = R10K::Task::Deployment::Display.new(deploy)
      task.puppetfile = opts[:puppetfile]

      runner = R10K::TaskRunner.new(:trace => opts[:trace])
      runner.prepend_task task
      runner.run

      exit runner.exit_value
    end
  end
end