You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
help='Sets default toolchain for the current program.')
1790
1781
deftoolchain_(name=None):
1782
+
returndefault_('toolchain', name)
1783
+
1784
+
# Generic config command
1785
+
@subcommand('default',
1786
+
dict(name='name', help='Variable name. E.g. "target", "toolchain", "protocol"'),
1787
+
dict(name='value', nargs='?', help='Value. Will show the currently set default value for a variable if not specified.'),
1788
+
help='Sets or get program default options.')
1789
+
defdefault_(name, value=None):
1791
1790
# Find the root of the program
1792
1791
program=Program(os.getcwd(), False)
1793
-
# Change directories to the program root to use mbed OS tools
1792
+
# Change current dir to program root
1794
1793
withcd(program.path):
1795
-
ifnameisNone:
1796
-
name=program.get_cfg('TOOLCHAIN')
1797
-
action(('The default toolchain for program "%s" is "%s"'% (program.name, name)) ifnameelse'No default toolchain is specified for program "%s"'%program.name)
1794
+
var=str(name).upper()
1795
+
ifvalueisNone:
1796
+
value=program.get_cfg(var)
1797
+
action(('%s'%value) ifvalueelse'No default %s set in program "%s"'% (name, program.name))
1798
1798
else:
1799
-
program.set_cfg('TOOLCHAIN', name)
1800
-
action('"%s" now set as default toolchain for program "%s"'% (name, program.name))
1801
-
1799
+
program.set_cfg(var, value)
1800
+
action('%s now set as default %s in program "%s"'% (value, name, program.name))
0 commit comments