mirror of https://github.com/ARMmbed/mbed-os.git
Revise arguments to detect targets
parent
c8c01f0c5c
commit
23461ee399
|
@ -17,6 +17,7 @@ limitations under the License.
|
||||||
"""
|
"""
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
|
|
||||||
ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
|
||||||
sys.path.insert(0, ROOT)
|
sys.path.insert(0, ROOT)
|
||||||
|
@ -30,13 +31,14 @@ check_required_modules(['prettytable'])
|
||||||
# Imports related to mbed build api
|
# Imports related to mbed build api
|
||||||
from tools.build_api import mcu_toolchain_matrix
|
from tools.build_api import mcu_toolchain_matrix
|
||||||
from tools.test_api import get_autodetected_MUTS_list
|
from tools.test_api import get_autodetected_MUTS_list
|
||||||
|
from argparse import ArgumentParser
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Entry Point"""
|
"""Entry Point"""
|
||||||
try:
|
try:
|
||||||
# Parse Options
|
# Parse Options
|
||||||
parser = get_default_options_parser()
|
parser = ArgumentParser()
|
||||||
|
|
||||||
parser.add_argument("-S", "--supported-toolchains",
|
parser.add_argument("-S", "--supported-toolchains",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
|
@ -68,14 +70,17 @@ def main():
|
||||||
# parameters like 'toolchains_filter' are also set.
|
# parameters like 'toolchains_filter' are also set.
|
||||||
muts = get_autodetected_MUTS_list()
|
muts = get_autodetected_MUTS_list()
|
||||||
|
|
||||||
|
mcu_filter = options.general_filter_regex or ".*"
|
||||||
|
|
||||||
count = 0
|
count = 0
|
||||||
for mut in muts.values():
|
for mut in muts.values():
|
||||||
print ""
|
if re.match(mcu_filter, mut['mcu']):
|
||||||
print "[mbed] Detected %s, port %s, mounted %s" % \
|
print ""
|
||||||
(mut['mcu'], mut['port'], mut['disk'])
|
print "[mbed] Detected %s, port %s, mounted %s" % \
|
||||||
print "[mbed] Supported toolchains for %s" % mut['mcu']
|
(mut['mcu'], mut['port'], mut['disk'])
|
||||||
print mcu_toolchain_matrix(platform_filter=r'^'+mut['mcu']+'$')
|
print "[mbed] Supported toolchains for %s" % mut['mcu']
|
||||||
count += 1
|
print mcu_toolchain_matrix(platform_filter=mut['mcu'])
|
||||||
|
count += 1
|
||||||
|
|
||||||
if count == 0:
|
if count == 0:
|
||||||
print "[mbed] No mbed targets where detected on your system."
|
print "[mbed] No mbed targets where detected on your system."
|
||||||
|
|
Loading…
Reference in New Issue