bin/peto in peto-0.1.3 vs bin/peto in peto-0.2.0
- old
+ new
@@ -2,9 +2,24 @@
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require "peto"
+require "optparse"
+options = {}
+OptionParser.new do |opt|
+ opt.on("-o output directory") {|value| options[:output] = value }
+ opt.parse!(ARGV)
+end
+input = ARGV.pop
+
+if input.nil?
+ puts "usage:\n % peto contract.yml"
+ exit
+end
+
+options[:output] = File.dirname(input) if options[:output].nil?
+
peto = Peto::Master.new
-peto.load(ARGV.first)
-puts peto.generate
+peto.load(input)
+peto.generate