summaryrefslogtreecommitdiff
path: root/lib/chef/knife.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/chef/knife.rb')
-rw-r--r--lib/chef/knife.rb31
1 files changed, 16 insertions, 15 deletions
diff --git a/lib/chef/knife.rb b/lib/chef/knife.rb
index aa30f2e2ed..663649f32f 100644
--- a/lib/chef/knife.rb
+++ b/lib/chef/knife.rb
@@ -42,9 +42,9 @@ class Chef
extend Chef::Mixin::ConvertToClassName
extend Forwardable
- # Backwards Compat:
- # Ideally, we should not vomit all of these methods into this base class;
- # instead, they should be accessed by hitting the ui object directly.
+ # @note Backwards Compat:
+ # Ideally, we should not vomit all of these methods into this base class;
+ # instead, they should be accessed by hitting the ui object directly.
def_delegator :@ui, :stdout
def_delegator :@ui, :stderr
def_delegator :@ui, :stdin
@@ -105,12 +105,11 @@ class Chef
# Explicitly set the category for the current command to +new_category+
# The category is normally determined from the first word of the command
# name, but some commands make more sense using two or more words
- # ===Arguments
- # new_category::: A String to set the category to (see examples)
- # ===Examples:
- # Data bag commands would be in the 'data' category by default. To put them
- # in the 'data bag' category:
- # category('data bag')
+ # @param new_category [String] value to set the category to (see examples)
+ #
+ # @example Data bag commands would be in the 'data' category by default. To
+ # put them in the 'data bag' category:
+ # category('data bag')
def self.category(new_category)
@category = new_category
end
@@ -178,8 +177,9 @@ class Chef
@config_loader ||= WorkstationConfigLoader.new(nil, Chef::Log)
end
- def self.load_config(explicit_config_file)
+ def self.load_config(explicit_config_file, profile)
config_loader.explicit_config_file = explicit_config_file
+ config_loader.profile = profile
config_loader.load
ui.warn("No knife configuration file found") if config_loader.no_config_found?
@@ -196,10 +196,11 @@ class Chef
# Run knife for the given +args+ (ARGV), adding +options+ to the list of
# CLI options that the subcommand knows how to handle.
- # ===Arguments
- # args::: usually ARGV
- # options::: A Mixlib::CLI option parser hash. These +options+ are how
- # subcommands know about global knife CLI options
+ #
+ # @param args [Array] The arguments. Usually ARGV
+ # @param options [Mixlib::CLI option parser hash] These +options+ are how
+ # subcommands know about global knife CLI options
+ #
def self.run(args, options = {})
# Fallback debug logging. Normally the logger isn't configured until we
# read the config, but this means any logging that happens before the
@@ -404,7 +405,7 @@ class Chef
def configure_chef
# knife needs to send logger output to STDERR by default
Chef::Config[:log_location] = STDERR
- config_loader = self.class.load_config(config[:config_file])
+ config_loader = self.class.load_config(config[:config_file], config[:profile])
config[:config_file] = config_loader.config_location
# For CLI options like `--config-option key=value`. These have to get