lib/bolt/bolt_option_parser.rb in bolt-2.26.0 vs lib/bolt/bolt_option_parser.rb in bolt-2.27.0
- old
+ new
@@ -62,10 +62,19 @@
banner: GROUP_HELP }
end
when 'guide'
{ flags: OPTIONS[:global] + %w[format],
banner: GUIDE_HELP }
+ when 'module'
+ case action
+ when 'install'
+ { flags: OPTIONS[:global] + %w[configfile force project],
+ banner: MODULE_INSTALL_HELP }
+ else
+ { flags: OPTIONS[:global],
+ banner: MODULE_HELP }
+ end
when 'plan'
case action
when 'convert'
{ flags: OPTIONS[:global] + OPTIONS[:global_config_setters],
banner: PLAN_CONVERT_HELP }
@@ -339,10 +348,39 @@
DESCRIPTION
Show the list of targets an action would run on.
HELP
+ MODULE_HELP = <<~HELP
+ NAME
+ module
+
+ USAGE
+ bolt module <action> [options]
+
+ DESCRIPTION
+ Install the project's modules
+
+ ACTIONS
+ install Install the project's modules
+ HELP
+
+ MODULE_INSTALL_HELP = <<~HELP
+ NAME
+ install
+
+ USAGE
+ bolt module install [options]
+
+ DESCRIPTION
+ Install the project's modules.
+
+ Module declarations are loaded from the project's configuration
+ file. Bolt will automatically resolve all module dependencies,
+ generate a Puppetfile, and install the modules.
+ HELP
+
PLAN_HELP = <<~HELP
NAME
plan
USAGE
@@ -826,11 +864,11 @@
end
define('--copy-command EXEC', "Command to copy files to remote hosts if using native SSH. ",
"This option is experimental.") do |exec|
@options[:'copy-command'] = exec
end
- define('--connect-timeout TIMEOUT', Integer, 'Connection timeout (defaults vary)') do |timeout|
+ define('--connect-timeout TIMEOUT', Integer, 'Connection timeout in seconds (defaults vary)') do |timeout|
@options[:'connect-timeout'] = timeout
end
define('--[no-]tty', 'Request a pseudo TTY on targets that support it') do |tty|
@options[:tty] = tty
end
@@ -862,12 +900,12 @@
separator "\nADDITIONAL OPTIONS"
define('--modules MODULES',
'A comma-separated list of modules to install from the Puppet Forge',
'when initializing a project. Resolves and installs all dependencies.') do |modules|
- @options[:modules] = modules.split(',')
+ @options[:modules] = modules.split(',').map { |mod| { 'name' => mod } }
end
- define('--force', 'Overwrite existing key pairs') do |_force|
+ define('--force', 'Force a destructive action') do |_force|
@options[:force] = true
end
separator "\nGLOBAL OPTIONS"
define('-h', '--help', 'Display help') do |_|