Sha256: e54bac5b7bc22f495949e5adb817108fcf2b964e98894af6ace3429669aed41b

Contents?: true

Size: 1007 Bytes

Versions: 1

Compression:

Stored size: 1007 Bytes

Contents

require 'neo4j'

# Simple utility for parsing common command-line arguments specific to some command-line utilities
module Neo4j
  module Spatial
    class Cmd
      def self.args
        @args=[]
        while( arg = ARGV.shift ) do
          if arg =~ /\-d/
            $delete = true
          elsif arg =~ /\-D/
            path = ARGV.shift
            if path && path.length > 0
              Neo4j::Config[:storage_path] = path
            else
              puts "Invalid database location: #{path}"
            end
          elsif arg =~ /\-E/
            $export = ARGV.shift
          elsif arg =~ /\-M/
            $limit = Math.max(ARGV.shift.to_i, 10)
          elsif arg =~ /\-F/
            $format = ARGV.shift
          elsif arg =~ /\-L/
            $list = ARGV.shift
          elsif arg =~ /\-l/
            $list = 'layers'
          elsif arg =~ /\-h/
            $help = true
          else
            @args << arg
          end
        end
        @args
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
neo4j-spatial-0.0.2-java lib/neo4j/spatial/cmd.rb