|
17 | 17 | """
|
18 | 18 | import sys
|
19 | 19 | import os
|
| 20 | +import re |
20 | 21 |
|
21 | 22 | ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
22 | 23 | sys.path.insert(0, ROOT)
|
|
30 | 31 | # Imports related to mbed build api
|
31 | 32 | from tools.build_api import mcu_toolchain_matrix
|
32 | 33 | from tools.test_api import get_autodetected_MUTS_list
|
| 34 | +from argparse import ArgumentParser |
33 | 35 |
|
34 | 36 |
|
35 | 37 | def main():
|
36 | 38 | """Entry Point"""
|
37 | 39 | try:
|
38 | 40 | # Parse Options
|
39 |
| - parser = get_default_options_parser() |
| 41 | + parser = ArgumentParser() |
40 | 42 |
|
41 | 43 | parser.add_argument("-S", "--supported-toolchains",
|
42 | 44 | action="store_true",
|
@@ -68,14 +70,17 @@ def main():
|
68 | 70 | # parameters like 'toolchains_filter' are also set.
|
69 | 71 | muts = get_autodetected_MUTS_list()
|
70 | 72 |
|
| 73 | + mcu_filter = options.general_filter_regex or ".*" |
| 74 | + |
71 | 75 | count = 0
|
72 | 76 | for mut in muts.values():
|
73 |
| - print "" |
74 |
| - print "[mbed] Detected %s, port %s, mounted %s" % \ |
75 |
| - (mut['mcu'], mut['port'], mut['disk']) |
76 |
| - print "[mbed] Supported toolchains for %s" % mut['mcu'] |
77 |
| - print mcu_toolchain_matrix(platform_filter=r'^'+mut['mcu']+'$') |
78 |
| - count += 1 |
| 77 | + if re.match(mcu_filter, mut['mcu']): |
| 78 | + print "" |
| 79 | + print "[mbed] Detected %s, port %s, mounted %s" % \ |
| 80 | + (mut['mcu'], mut['port'], mut['disk']) |
| 81 | + print "[mbed] Supported toolchains for %s" % mut['mcu'] |
| 82 | + print mcu_toolchain_matrix(platform_filter=mut['mcu']) |
| 83 | + count += 1 |
79 | 84 |
|
80 | 85 | if count == 0:
|
81 | 86 | print "[mbed] No mbed targets where detected on your system."
|
|
0 commit comments