diff python/zcc.py @ 296:9417caea2eb3

Directorized some backend files
author Windel Bouwman
date Sun, 01 Dec 2013 13:36:58 +0100
parents 6aa721e7b10b
children 158068af716c
line wrap: on
line diff
--- a/python/zcc.py	Thu Nov 28 21:10:32 2013 +0100
+++ b/python/zcc.py	Sun Dec 01 13:36:58 2013 +0100
@@ -32,7 +32,7 @@
 parser.add_argument('source', type=argparse.FileType('r'), \
   help='the source file to build', nargs="+")
 parser.add_argument('-i', '--imp', type=argparse.FileType('r'), \
-  help='Possible import module', action='append')
+  help='Possible import module', action='append', default=[])
 
 parser.add_argument('--dumpir', action='store_true', help="Dump IR-code")
 parser.add_argument('--dumpasm', action='store_true', help="Dump ASM-code")
@@ -80,15 +80,11 @@
 
 def main(args):
     logging.basicConfig(format=logformat, level=args.log)
-    src = args.source
-    imps = args.imp
-    if not imps:
-        imps = []
     tg = targets[args.target]
     diag = ppci.DiagnosticsManager()
     outs = outstream.TextOutputStream()
 
-    res = zcc(src, imps, tg, outs, diag, dumpir=args.dumpir)
+    res = zcc(args.source, args.imp, tg, outs, diag, dumpir=args.dumpir)
     if not res:
         diag.printErrors()
         return 1