Module: PDK::CLI
- Defined in:
- lib/pdk/cli.rb,
lib/pdk/cli/new.rb,
lib/pdk/cli/exec.rb,
lib/pdk/cli/test.rb,
lib/pdk/cli/util.rb,
lib/pdk/cli/build.rb,
lib/pdk/cli/bundle.rb,
lib/pdk/cli/errors.rb,
lib/pdk/cli/module.rb,
lib/pdk/cli/update.rb,
lib/pdk/cli/convert.rb,
lib/pdk/cli/new/task.rb,
lib/pdk/cli/validate.rb,
lib/pdk/cli/new/class.rb,
lib/pdk/cli/test/unit.rb,
lib/pdk/cli/exec_group.rb,
lib/pdk/cli/new/module.rb,
lib/pdk/cli/module/build.rb,
lib/pdk/cli/new/provider.rb,
lib/pdk/cli/util/interview.rb,
lib/pdk/cli/module/generate.rb,
lib/pdk/cli/new/defined_type.rb,
lib/pdk/cli/util/option_validator.rb,
lib/pdk/cli/util/option_normalizer.rb,
lib/pdk/cli/util/command_redirector.rb
Defined Under Namespace
Modules: Exec, Util
Classes: ExecGroup, ExitWithError, FatalError
Class Method Summary
collapse
Class Method Details
.full_interview_option(dsl) ⇒ Object
49
50
51
|
# File 'lib/pdk/cli.rb', line 49
def self.full_interview_option(dsl)
dsl.option nil, 'full-interview', _('When specified, interactive querying of metadata will include all optional questions.')
end
|
.puppet_dev_option(dsl) ⇒ Object
58
59
60
61
62
|
# File 'lib/pdk/cli.rb', line 58
def self.puppet_dev_option(dsl)
dsl.option nil,
'puppet-dev',
_('When specified, PDK will validate or test against the current Puppet source from github.com. To use this option, you must have network access to https://github.com.')
end
|
.puppet_version_options(dsl) ⇒ Object
53
54
55
56
|
# File 'lib/pdk/cli.rb', line 53
def self.puppet_version_options(dsl)
dsl.option nil, 'puppet-version', _('Puppet version to run tests or validations against.'), argument: :required
dsl.option nil, 'pe-version', _('Puppet Enterprise version to run tests or validations against.'), argument: :required
end
|
.run(args) ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/pdk/cli.rb', line 17
def self.run(args)
@base_cmd.run(args)
rescue PDK::CLI::ExitWithError => e
PDK.logger.send(e.log_level, e.message)
exit e.exit_code
rescue PDK::CLI::FatalError => e
PDK.logger.fatal(e.message) if e.message
cause = e.cause
if cause.nil?
e.backtrace.each { |line| PDK.logger.debug(line) }
else
PDK.logger.debug("#{cause.class}: #{cause.message}")
cause.backtrace.each { |line| PDK.logger.debug(line) }
end
exit e.exit_code
end
|
.skip_interview_option(dsl) ⇒ Object
45
46
47
|
# File 'lib/pdk/cli.rb', line 45
def self.skip_interview_option(dsl)
dsl.option nil, 'skip-interview', _('When specified, skips interactive querying of metadata.')
end
|
.template_url_option(dsl) ⇒ Object
41
42
43
|
# File 'lib/pdk/cli.rb', line 41
def self.template_url_option(dsl)
dsl.option nil, 'template-url', _('Specifies the URL to the template to use when creating new modules or classes.'), argument: :required, default: PDK::Util.default_template_url
end
|