source: fedd/fedid.py @ f816079

axis_examplecompt_changesinfo-opsversion-1.30version-2.00version-3.01version-3.02
Last change on this file since f816079 was f816079, checked in by Ted Faber <faber@…>, 15 years ago

restore fedid command line util

  • Property mode set to 100755
File size: 619 bytes
Line 
1#!/usr/local/bin/python
2
3from fedd import fedid
4from optparse import OptionParser
5
6
7class fedid_opts(OptionParser):
8    """Encapsulate option processing in this class, rather than in main"""
9    def __init__(self):
10        OptionParser.__init__(self, usage="%prog [opts] (--help for details)",
11                version="1.0")
12
13        self.add_option("-a", "--attribute", action="append", dest="attrs", 
14                help="Append attribute to each fedid")
15
16parser = fedid_opts()
17opts, args = parser.parse_args()
18
19for arg in args:
20    fid = fedid(file=arg)
21    if opts.attrs: print "fedid:%s %s" % (fid, ','.join(opts.attrs))
22    else: print "fedid:%s" % fid
23
Note: See TracBrowser for help on using the repository browser.