Skip to content

Remove unused arguments from detect targets #3439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 21, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions tools/detect_targets.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"""
import sys
import os
import re

ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
sys.path.insert(0, ROOT)
Expand All @@ -30,13 +31,14 @@
# Imports related to mbed build api
from tools.build_api import mcu_toolchain_matrix
from tools.test_api import get_autodetected_MUTS_list
from argparse import ArgumentParser


def main():
"""Entry Point"""
try:
# Parse Options
parser = get_default_options_parser()
parser = ArgumentParser()

parser.add_argument("-S", "--supported-toolchains",
action="store_true",
Expand Down Expand Up @@ -68,14 +70,17 @@ def main():
# parameters like 'toolchains_filter' are also set.
muts = get_autodetected_MUTS_list()

mcu_filter = options.general_filter_regex or ".*"

count = 0
for mut in muts.values():
print ""
print "[mbed] Detected %s, port %s, mounted %s" % \
(mut['mcu'], mut['port'], mut['disk'])
print "[mbed] Supported toolchains for %s" % mut['mcu']
print mcu_toolchain_matrix(platform_filter=r'^'+mut['mcu']+'$')
count += 1
if re.match(mcu_filter, mut['mcu']):
print ""
print "[mbed] Detected %s, port %s, mounted %s" % \
(mut['mcu'], mut['port'], mut['disk'])
print "[mbed] Supported toolchains for %s" % mut['mcu']
print mcu_toolchain_matrix(platform_filter=mut['mcu'])
count += 1

if count == 0:
print "[mbed] No mbed targets where detected on your system."
Expand Down