lib/heirloom/cli/list.rb in heirloom-0.7.4 vs lib/heirloom/cli/list.rb in heirloom-0.8.0
- old
+ new
@@ -20,12 +20,17 @@
@archive = Archive.new :name => @opts[:name],
:config => @config
end
def list(count = @opts[:count])
- @logger.debug "#{@archive.count} archives found."
- jj @archive.list(count)
+ @logger.debug "#{@archive.count} IDs found."
+ list = @archive.list count
+ if @opts[:json]
+ jj list
+ else
+ puts list.join "\n"
+ end
end
private
def read_options
@@ -41,9 +46,10 @@
EOS
opt :count, "Number of IDs to return.", :type => :integer,
:default => 10
opt :help, "Display Help"
+ 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