2004-04-16 16:53:29 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- Mode: Python; py-indent-offset: 4 -*-
|
|
|
|
|
2006-06-09 10:50:21 +00:00
|
|
|
import optparse
|
|
|
|
|
2004-04-16 16:53:29 +00:00
|
|
|
import defsparser
|
|
|
|
|
2006-06-09 10:50:21 +00:00
|
|
|
parser = optparse.OptionParser(
|
|
|
|
usage="usage: %prog [options] generated-defs old-defs")
|
2005-06-26 13:59:34 +00:00
|
|
|
parser.add_option("-p", "--merge-parameters",
|
|
|
|
help="Merge changes in function/methods parameter lists",
|
|
|
|
action="store_true", dest="parmerge", default=False)
|
|
|
|
(options, args) = parser.parse_args()
|
2004-04-16 16:53:29 +00:00
|
|
|
|
2005-06-26 13:59:34 +00:00
|
|
|
if len(args) != 2:
|
|
|
|
parser.error("wrong number of arguments")
|
|
|
|
|
|
|
|
newp = defsparser.DefsParser(args[0])
|
|
|
|
oldp = defsparser.DefsParser(args[1])
|
2004-04-16 16:53:29 +00:00
|
|
|
|
|
|
|
newp.startParsing()
|
|
|
|
oldp.startParsing()
|
|
|
|
|
2005-06-26 13:59:34 +00:00
|
|
|
newp.merge(oldp, options.parmerge)
|
2004-04-16 16:53:29 +00:00
|
|
|
|
|
|
|
newp.write_defs()
|