Skip to content

Commit e2e218f

Browse files
committed
[build_script.py] Remove redundant argparse params
- For options `like-this`, `argparse` stores the variable name `like_this`. Remove redundant `dest` parameters in the build script. - For options marked as "store", `argparse` stores `None` when the option is not specified. Remove redudnant `default=None` parameters in the build script. - For options marked as "store_true", the default value is `False`. Remove redundant `default=True` parameters in the build script. - The default action for options is "store". Remove redundant `action="store"` parameters in the build script.
1 parent 3d09338 commit e2e218f

File tree

1 file changed

+6
-21
lines changed

1 file changed

+6
-21
lines changed

build_script.py

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,36 +29,23 @@ def main():
2929
parser.add_argument("--swiftc",
3030
help="path to the swift compiler",
3131
metavar="PATH",
32-
action="store",
33-
dest="swiftc",
34-
required=True,
35-
default=None)
32+
required=True)
3633
parser.add_argument("--build-dir",
3734
help="path to the output build directory",
3835
metavar="PATH",
39-
action="store",
40-
dest="build_dir",
41-
required=True,
42-
default=None)
36+
required=True)
4337
parser.add_argument("--swift-build-dir",
4438
help="path to the swift build directory",
4539
metavar="PATH",
46-
action="store",
47-
dest="swift_build_dir",
48-
required=True,
49-
default=None)
40+
required=True)
5041
parser.add_argument("--module-install-path",
5142
help="location to install module files",
5243
metavar="PATH",
53-
action="store",
54-
dest="module_path",
55-
default=None)
44+
dest="module_path")
5645
parser.add_argument("--library-install-path",
5746
help="location to install shared library files",
5847
metavar="PATH",
59-
action="store",
60-
dest="lib_path",
61-
default=None)
48+
dest="lib_path")
6249
parser.add_argument("--release",
6350
help="builds for release",
6451
action="store_const",
@@ -78,9 +65,7 @@ def main():
7865
"at {} in order to run this command. ".format(
7966
os.path.join(
8067
os.path.dirname(SOURCE_DIR), 'llvm')),
81-
action="store_true",
82-
dest="test",
83-
default=False)
68+
action="store_true")
8469
args = parser.parse_args()
8570

8671
swiftc = os.path.abspath(args.swiftc)

0 commit comments

Comments
 (0)