summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Harrison <mark@mivok.net>2015-07-20 11:22:04 -0400
committerMark Harrison <mark@mivok.net>2015-07-20 11:22:04 -0400
commit0cea929e152e1ec21de3237100c3d812cfec1eb5 (patch)
tree48e681c6ffe4d8986a4f71b4c9400fd413ab150e
parent9d87ba04c40d83de5dc003d666dab683cd4a421d (diff)
downloadchef-mh/formatter_chef_apply.tar.gz
Add formatter and force-logger/formatter options to chef-applymh/formatter_chef_apply
This change simply copies the formatter, force-logger and force-formatter options across from chef-client/chef-solo to chef-apply. The options are honored without further changes, and this allows you to force doc formatting output with chef-apply when the output isn't a terminal.
-rw-r--r--lib/chef/application/apply.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/chef/application/apply.rb b/lib/chef/application/apply.rb
index e9768b218c..243b441119 100644
--- a/lib/chef/application/apply.rb
+++ b/lib/chef/application/apply.rb
@@ -49,6 +49,24 @@ class Chef::Application::Apply < Chef::Application
:description => "Load attributes from a JSON file or URL",
:proc => nil
+ option :force_logger,
+ :long => "--force-logger",
+ :description => "Use logger output instead of formatter output",
+ :boolean => true,
+ :default => false
+
+ option :force_formatter,
+ :long => "--force-formatter",
+ :description => "Use formatter output instead of logger output",
+ :boolean => true,
+ :default => false
+
+ option :formatter,
+ :short => "-F FORMATTER",
+ :long => "--format FORMATTER",
+ :description => "output format to use",
+ :proc => lambda { |format| Chef::Config.add_formatter(format) }
+
option :log_level,
:short => "-l LEVEL",
:long => "--log_level LEVEL",