def bed(args):
    p = OptionParser(bed.__doc__)
    p.set_outfile()

    opts, args = p.parse_args(args)

    if len(args) != 1:
        sys.exit(not p.print_help())

    pslfile, = args
    fw = must_open(opts.outfile, "w")

    psl = Psl(pslfile)
    for p in psl:
        print >> fw, p.bed12line
%prog bed pslfile
dataset/ETHPy150Open tanghaibao/jcvi/formats/psl.py/bed