Skip to content

Commit e3777d3

Browse files
authored
Merge pull request #186 from geky/compile-clean-help
Added help documentation for -c/--clean for mbed compile
2 parents 0320712 + b0bc799 commit e3777d3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mbed/mbed.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1708,13 +1708,14 @@ def status_(ignore=False):
17081708
@subcommand('compile',
17091709
dict(name=['-t', '--toolchain'], help='Compile toolchain. Example: ARM, uARM, GCC_ARM, IAR'),
17101710
dict(name=['-m', '--mcu'], help='Compile target. Example: K64F, NUCLEO_F401RE, NRF51822...'),
1711+
dict(name=['-c', '--clean'], action='store_true', help='Clean the build directory before compiling'),
17111712
dict(name='--source', action='append', help='Source directory. Default: . (current dir)'),
17121713
dict(name='--build', help='Build directory. Default: .build/'),
17131714
dict(name='--library', dest='compile_library', action='store_true', help='Compile the current %s as a static library.' % cwd_type),
17141715
dict(name='--tests', dest='compile_tests', action='store_true', help='Compile tests in TESTS directory.'),
17151716
dict(name='--test_spec', dest="test_spec", help="Destination path for a test spec file that can be used by the Greentea automated test tool. (Default is 'test_spec.json')"),
17161717
help='Compile program using the native mbed OS build system.')
1717-
def compile(toolchain=None, mcu=None, source=False, build=False, compile_library=False, compile_tests=False, test_spec="test_spec.json"):
1718+
def compile(toolchain=None, mcu=None, clean=False, source=False, build=False, compile_library=False, compile_tests=False, test_spec="test_spec.json"):
17181719
args = remainder
17191720
# Gather remaining arguments
17201721
args = remainder
@@ -1743,6 +1744,7 @@ def compile(toolchain=None, mcu=None, source=False, build=False, compile_library
17431744
popen(['python', '-u', os.path.join(tools_dir, 'test.py')]
17441745
+ list(chain.from_iterable(izip(repeat('-D'), macros)))
17451746
+ ['-t', tchain, '-m', target]
1747+
+ (['-c'] if clean else [])
17461748
+ list(chain.from_iterable(izip(repeat('--source'), source)))
17471749
+ ['--build', build]
17481750
+ ['--test-spec', test_spec]

0 commit comments

Comments
 (0)