diff --git a/lib/chef/knife/joyent_server_pricing.rb b/lib/chef/knife/joyent_server_pricing.rb index 4c70b0b..2368e04 100644 --- a/lib/chef/knife/joyent_server_pricing.rb +++ b/lib/chef/knife/joyent_server_pricing.rb @@ -14,11 +14,16 @@ class JoyentServerPricing < Knife option :show_zones, :short => '-z', - :long => '--show-zones', - :description => 'Print list of on-demand zones sorted by price', + :long => '--show-zone-flavors', + :description => 'Print aggregated list of zone flavors sorted by price', :proc => Proc.new { |key| Chef::Config[:knife][:show_zones] = key } - banner 'knife joyent server pricing [-r ] [ -z ] ' + option :no_color, + :long => '--no-color', + :description => 'Disable color when printing', + :proc => Proc.new { |key| Chef::Config[:knife][:no_color] = true } + + banner 'knife joyent server pricing [-r your-reserve-pricing.yml -z --no-color ...] ' def run flavors = [] @@ -26,9 +31,10 @@ def run flavor = s.package || 'unknown' flavors << flavor end - reporter = Joyent::Cloud::Pricing::Reporter.new(Chef::Config[:knife][:reserve_pricing], flavors) - reporter.print_zone_list = Chef::Config[:knife][:show_zones] - puts reporter.render + config = Chef::Config[:knife] + reporter = Joyent::Cloud::Pricing::Reporter.new(config[:reserve_pricing], flavors) + reporter.print_zone_list = config[:show_zones] + puts reporter.render(:disable_color => config[:no_color]) rescue => e output_error(e) end