Class: POI::Pois

Inherits:
Object
  • Object
show all
Defined in:
lib/poi/pois.rb

Instance Method Summary collapse

Instance Method Details

#run(argv) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/poi/pois.rb', line 7

def run(argv)
    options  = []
    OptionParser.new do |opts|
        opts.banner = "Usage: pois -f [host poi] [-d]"
        opts.on('-f', '--file FILE / URL', 'Generate using .poi file.') do |file|
            options << "-f"
            options << "https://raw.githubusercontent.com/poi-templates/pois/master/#{file.strip}.poi"
        end
    
        opts.on('-d', '--delete', 'Delete all generated file') do 
            options << "-d"
        end
        
        opts.on('-h', '--help', "Print help message") do 
            puts opts
            exit
        end
    end.parse!(argv)
    
    POI::App.new.run(options)
end