### ###引数処理 ### parser = GetoptLong.new parser.set_options( ### global option ### ['--delt', GetoptLong::REQUIRED_ARGUMENT], ['--time', GetoptLong::REQUIRED_ARGUMENT], ['--num', GetoptLong::REQUIRED_ARGUMENT], ['--max', GetoptLong::REQUIRED_ARGUMENT], ['--min', GetoptLong::REQUIRED_ARGUMENT], ['--zlev', GetoptLong::REQUIRED_ARGUMENT], ['--noinfo', GetoptLong::NO_ARGUMENT], ['--dump', GetoptLong::NO_ARGUMENT] ) begin parser.each_option do |name, arg| eval "$OPT_#{name.sub(/^--/, '').gsub(/-/, '_')} = '#{arg}'" end rescue exit(1) end ### ### 初期化 ### deltime = $OPT_delt.to_f time0 = $OPT_time.to_f num = $OPT_num.to_i if ( $OPT_max ) maximum = $OPT_max.to_f else maximum = 2.0 end if ( $OPT_min ) minimum = $OPT_min.to_f else minimum = -2.0 end if ( $OPT_zlev ) zlev = $OPT_zlev.to_f else zlev = 300000.0 end if ( $OPT_noinfo ) infosw = false else infosw = true end p infosw