Class: Neo4j::Spatial::Cmd

Inherits:
Object
  • Object
show all
Defined in:
lib/neo4j/spatial/cmd.rb

Class Method Summary collapse

Class Method Details

.argsObject



7
8
9
10
11
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
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/neo4j/spatial/cmd.rb', line 7

def self.args
  @args=[]
  while( arg = ARGV.shift ) do
    if arg =~ /^\-(\w+)/
      $1.split.each do |field|
        if field =~ /d/
          $delete = true
        elsif field =~ /D/
          path = ARGV.shift
          if path && path.length > 0
            Neo4j::Config[:storage_path] = path
          else
            puts "Invalid database location: #{path}"
          end
        elsif field =~ /x/
          $exists = true
        elsif field =~ /X/
          $exists = ARGV.shift
        elsif field =~ /E/
          $export = ARGV.shift
        elsif field =~ /M/
          $limit = Math.max(ARGV.shift.to_i, 10)
        elsif field =~ /F/
          $format = ARGV.shift
        elsif field =~ /L/
          $list = ARGV.shift
        elsif field =~ /Z/
          $zoom = ARGV.shift
        elsif field =~ /W/
          $width = ARGV.shift
        elsif field =~ /H/
          $height = ARGV.shift
        elsif field =~ /l/
          $list = 'layers'
        elsif field =~ /r/
          $delete = true
        elsif field =~ /h/
          $help = true
        else
          puts "Unrecognized argument: -#{field}"
        end
      end
    else
      @args << arg
    end
  end
  @args
end