-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.rb
More file actions
32 lines (24 loc) · 665 Bytes
/
app.rb
File metadata and controls
32 lines (24 loc) · 665 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
require 'bundler'
require 'optparse'
Bundler.require
require_relative "./lib/extractor.rb"
class App
def initialize(*args)
options = Hash.new
OptionParser.new do |parser|
parser.banner = "Usage: app.rb [options]"
parser.on("-f", "--format=FORMAT", "# Output format file. Options: (csv/html).", "# Default: csv") do |v|
options[:format] = v
end
parser.on("-d", "--directory=DIRECTORY", "# Especify a directory wich is a relative path where the project is.") do |v|
options[:directory] = v
end
end.parse!
if options.empty?
Extractor.new.call
else
Extractor.new(options).call
end
end
end
App.new(*ARGV)