Class: S7n::S7nCli::SaveCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/s7n/s7ncli/command.rb

Overview

現在の状態を保存するコマンドを表現する。

Instance Attribute Summary

Attributes inherited from Command

#config, #options, #world

Instance Method Summary collapse

Methods inherited from Command

#aliases, create_instance, #description, #help, #name, #option_parser, split_name_and_argv, #usage

Constructor Details

#initialize(*args) ⇒ SaveCommand

Returns a new instance of SaveCommand.



155
156
157
158
# File 'lib/s7n/s7ncli/command.rb', line 155

def initialize(*args)
  super
  @options.push(BoolOption.new("f", "force", _("Force.")))
end

Instance Method Details

#run(argv) ⇒ Object



160
161
162
163
164
165
# File 'lib/s7n/s7ncli/command.rb', line 160

def run(argv)
  option_parser.parse!(argv)
  world.save(config["force"])
  puts(_("Saved."))
  return true
end