Skip to content

Commit 7e5deaa

Browse files
committed
standardize on nargs="*"
1 parent 3276854 commit 7e5deaa

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
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", action="append")
47+
default=None, help="The source (input) directory", nargs="*")
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-
action="append",
110+
nargs="*",
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", action="append")
42-
parser.add_argument("--prefix", dest="prefix", action="append",
41+
default=[], help="The source (input) directory", nargs="*")
42+
parser.add_argument("--prefix", dest="prefix", nargs="*",
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
help="Silent diagnostic output (no copy, compile notification)")
8080

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

@@ -106,7 +106,7 @@
106106
parser.add_argument("--dep", dest="dependencies",
107107
default=None, help="Dependencies")
108108
group.add_argument("--source", dest="source_dir", type=argparse_filestring_type,
109-
default=None, help="The source (input) directory", action="append")
109+
default=None, help="The source (input) directory", nargs="*")
110110
parser.add_argument("--duration", type=int, dest="duration",
111111
default=None, help="Duration of the test")
112112
parser.add_argument("--build", dest="build_dir",

tools/options.py

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

4545
if add_options:
46-
parser.add_argument("-o", "--options", action="append",
46+
parser.add_argument("-o", "--options", nargs="*",
4747
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")',
4848
type=argparse_lowercase_hyphen_type(['save-asm', 'debug-info', 'analyze'], "build option"))
4949

tools/project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
help="The source (input) directory")
9191

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

tools/test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@
4040
parser = get_default_options_parser()
4141

4242
parser.add_argument("-D",
43-
action="append",
43+
nargs="*",
4444
dest="macros",
4545
help="Add a macro definition")
46-
46+
4747
parser.add_argument("-j", "--jobs",
4848
type=int,
4949
dest="jobs",
@@ -52,7 +52,7 @@
5252

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

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

0 commit comments

Comments
 (0)