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
33
34
|
# File 'lib/log_twuncator/options.rb', line 6
def self.parse(args = ARGV, validate = true)
options = {}
options[:delay] = 5
opts = OptionParser.new do |opts|
opts.banner = "Usage: log_twuncator_daemon.rb [options]"
opts.separator ""
opts.separator "Specific options:"
opts.on("-d", "--delay N", Integer, "Check files for truncation every N minutes (default: 5)") do |v|
options[:delay] = v
end
opts.on("-c", "--config FILE", String, "Config file with projects session files to check") do |v|
options[:config] = v
end
opts.on("-l", "--log FILE", String, "Log file for truncator") do |v|
options[:log] = v
end
opts.on_tail("-h", "--help", "Show this message") do
puts opts
exit
end
end
opts.parse!(args)
validate_options(options) if validate
options
end
|