14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/diffstitch/cli.rb', line 14
def run(argv)
options = parse_options!(argv)
validate_repo!
validate_args!(argv)
base = argv[0]
branches = argv[1..]
verify_refs!(base, branches)
title = options[:title] || "diffstitch: #{branches.join(' | ')} vs #{base}"
output_dir = options[:output] || derived_output(base, branches)
diffs = collect_diffs(base, branches)
Generator.new(base: base, branches: branches, diffs: diffs, title: title).write(output_dir)
index = File.expand_path(File.join(output_dir, 'index.html'))
puts "Generated: #{index}"
open_in_browser(index) if options[:open]
end
|