Changeset db64553 for fedd


Ignore:
Timestamp:
Feb 23, 2010 6:24:02 AM (15 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-3.01, version-3.02
Children:
dbc9144
Parents:
2b11a1d
Message:

Add an option to prepend filesnames to output.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/fedid.py

    r2b11a1d rdb64553  
    1313        self.add_option("-a", "--attribute", action="append", dest="attrs",
    1414                help="Append attribute to each fedid")
     15        self.add_option('--label', action='store_true', dest='label',
     16                help='Include the filename before each fedid')
    1517
    1618parser = fedid_opts()
     
    1921for arg in args:
    2022    fid = fedid(file=arg)
    21     if opts.attrs: print "fedid:%s %s" % (fid, ','.join(opts.attrs))
    22     else: print "fedid:%s" % fid
    2323
     24    if opts.label: l = "%s: " % arg
     25    else: l = ""
     26
     27    if opts.attrs: print "%sfedid:%s %s" % (l, fid, ','.join(opts.attrs))
     28    else: print "%sfedid:%s" % (l, fid)
     29
Note: See TracChangeset for help on using the changeset viewer.