summaryrefslogtreecommitdiff
path: root/lib/chef/shell.rb
diff options
context:
space:
mode:
authorClaire McQuin <mcquin@users.noreply.github.com>2014-06-11 16:04:12 -0700
committerClaire McQuin <mcquin@users.noreply.github.com>2014-06-11 16:04:12 -0700
commit56d6cc8b2c24afd4bf6e3001a3635fa2beeec700 (patch)
tree4869d0ffd9c7e0b32b3c95bc7ab3a8725119fc28 /lib/chef/shell.rb
parentf267978ccbba62c7e50a6b4722fb6f2aa0ef34d4 (diff)
parent0fe170b0b72f6990ae7ccb55196f16196cd8d3cc (diff)
downloadchef-56d6cc8b2c24afd4bf6e3001a3635fa2beeec700.tar.gz
Merge pull request #1443 from opscode/ryancragun/CHEF-5314_11-master
[CHEF-5314] Support override_runlist CLI option in shef/chef-shell
Diffstat (limited to 'lib/chef/shell.rb')
-rw-r--r--lib/chef/shell.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/chef/shell.rb b/lib/chef/shell.rb
index 1519c47d88..33c10e22a6 100644
--- a/lib/chef/shell.rb
+++ b/lib/chef/shell.rb
@@ -53,6 +53,7 @@ module Shell
IRB::ExtendCommandBundle.instance_variable_get(:@ALIASES).delete(irb_help)
parse_opts
+ Chef::Config[:shell_config] = options.config
# HACK: this duplicates the functions of IRB.start, but we have to do it
# to get access to the main object before irb starts.
@@ -258,6 +259,12 @@ FOOTER
:proc => lambda {|v| puts "Chef: #{::Chef::VERSION}"},
:exit => 0
+ option :override_runlist,
+ :short => "-o RunlistItem,RunlistItem...",
+ :long => "--override-runlist RunlistItem,RunlistItem...",
+ :description => "Replace current run list with specified items",
+ :proc => lambda { |items| items.split(',').map { |item| Chef::RunList::RunListItem.new(item) }}
+
def self.print_help
instance = new
instance.parse_options([])