12
13
14
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
|
# File 'lib/sem4r_sinatra/cli_server.rb', line 12
def parse_args( argv )
options = { :verbose => true, :force => false }
opts = OptionParser.new
opts.banner << " <catalog name>\n"
opts.banner << "launch a webs server to browse the content of <catalog name>\n";
opts.banner << "\n"
opts.on("-h", "--help", "Print this message") do
puts opts
return 0
end
opts.on("--version", "show the simple catalog version") do
puts "simple catalog version #{SimpleCatalog::version}"
return 0
end
opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
options[:verbose] = v
end
rest = opts.parse(argv)
WebServer.run! :host => 'localhost', :port => 9091
0
end
|