Skip to content

Commit 4c5bfaa

Browse files
committed
Allow --source with -n and -p, or alone; name projects conditionally
1 parent 5f18943 commit 4c5bfaa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/project.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
default=False,
4949
help="clean the export directory")
5050

51-
group = parser.add_mutually_exclusive_group(required=True)
51+
group = parser.add_mutually_exclusive_group(required=False)
5252
group.add_argument("-p",
5353
type=test_known,
5454
dest="program",
@@ -83,7 +83,7 @@
8383
default=False,
8484
help="writes tools/export/README.md")
8585

86-
group.add_argument("--source",
86+
parser.add_argument("--source",
8787
nargs="*",
8888
type=argparse_filestring_type,
8989
dest="source_dir",
@@ -144,7 +144,7 @@
144144
if src:
145145
# --source is used to generate IDE files to toolchain directly in the source tree and doesn't generate zip file
146146
project_dir = options.source_dir
147-
project_name = TESTS[p]
147+
project_name = TESTS[p] if p else "Unnamed_project"
148148
project_temp = path.join(options.source_dir[0], 'projectfiles', '%s_%s' % (ide, mcu))
149149
mkdir(project_temp)
150150
lib_symbols = []

0 commit comments

Comments
 (0)