From d32e3d878d38f1d661180b74d7eb27658167d842 Mon Sep 17 00:00:00 2001 From: Brian Daniels Date: Thu, 5 Jan 2017 13:54:04 -0600 Subject: [PATCH] Remove default -m and -i options for project.py Also moves the check for -m and -i before any file system actions are taken (error faster) --- tools/project.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/tools/project.py b/tools/project.py index 9e10cb4b26..b2ae09302c 100644 --- a/tools/project.py +++ b/tools/project.py @@ -106,14 +106,12 @@ def main(): parser.add_argument("-m", "--mcu", metavar="MCU", - default='LPC1768', type=argparse_force_uppercase_type(targetnames, "MCU"), help="generate project for the given MCU ({})".format( ', '.join(targetnames))) parser.add_argument("-i", dest="ide", - default='uvision', type=argparse_force_lowercase_type( toolchainlist, "toolchain"), help="The target IDE: %s"% str(toolchainlist)) @@ -215,14 +213,6 @@ def main(): cache = Cache(True, True) cache.cache_descriptors() - # Clean Export Directory - if options.clean: - if exists(EXPORT_DIR): - rmtree(EXPORT_DIR) - - for mcu in options.mcu: - zip_proj = not bool(options.source_dir) - # Target if not options.mcu: args_error(parser, "argument -m/--mcu is required") @@ -231,6 +221,14 @@ def main(): if not options.ide: args_error(parser, "argument -i is required") + # Clean Export Directory + if options.clean: + if exists(EXPORT_DIR): + rmtree(EXPORT_DIR) + + for mcu in options.mcu: + zip_proj = not bool(options.source_dir) + if (options.program is None) and (not options.source_dir): args_error(parser, "one of -p, -n, or --source is required") # Export to selected toolchain