#!/usr/bin/env ruby require 'optparse' require 'pp' options = {} optparse = OptionParser.new do |opts| opts.on( '-?', '--help', 'Display this screen' ) do biopiece = $0.split( "/" ).last exec "print_wiki --data_in #{ ENV[ 'BP_DIR' ] }/bp_usage/#{ biopiece }.wiki --help" exit end opts.on( '-v', '--verbose' ) do options[ :verbose ] = true end opts.on( '-I', '--stream_in FILE', Time ) do |arg| options[:stream_in] = arg end # opts.on( '-I', '--stream_in FILE', "Mandatory argument" ) do |arg| # options[:stream_in] = arg # end opts.on( '-O', '--stream_out FILE', "Mandatory argument" ) do |arg| options[:stream_out] = arg end end optparse.parse! pp "Options:", options pp "ARGV:", ARGV if ARGV.length == 0 then biopiece = $0.split( "/" ).last exec "print_wiki --data_in #{ ENV[ 'BP_DIR' ] }/bp_usage/#{ biopiece }.wiki" end