Clone of official tools

Revision:
13:ab47a20b66f0
Parent:
0:66f3b5499f7f
Child:
22:9e85236d8716
--- a/options.py	Tue Jun 14 11:33:06 2016 +0100
+++ b/options.py	Thu Jul 14 20:21:19 2016 +0100
@@ -19,7 +19,7 @@
 from tools.targets import TARGET_NAMES
 
 
-def get_default_options_parser():
+def get_default_options_parser(add_clean=True, add_options=True):
     parser = OptionParser()
 
     targetnames = TARGET_NAMES
@@ -35,10 +35,12 @@
                   help="build using the given TOOLCHAIN (%s)" % ', '.join(toolchainlist),
                   metavar="TOOLCHAIN")
 
-    parser.add_option("-c", "--clean", action="store_true", default=False,
-                  help="clean the build directory")
+    if add_clean:
+        parser.add_option("-c", "--clean", action="store_true", default=False,
+                      help="clean the build directory")
 
-    parser.add_option("-o", "--options", action="append",
-                  help='Add a build option ("save-asm": save the asm generated by the compiler, "debug-info": generate debugging information, "analyze": run Goanna static code analyzer")')
+    if add_options:
+        parser.add_option("-o", "--options", action="append",
+                      help='Add a build option ("save-asm": save the asm generated by the compiler, "debug-info": generate debugging information, "analyze": run Goanna static code analyzer")')
 
     return parser