Module: PDK::CLI
- Defined in:
- 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/config.rb,
lib/pdk/cli/errors.rb,
lib/pdk/cli/module.rb,
lib/pdk/cli/update.rb,
lib/pdk/cli/console.rb,
lib/pdk/cli/convert.rb,
lib/pdk/cli/new/task.rb,
lib/pdk/cli/new/test.rb,
lib/pdk/cli/validate.rb,
lib/pdk/cli/new/class.rb,
lib/pdk/cli/test/unit.rb,
lib/pdk/cli/config/get.rb,
lib/pdk/cli/exec_group.rb,
lib/pdk/cli/new/module.rb,
lib/pdk/cli/exec/command.rb,
lib/pdk/cli/module/build.rb,
lib/pdk/cli/new/provider.rb,
lib/pdk/cli/new/transport.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,
lib/pdk/cli/exec/interactive_command.rb,
lib/pdk/cli.rb
Defined Under Namespace
Modules: Exec, Util
Classes: ExecGroup, ExitWithError, FatalError
Class Method Summary
collapse
Class Method Details
.anonymised_args ⇒ Object
Attempt to anonymise the raw ARGV array if the command parsing failed.
If an item does not start with ‘-’ but is preceeded by an item that does start with ‘-’, assume that these items are an option/value pair and redact the value. Any additional values that do not start with ‘-’ that follow an option/value pair are assumed to be arguments (rather than subcommand names) and are also redacted.
41
42
43
44
45
46
47
48
49
50
51
|
# File 'lib/pdk/cli.rb', line 41
def self.anonymised_args
in_args = false
@args.map do |arg|
if arg.start_with?('-')
in_args = true
arg
else
in_args ? 'redacted' : arg
end
end
end
|
.full_interview_option(dsl) ⇒ Object
95
96
97
|
# File 'lib/pdk/cli.rb', line 95
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
104
105
106
107
108
|
# File 'lib/pdk/cli.rb', line 104
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
99
100
101
102
|
# File 'lib/pdk/cli.rb', line 99
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
|
.skip_interview_option(dsl) ⇒ Object
91
92
93
|
# File 'lib/pdk/cli.rb', line 91
def self.skip_interview_option(dsl)
dsl.option nil, 'skip-interview', _('When specified, skips interactive querying of metadata.')
end
|
.template_ref_option(dsl) ⇒ Object
87
88
89
|
# File 'lib/pdk/cli.rb', line 87
def self.template_ref_option(dsl)
dsl.option nil, 'template-ref', _('Specifies the template git branch or tag to use when creating new modules or classes.'), argument: :required
end
|
.template_url_option(dsl) ⇒ Object
79
80
81
82
83
84
85
|
# File 'lib/pdk/cli.rb', line 79
def self.template_url_option(dsl)
require 'pdk/util/template_uri'
desc = _('Specifies the URL to the template to use when creating new modules or classes. (default: %{default_url})') % { default_url: PDK::Util::TemplateURI.default_template_uri }
dsl.option nil, 'template-url', desc, argument: :required
end
|