lib/bolt/bolt_option_parser.rb in bolt-3.9.2 vs lib/bolt/bolt_option_parser.rb in bolt-3.10.0

- old
+ new

@@ -65,11 +65,11 @@ end when 'guide' { flags: OPTIONS[:global] + %w[format], banner: GUIDE_HELP } when 'lookup' - { flags: ACTION_OPTS + %w[hiera-config], + { flags: ACTION_OPTS + %w[hiera-config plan-hierarchy], banner: LOOKUP_HELP } when 'module' case action when 'add' { flags: OPTIONS[:global] + PROJECT_PATHS, @@ -103,10 +103,19 @@ banner: PLAN_SHOW_HELP } else { flags: OPTIONS[:global], banner: PLAN_HELP } end + when 'plugin' + case action + when 'show' + { flags: OPTIONS[:global] + %w[color format modulepath project], + banner: PLUGIN_SHOW_HELP } + else + { flags: OPTIONS[:global], + banner: PLUGIN_HELP } + end when 'project' case action when 'init' { flags: OPTIONS[:global] + %w[modules], banner: PROJECT_INIT_HELP } @@ -190,10 +199,11 @@ guide View guides for Bolt concepts and features inventory Show the list of targets an action would run on module Manage Bolt project modules lookup Look up a value with Hiera plan Convert, create, show, and run Bolt plans + plugin Show available plugins project Create and migrate Bolt projects script Upload a local script and run it remotely secret Create encryption keys and encrypt and decrypt values task Show and run Bolt tasks @@ -405,21 +415,22 @@ LOOKUP_HELP = <<~HELP #{colorize(:cyan, 'Name')} lookup #{colorize(:cyan, 'Usage')} - bolt lookup <key> {--targets TARGETS | --query QUERY | --rerun FILTER} + bolt lookup <key> {--targets TARGETS | --query QUERY | --rerun FILTER | --plan-hierarchy} [options] #{colorize(:cyan, 'Description')} Look up a value with Hiera. #{colorize(:cyan, 'Documentation')} Learn more about using Hiera with Bolt at https://pup.pt/bolt-hiera. #{colorize(:cyan, 'Examples')} bolt lookup password --targets servers + bolt lookup password --plan-hierarchy variable=value HELP MODULE_HELP = <<~HELP #{colorize(:cyan, 'Name')} module @@ -606,10 +617,41 @@ bolt plan show Display documentation for the aggregate::count plan bolt plan show aggregate::count HELP + PLUGIN_HELP = <<~HELP + #{colorize(:cyan, 'Name')} + plugin + + #{colorize(:cyan, 'Usage')} + bolt plugin <action> [options] + + #{colorize(:cyan, 'Description')} + Show available plugins. + + #{colorize(:cyan, 'Documentation')} + Learn more about Bolt plugins at https://pup.pt/bolt-plugins. + + #{colorize(:cyan, 'Actions')} + show Show available plugins + HELP + + PLUGIN_SHOW_HELP = <<~HELP + #{colorize(:cyan, 'Name')} + show + + #{colorize(:cyan, 'Usage')} + bolt plugin show [options] + + #{colorize(:cyan, 'Description')} + Show available plugins. + + #{colorize(:cyan, 'Documentation')} + Learn more about Bolt plugins at https://pup.pt/bolt-plugins. + HELP + PROJECT_HELP = <<~HELP #{colorize(:cyan, 'Name')} project #{colorize(:cyan, 'Usage')} @@ -984,9 +1026,14 @@ separator "\n#{self.class.colorize(:cyan, 'Module options')}" define('--[no-]resolve', 'Use --no-resolve to install modules listed in the Puppetfile without resolving modules configured', 'in Bolt project configuration.') do |resolve| @options[:resolve] = resolve + end + + separator "\n#{self.class.colorize(:cyan, 'Lookup options')}" + define('--plan-hierarchy', 'Look up a value with Hiera in the context of a specific plan.') do |_| + @options[:plan_hierarchy] = true end separator "\n#{self.class.colorize(:cyan, 'Plan options')}" define('--pp', 'Create a new Puppet language plan.') do |_| @options[:puppet] = true