mirror of https://github.com/ARMmbed/mbed-os.git
[PROJECT.py] sorts targets and toolchains for help option
Sorts targets and toolchains for help option and adds new option -L to generate the list with possible projects to generate.pull/563/head
parent
ecf04d3782
commit
718366ba10
|
@ -18,20 +18,34 @@ if __name__ == '__main__':
|
||||||
# Parse Options
|
# Parse Options
|
||||||
parser = OptionParser()
|
parser = OptionParser()
|
||||||
|
|
||||||
|
targetnames = TARGET_NAMES
|
||||||
|
targetnames.sort()
|
||||||
|
toolchainlist = EXPORTERS.keys()
|
||||||
|
toolchainlist.sort()
|
||||||
|
|
||||||
parser.add_option("-m", "--mcu", metavar="MCU", default='LPC1768',
|
parser.add_option("-m", "--mcu", metavar="MCU", default='LPC1768',
|
||||||
help="generate project for the given MCU (%s)" % ', '.join(TARGET_NAMES))
|
help="generate project for the given MCU (%s)" % ', '.join(targetnames))
|
||||||
|
|
||||||
parser.add_option("-p", type="int", dest="program",
|
parser.add_option("-p", type="int", dest="program",
|
||||||
help="The index of the desired test program: [0-%d]" % (len(TESTS)-1))
|
help="The index of the desired test program: [0-%d]" % (len(TESTS)-1))
|
||||||
|
|
||||||
parser.add_option("-i", dest="ide", default='uvision',
|
parser.add_option("-i", dest="ide", default='uvision',
|
||||||
help="The target IDE: %s" % str(EXPORTERS.keys()))
|
help="The target IDE: %s" % str(toolchainlist))
|
||||||
|
|
||||||
parser.add_option("-b", dest="build", action="store_true", default=False,
|
parser.add_option("-b", dest="build", action="store_true", default=False,
|
||||||
help="Use the mbed library build, instead of the sources")
|
help="Use the mbed library build, instead of the sources")
|
||||||
|
|
||||||
|
parser.add_option("-L", "--list-tests", action="store_true", dest="list_tests",
|
||||||
|
default=False, help="List available tests in order and exit")
|
||||||
|
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
# Print available tests in order and exit
|
||||||
|
if options.list_tests is True:
|
||||||
|
print '\n'.join(map(str, sorted(TEST_MAP.values())))
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
# Target
|
# Target
|
||||||
if options.mcu is None :
|
if options.mcu is None :
|
||||||
args_error(parser, "[ERROR] You should specify an MCU")
|
args_error(parser, "[ERROR] You should specify an MCU")
|
||||||
|
|
Loading…
Reference in New Issue