lib/heirloom/cli/show.rb in heirloom-0.12.3 vs lib/heirloom/cli/show.rb in heirloom-0.12.4

- old
+ new

@@ -15,13 +15,12 @@ :opts => @opts ensure_valid_options :provided => @opts, :required => [:name], :config => @config - ensure_valid_region :region => @opts[:metadata_region], - :config => @config - ensure_domain_exists :name => @opts[:name], + ensure_valid_metadata_region @config + ensure_domain_exists :name => @opts[:name], :config => @config # Can't use fetch as Trollop sets :id to nil id = @opts[:id] || (latest_id :name => @opts[:name], :config => @config) @@ -30,20 +29,16 @@ :config => @config, :id => id ensure_archive_exists :archive => @archive, :config => @config end - + def show data = @archive.show - if @opts[:json] - jj data - else - formatter = Heirloom::CLI::Formatter::Show.new - puts formatter.format :attributes => data, - :all => @opts[:all] - end + formatter = Heirloom::CLI::Formatter::Show.new + puts formatter.format :attributes => data, + :all => @opts[:all] end private def read_options @@ -70,10 +65,10 @@ opt :aws_access_key, "AWS Access Key ID", :type => :string, :short => :none opt :aws_secret_key, "AWS Secret Access Key", :type => :string, :short => :none opt :use_iam_profile, "Use IAM EC2 Profile", :short => :none - opt :environment, "Environment (defined in ~/.heirloom.yml)", :type => :string + opt :environment, "Environment (defined in heirloom config file)", :type => :string end end end end