Class: FeaturesReport::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/features_report/cli.rb

Class Method Summary collapse

Class Method Details

.executeObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/features_report/cli.rb', line 4

def self.execute
  opts = Trollop.options do 
    version "features_report 0.1 (c) 2008 Daniel Lucraft & Niko Felger"
    banner <<-EOS
features_report turns Cucumber features into a pretty PDF report. Output is put in features.pdf.

Usage:
   features_report [options] <filenames>+

where [options] are:
EOS

    opt :logo, "Path to image for the front page", :type => :string
  end
  Trollop.die "no features files given" if ARGV.empty?
  reader = Reader.new(ARGV)
  if defined?(Grit) and Git.git_repo?(ARGV.first)
    git = Git.new(ARGV)
  else
    git = nil
  end
  generator = Generator.new(reader, git, opts)
  generator.generate
end