27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
# File 'lib/dotenv-android/cli.rb', line 27
def parse_options
options = Options.new
options.verbose = false
options.debug = false
opt_parser = OptionParser.new do |opts|
opts.banner = 'Usage: dotenv-android [options]'
opts.on('-v', '--version', 'Print version') do
puts DotEnvAndroid::Version.get
exit
end
opts.on('-s', '--source DIR', 'Source code directory to check for requested environment variables') do |source|
options.source = source
options.out = Pathname.new(source).join('Env.kt') end
opts.on('--verbose', 'Verbose output') do
options.verbose = true
end
opts.on('--debug', 'Debug output (also turns on verbose)') do
options.verbose = true
options.debug = true
end
opts.on('-o', '--out FILE', 'Output file (example: Path/Env.kt)') do |out|
options.out = out
end
opts.on('-h', '--help', 'Prints this help') do
puts opts
exit
end
end
help = opt_parser.help
abort(help) if ARGV.empty?
opt_parser.parse!(ARGV)
options
end
|