Skip to content

Commit 7a4bee8

Browse files
committed
nargs="*" -> action="append"
1 parent bca1220 commit 7a4bee8

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

tools/build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
parser = get_default_options_parser()
4545

4646
parser.add_argument("--source", dest="source_dir", type=argparse_filestring_type,
47-
default=None, help="The source (input) directory", nargs="*")
47+
default=None, help="The source (input) directory", action="append")
4848

4949
parser.add_argument("--build", dest="build_dir", type=argparse_filestring_type,
5050
default=None, help="The build (output) directory")
@@ -107,7 +107,7 @@
107107
help="Compiles 'cpputest' unit test library (library should be on the same directory level as mbed repository)")
108108

109109
parser.add_argument("-D",
110-
nargs="*",
110+
action="append",
111111
dest="macros",
112112
help="Add a macro definition")
113113

tools/get_config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
# Parse Options
3939
parser = get_default_options_parser(add_clean=False, add_options=False)
4040
parser.add_argument("--source", dest="source_dir", type=argparse_filestring_type,
41-
default=[], help="The source (input) directory", nargs="*")
42-
parser.add_argument("--prefix", dest="prefix", nargs="*",
41+
default=[], help="The source (input) directory", action="append")
42+
parser.add_argument("--prefix", dest="prefix", action="append",
4343
default=[], help="Restrict listing to parameters that have this prefix")
4444
parser.add_argument("-v", "--verbose", action="store_true", dest="verbose",
4545
default=False, help="Verbose diagnostic output")

tools/make.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
help="Silent diagnostic output (no copy, compile notification)")
8181

8282
parser.add_argument("-D",
83-
nargs="*",
83+
action="append",
8484
dest="macros",
8585
help="Add a macro definition")
8686

tools/options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def get_default_options_parser(add_clean=True, add_options=True):
4242
help="clean the build directory")
4343

4444
if add_options:
45-
parser.add_argument("-o", "--options", nargs="*",
45+
parser.add_argument("-o", "--options", action="append",
4646
help='Add a build argument ("save-asm": save the asm generated by the compiler, "debug-info": generate debugging information, "analyze": run Goanna static code analyzer")',
4747
type=argparse_lowercase_hyphen_type(['save-asm', 'debug-info', 'analyze'], "build option"))
4848

tools/project.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@
8484
help="writes tools/export/README.md")
8585

8686
parser.add_argument("--source",
87-
nargs="*",
87+
action="append",
8888
type=argparse_filestring_type,
8989
dest="source_dir",
9090
default=[],
9191
help="The source (input) directory")
9292

9393
parser.add_argument("-D",
94-
nargs="*",
94+
action="append",
9595
dest="macros",
9696
help="Add a macro definition")
9797

tools/test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
parser = get_default_options_parser()
4242

4343
parser.add_argument("-D",
44-
nargs="*",
44+
action="append",
4545
dest="macros",
4646
help="Add a macro definition")
4747

@@ -53,7 +53,7 @@
5353

5454
parser.add_argument("--source", dest="source_dir",
5555
type=argparse_filestring_type,
56-
default=None, help="The source (input) directory (for sources other than tests). Defaults to current directory.", nargs="*")
56+
default=None, help="The source (input) directory (for sources other than tests). Defaults to current directory.", action="append")
5757

5858
parser.add_argument("--build", dest="build_dir",
5959
default=None, help="The build (output) directory")

0 commit comments

Comments
 (0)