lib/heirloom/cli/update.rb in heirloom-0.3.1 vs lib/heirloom/cli/update.rb in heirloom-0.4.0
- old
+ new
@@ -1,20 +1,26 @@
module Heirloom
module CLI
class Update
+ include Heirloom::CLI::Shared
+
def initialize
@opts = read_options
@logger = HeirloomLogger.new :log_level => @opts[:level]
- exit 1 unless CLI::Shared.valid_options? :provided => @opts,
- :required => [:name, :id,
- :attribute,
- :updated_value],
- :logger => @logger
+ @config = load_config :logger => @logger,
+ :opts => @opts
+
+ exit 1 unless valid_options? :provided => @opts,
+ :required => [:name, :id,
+ :attribute,
+ :updated_value],
+ :logger => @logger
+
@archive = Archive.new :name => @opts[:name],
:id => @opts[:id],
- :logger => @logger
+ :config => @config
end
def update
@archive.update :attribute => @opts[:attribute],
:value => @opts[:updated_value]
@@ -35,12 +41,14 @@
EOS
opt :attribute, "Attribute to update.", :type => :string
opt :help, "Display Help"
opt :id, "ID of the archive to display.", :type => :string
+ opt :key, "AWS Access Key ID", :type => :string
opt :level, "Log level [debug|info|warn|error].", :type => :string,
:default => 'info'
opt :name, "Name of archive.", :type => :string
+ opt :secret, "AWS Secret Access Key", :type => :string
opt :updated_value, "Updated value of attribute.", :type => :string
end
end
end
end