Sha256: 6a040b960c90cc2f4dc2d38e0399c118bb4dbabf102c2c11821b7b83394bcff9

Contents?: true

Size: 879 Bytes

Versions: 1

Compression:

Stored size: 879 Bytes

Contents

#!/usr/bin/ruby
$: << "#{File.dirname(__FILE__)}/../lib"
require 'optparse'
require 'ruby_protobuf'
#require 'protobuf/compiler/compiler_old'
require 'protobuf/compiler/compiler'


COMMAND_LINE = "#{$0} #{ARGV.join(' ')} PROTO_FILE"
OPT = {}
opts = OptionParser.new
opts.on('-p', '--proto_path <PATH>', 'Specify the directory in which to search for imports. The current directory is default.'){|v| OPT[:proto_path] = v}
opts.on('-o', '--out <OUT_DIR>', 'Specify the directory in which Ruby source file is generated. The current directory is default.'){|v| OPT[:out] = v}
opts.on_tail('-v', '--version', 'Show version.'){puts(opts.ver); exit}
opts.on_tail('-h', '--help', 'Show this message.'){puts(opts.help); exit}

::Version = RubyProtobuf::VERSION
opts.order! ARGV
PROTO_FILE = ARGV.shift

Protobuf::Compiler.compile(PROTO_FILE, (OPT[:proto_path] or '.'), (OPT[:out] or '.'))

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby_protobuf-0.3.0 bin/rprotoc