Skip to content

Commit efa48f2

Browse files
committed
Add -N/--artifact-name option to compile to match tools/build.py and tools/test.py options #229
1 parent a77f91b commit efa48f2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mbed/mbed.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1907,10 +1907,11 @@ def status_(ignore=False):
19071907
dict(name='--source', action='append', help='Source directory. Default: . (current dir)'),
19081908
dict(name='--build', help='Build directory. Default: .build/'),
19091909
dict(name=['-c', '--clean'], action='store_true', help='Clean the build directory before compiling'),
1910+
dict(name=['-N', '--artifact-name'], help='Name of the built program or library'),
19101911
dict(name=['-S', '--supported'], dest='supported', action='store_true', help='Shows supported matrix of targets and toolchains'),
19111912
help='Compile code using the mbed build tools',
19121913
description=("Compile this program using the mbed build tools."))
1913-
def compile_(toolchain=None, mcu=None, source=False, build=False, compile_library=False, compile_config=False, config_prefix=None, clean=False, supported=False):
1914+
def compile_(toolchain=None, mcu=None, source=False, build=False, compile_library=False, compile_config=False, config_prefix=None, clean=False, artifact_name=None, supported=False):
19141915
# Gather remaining arguments
19151916
args = remainder
19161917
# Find the root of the program
@@ -1957,6 +1958,7 @@ def compile_(toolchain=None, mcu=None, source=False, build=False, compile_librar
19571958
+ (['-c'] if clean else [])
19581959
+ list(chain.from_iterable(izip(repeat('--source'), source)))
19591960
+ ['--build', build]
1961+
+ (['--artifact-name', artifact_name] if artifact_name else [])
19601962
+ (['-v'] if verbose else [])
19611963
+ args,
19621964
env=env)
@@ -1971,6 +1973,7 @@ def compile_(toolchain=None, mcu=None, source=False, build=False, compile_librar
19711973
+ (['-c'] if clean else [])
19721974
+ list(chain.from_iterable(izip(repeat('--source'), source)))
19731975
+ ['--build', build]
1976+
+ (['--artifact-name', artifact_name] if artifact_name else [])
19741977
+ (['-v'] if verbose else [])
19751978
+ args,
19761979
env=env)

0 commit comments

Comments
 (0)