summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/chef_class.rb10
-rw-r--r--lib/chef/shell.rb22
2 files changed, 27 insertions, 5 deletions
diff --git a/lib/chef/chef_class.rb b/lib/chef/chef_class.rb
index dc87ebd271..edc229f203 100644
--- a/lib/chef/chef_class.rb
+++ b/lib/chef/chef_class.rb
@@ -1,6 +1,6 @@
#
# Author:: Lamont Granquist (<lamont@chef.io>)
-# Copyright:: Copyright 2015-2018, Chef Software Inc.
+# Copyright:: Copyright 2015-2020, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -97,8 +97,8 @@ class Chef
#
# @return [Array<Class>] Modified Priority Array of Provider Classes to use for the resource_name on the node
#
- def set_provider_priority_array(resource_name, priority_array, *filter, &block)
- result = provider_priority_map.set_priority_array(resource_name.to_sym, priority_array, *filter, &block)
+ def set_provider_priority_array(resource_name, priority_array, **filter, &block)
+ result = provider_priority_map.set_priority_array(resource_name.to_sym, priority_array, **filter, &block)
result = result.dup if result
result
end
@@ -112,8 +112,8 @@ class Chef
#
# @return [Array<Class>] Modified Priority Array of Resource Classes to use for the resource_name on the node
#
- def set_resource_priority_array(resource_name, priority_array, *filter, &block)
- result = resource_priority_map.set_priority_array(resource_name.to_sym, priority_array, *filter, &block)
+ def set_resource_priority_array(resource_name, priority_array, **filter, &block)
+ result = resource_priority_map.set_priority_array(resource_name.to_sym, priority_array, **filter, &block)
result = result.dup if result
result
end
diff --git a/lib/chef/shell.rb b/lib/chef/shell.rb
index 68c286abb1..e5f7dc64b9 100644
--- a/lib/chef/shell.rb
+++ b/lib/chef/shell.rb
@@ -61,6 +61,11 @@ module Shell
# to get access to the main object before irb starts.
::IRB.setup(nil)
+ irb_conf[:USE_COLORIZE] = options.config[:use_colorize]
+ irb_conf[:USE_SINGLELINE] = options.config[:use_singleline]
+ irb_conf[:USE_MULTILINE] = options.config[:use_multiline]
+ pp irb_conf[:USE_MULTILINE]
+
irb = IRB::Irb.new
if solo_mode?
@@ -127,6 +132,8 @@ module Shell
conf.prompt_n = "#{Chef::Dist::EXEC}#{leader(m)} ?> "
conf.prompt_s = "#{Chef::Dist::EXEC}#{leader(m)}%l> "
conf.use_tracer = false
+ conf.instance_variable_set(:@use_multiline, false)
+ conf.instance_variable_set(:@use_singleline, false)
end
end
@@ -219,6 +226,21 @@ module Shell
#{Chef::Dist::USER_CONF_DIR}/knife.rb if -s option is given.
FOOTER
+ option :use_multiline,
+ long: "--[no-]multiline",
+ default: true,
+ description: "[Do not] use multiline editor module"
+
+ option :use_singleline,
+ long: "--[no-]singleline",
+ default: true,
+ description: "[Do not] use singleline editor module"
+
+ option :use_colorize,
+ long: "--[no-]colorize",
+ default: true,
+ description: "[Do not] use colorization"
+
option :config_file,
short: "-c CONFIG",
long: "--config CONFIG",