Commit 9228321b authored by Nicolas Delaby's avatar Nicolas Delaby

Use OptionParser to read arguments

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils/xupdate_processor@35582 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f996d196
......@@ -3,9 +3,19 @@ from xuproc import applyXUpdate
from lxml import etree
def main():
import sys
doc_xml_name = sys.argv[1]
xu_xml_name = sys.argv[2]
from optparse import OptionParser
usage = "usage: %prog xupdate_path document_path"
parser = OptionParser(usage=usage)
options, args = parser.parse_args()
if len(args) != 2:
print parser.print_help()
parser.error('incorrect number of arguments')
xu_xml_name = args[0]
doc_xml_name = args[1]
print etree.tostring(applyXUpdate(xml_xu_filename=xu_xml_name,
xml_doc_filename=doc_xml_name),
pretty_print=True)
\ No newline at end of file
pretty_print=True)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment