#!/usr/bin/env ruby require 'Maasha/biopieces' require 'getoptlong' options = GetoptLong.new( [ '--help', '-?', GetoptLong::NO_ARGUMENT ], [ '--stream_in', '-I', GetoptLong::REQUIRED_ARGUMENT ], [ '--stream_out', '-O', GetoptLong::REQUIRED_ARGUMENT ], [ '--verbose', '-v', GetoptLong::NO_ARGUMENT ] ) if ARGV.length == 0 then biopiece = $0.split( "/" ).last exec "print_wiki --data_in #{ ENV[ 'BP_DIR' ] }/bp_usage/#{ biopiece }.wiki" end options.each do | opt, arg | puts "option: #{ opt } argument: #{ arg }" case opt when '--help' biopiece = $0.split( "/" ).last exec "print_wiki --data_in #{ ENV[ 'BP_DIR' ] }/bp_usage/#{ biopiece }.wiki --help" when '--stream_in' puts "Stream in" stream = File.open( arg ) when '--stream_out' puts "Stream out" when '--verbose' puts "blababnlbalbalbalbalab" end end bp_stream = BioPieces.new( "test.stream" ) puts bp_stream.record_get