nargs="*" -> action="append"

pull/2010/head
Jimmy Brisson 2016-06-29 17:13:38 -05:00
parent bca12206f1
commit 7a4bee8c0e
6 changed files with 10 additions and 10 deletions

View File

@ -44,7 +44,7 @@ if __name__ == '__main__':
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")
@ -107,7 +107,7 @@ if __name__ == '__main__':
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")

View File

@ -38,8 +38,8 @@ if __name__ == '__main__':
# 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")

View File

@ -80,7 +80,7 @@ if __name__ == '__main__':
help="Silent diagnostic output (no copy, compile notification)")
parser.add_argument("-D",
nargs="*",
action="append",
dest="macros",
help="Add a macro definition")

View File

@ -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"))

View File

@ -84,14 +84,14 @@ if __name__ == '__main__':
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")

View File

@ -41,7 +41,7 @@ if __name__ == '__main__':
parser = get_default_options_parser()
parser.add_argument("-D",
nargs="*",
action="append",
dest="macros",
help="Add a macro definition")
@ -53,7 +53,7 @@ if __name__ == '__main__':
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")