#!/usr/bin/env python

import sys
import os
from optparse import OptionParser

parser = OptionParser()
options, args = parser.parse_args()

if not sys.stdin.isatty():
    args.insert(0, sys.stdin)
if len(args) > 1:
    sys.exit("Need exactly one argument or one pipe")

from goodruns import GRL

try:
    grl = GRL(args[0])
except:
    print "not a valid grl"
    sys.exit(1)

for run in grl:
    print run
