lib/heirloom/cli/show.rb in heirloom-0.7.4 vs lib/heirloom/cli/show.rb in heirloom-0.8.0
- old
+ new
@@ -28,11 +28,18 @@
ensure_archive_exists :archive => @archive,
:config => @config
end
def show
- jj @archive.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
end
private
def read_options
@@ -48,10 +55,12 @@
If -i is ommited, latest ID is displayed.
EOS
opt :help, "Display Help"
+ opt :all, "Display all attributes (includes internal heirloom settings)."
opt :id, "ID of the Heirloom to display.", :type => :string
+ opt :json, "Display output as raw JSON."
opt :level, "Log level [debug|info|warn|error].", :type => :string,
:default => 'info'
opt :metadata_region, "AWS region to store Heirloom metadata.", :type => :string,
:default => 'us-west-1'
opt :name, "Name of Heirloom.", :type => :string