File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -52,20 +52,33 @@ def target_cross_toolchain(allowed_toolchains,
52
52
yield target , toolchain
53
53
54
54
55
-
56
55
def main ():
57
56
"""Entry point"""
58
57
parser = ArgumentParser ()
59
- parser .add_argument (
58
+ subparsers = parser .add_subparsers ()
59
+ import_cmd = subparsers .add_parser ("import" )
60
+ import_cmd .set_defaults (fn = do_import )
61
+ compile_cmd = subparsers .add_parser ("compile" )
62
+ compile_cmd .set_defaults (fn = do_compile )
63
+ compile_cmd .add_argument (
60
64
"toolchains" , nargs = "*" , default = SUPPORTED_TOOLCHAINS ,
61
65
type = argparse_force_uppercase_type (SUPPORTED_TOOLCHAINS ,
62
66
"toolchain" ))
63
67
args = parser .parse_args ()
68
+ args .fn (args )
69
+
70
+
71
+ def do_import (_ ):
72
+ """Do the import step of this process"""
73
+ for example , _ in EXAMPLES .iteritems ():
74
+ subprocess .call (["mbed-cli" , "import" , example ])
75
+
64
76
77
+ def do_compile (args ):
78
+ """Do the compile step"""
65
79
failures = []
66
80
sucesses = []
67
81
for example , requirements in EXAMPLES .iteritems ():
68
- subprocess .call (["mbed-cli" , "import" , example ])
69
82
os .chdir (basename (example ))
70
83
for target , toolchain in target_cross_toolchain (args .toolchains ,
71
84
** requirements ):
You can’t perform that action at this time.
0 commit comments