Skip to content

Commit

Permalink
nargs="*" -> action="append"
Browse files Browse the repository at this point in the history
  • Loading branch information
theotherjimmy committed Jul 7, 2016
1 parent bca1220 commit 7a4bee8
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions tools/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
parser = get_default_options_parser()

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

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

parser.add_argument("-D",
nargs="*",
action="append",
dest="macros",
help="Add a macro definition")

Expand Down
4 changes: 2 additions & 2 deletions tools/get_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
# Parse Options
parser = get_default_options_parser(add_clean=False, add_options=False)
parser.add_argument("--source", dest="source_dir", type=argparse_filestring_type,
default=[], help="The source (input) directory", nargs="*")
parser.add_argument("--prefix", dest="prefix", nargs="*",
default=[], help="The source (input) directory", action="append")
parser.add_argument("--prefix", dest="prefix", action="append",
default=[], help="Restrict listing to parameters that have this prefix")
parser.add_argument("-v", "--verbose", action="store_true", dest="verbose",
default=False, help="Verbose diagnostic output")
Expand Down
2 changes: 1 addition & 1 deletion tools/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
help="Silent diagnostic output (no copy, compile notification)")

parser.add_argument("-D",
nargs="*",
action="append",
dest="macros",
help="Add a macro definition")

Expand Down
2 changes: 1 addition & 1 deletion tools/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def get_default_options_parser(add_clean=True, add_options=True):
help="clean the build directory")

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

Expand Down
4 changes: 2 additions & 2 deletions tools/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@
help="writes tools/export/README.md")

parser.add_argument("--source",
nargs="*",
action="append",
type=argparse_filestring_type,
dest="source_dir",
default=[],
help="The source (input) directory")

parser.add_argument("-D",
nargs="*",
action="append",
dest="macros",
help="Add a macro definition")

Expand Down
4 changes: 2 additions & 2 deletions tools/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
parser = get_default_options_parser()

parser.add_argument("-D",
nargs="*",
action="append",
dest="macros",
help="Add a macro definition")

Expand All @@ -53,7 +53,7 @@

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

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

0 comments on commit 7a4bee8

Please sign in to comment.