-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathhostmap.rb
27 lines (22 loc) · 851 Bytes
/
hostmap.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env ruby
# Add hostmap library folder to path
base = __FILE__
$:.unshift(File.join(File.expand_path(File.dirname(base)), File.join('lib', 'hostmap')))
$:.unshift(File.join(File.expand_path(File.dirname(base)), File.join('lib', 'hostmap-cli')))
require 'console'
puts "hostmap #{Hostmap::VERSION} codename #{Hostmap::CODENAME}"
puts "Coded by Alessandro `jekil` Tanasi <[email protected]>"
puts
# Start hostmap
begin
Hostmap::Ui::Cli.new(ARGV).run
rescue Interrupt
puts "\nExecution aborted by user."
rescue SystemExit
# Do nothing and exit.
rescue Exception => e
puts "Unhandled exception. Please report this bug sending an email to [email protected] attaching the following text:"
puts "Message:\n #{e.message}"
puts "Inspection:\n #{e.inspect}"
puts "Backtrace of the exception:\n #{e.backtrace.join("\n ")}"
end