Class: Cir::Cli::RestoreCommand

Inherits:
CommandWithRepository show all
Defined in:
lib/cir/cli/restore_command.rb

Overview

Restore command

Instance Attribute Summary

Attributes inherited from CommandWithRepository

#repository

Attributes inherited from Command

#args, #files, #global_args

Instance Method Summary collapse

Methods inherited from CommandWithRepository

#initialize

Methods inherited from Command

#initialize

Constructor Details

This class inherits a constructor from Cir::Cli::CommandWithRepository

Instance Method Details

#optsObject



20
21
22
23
24
# File 'lib/cir/cli/restore_command.rb', line 20

def opts
  Trollop::Parser.new do
    banner "Discard local changes and restore last known version of the file (~ git reset)"
  end
end

#processObject



26
27
28
29
30
# File 'lib/cir/cli/restore_command.rb', line 26

def process
  Trollop::die "Missing file list" if self.files.empty?

  self.repository.restore(self.files)
end