lib/bolt/bolt_option_parser.rb in bolt-0.21.3 vs lib/bolt/bolt_option_parser.rb in bolt-0.21.4
- old
+ new
@@ -26,10 +26,11 @@
bolt task show <task> Show documentation for task
bolt task run <task> [params] Run a Puppet task
bolt plan show Show list of available plans
bolt plan show <plan> Show details for plan
bolt plan run <plan> [params] Run a Puppet task plan
+ bolt puppetfile install Install modules from a Puppetfile into a Boltdir
Run `bolt <subcommand> --help` to view specific examples.
where [options] are:
HELP
@@ -90,10 +91,22 @@
#{examples('file upload /tmp/source /etc/profile.d/login.sh', 'upload a file to')}
Available options are:
HELP
+ PUPPETFILE_HELP = <<-HELP
+Usage: bolt puppetfile <action> [options]
+
+Available actions are:
+ install Install modules from a Puppetfile into a Boltdir
+
+Install modules into the local Boltdir
+ bolt puppetfile install
+
+Available options are:
+ HELP
+
# A helper mixin for OptionParser::Switch instances which will allow
# us to show/hide particular switch in the help message produced by
# the OptionParser#help method on demand.
module SwitchHider
attr_accessor :hide
@@ -191,11 +204,11 @@
"List of directories containing modules, separated by '#{File::PATH_SEPARATOR}'") do |modulepath|
@options[:modulepath] = modulepath.split(File::PATH_SEPARATOR)
end
define('--boltdir FILEPATH',
'Specify what Boltdir to load config from (default: autodiscovered from current working dir)') do |path|
- @options[:configfile] = path
+ @options[:boltdir] = path
end
define('--configfile FILEPATH',
'Specify where to load config from (default: ~/.puppetlabs/bolt/bolt.yaml)') do |path|
@options[:configfile] = path
end
@@ -251,12 +264,12 @@
def update
# show the --nodes and --query switches by default
@nodes.hide = @query.hide = false
- # Update the banner according to the mode
- self.banner = case @options[:mode]
+ # Update the banner according to the subcommand
+ self.banner = case @options[:subcommand]
when 'plan'
# don't show the --nodes and --query switches in the plan help
@nodes.hide = @query.hide = true
PLAN_HELP
when 'command'
@@ -265,9 +278,11 @@
SCRIPT_HELP
when 'task'
TASK_HELP
when 'file'
FILE_HELP
+ when 'puppetfile'
+ PUPPETFILE_HELP
else
BANNER
end
end