Class: Inch::CLI::Command::Diff

Inherits:
Base
  • Object
show all
Includes:
Utils::ShellHelper
Defined in:
lib/inch/cli/command/diff.rb

Instance Attribute Summary

Attributes inherited from Base

#codebase

Instance Method Summary collapse

Methods included from Utils::ShellHelper

#git, #sh

Methods inherited from Base

#initialize, #name, register_command_as, run

Methods included from TraceHelper

#ui

Constructor Details

This class inherits a constructor from Inch::CLI::Command::Base

Instance Method Details

#descriptionObject



13
14
15
# File 'lib/inch/cli/command/diff.rb', line 13

def description
  'Shows a diff'
end

#run(*args) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/inch/cli/command/diff.rb', line 21

def run(*args)
  @options.parse(args)
  @options.verify

  before_rev, after_rev = revisions[0], revisions[1]
  diff = API::Diff.new(work_dir, before_rev, after_rev)

  Output::Diff.new(@options, diff.comparer)
end

#usageObject



17
18
19
# File 'lib/inch/cli/command/diff.rb', line 17

def usage
  'Usage: inch diff [REV..[REV]] [options]'
end