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
66
67
68
|
# File 'lib/placer.rb', line 28
def parse_options(args)
opts = OptionParser.new
params = {}
banner = <<BANNER
placer - a simpler deployment
deployment back to the basics
If you have no config, just start off by the example in the repo/placer.yaml.
In case you are wondering, public/private key auth is the only way.
We don't support manual solutions. This tool is thought for automated use.
Usage: placer [options]
BANNER
opts.banner = banner
params[:log] = true
opts.on('-q', '--[no-]log', 'toggle logging') do |val|
params[:log] = val
end
params[:config_path] = 'placer.rb'
opts.on('-c', '--config FILE', 'path to config FILE to use default: ' << params[:config_path]) do |file|
params[:config_path] = file
end
params[:debug] = false
opts.on('--debug', 'enable debugging') do
params[:debug] = true
end
opts.on_tail('-h', '--help', 'shows this message') do
puts opts
exit
end
args = opts.parse(args)
[args, params]
end
|