15
16
17
18
19
20
21
22
23
24
25
26
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
|
# File 'lib/fabric.rb', line 15
def self.run!(arguments)
OptionParser.new do |options|
options.banner = "Usage: fab mapfile [options]"
@@options[:narrate] = false
options.on('-n', '--narrate', 'Give full narrative output') do
@@options[:narrate] = true
end
options.on('-h', '--help', 'Show this help screen') do
puts options
exit
end
end.parse!
map_file = arguments.first
if map_file.nil? or not File.exists?(map_file)
no_map_error = <<NO_MAP_FILE
Usage: fab mapfile [options]
Please specify a valid map file.
NO_MAP_FILE
puts no_map_error
exit 1
end
@@options[:map_root] = File.dirname(File.expand_path(map_file))
narrate "Setting map_root to #{Fabric.options(:map_root)}"
require map_file
0
end
|