Skip to content

Commit 6803ed7

Browse files
Add libraries list option to split.py
Overrides the default list of libraries to split.
1 parent 2a46c1f commit 6803ed7

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

split.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
)
1111

1212

13-
1413
def walk_dir(file_name, directory):
1514
for root, subdirs, files in os.walk(directory):
1615
if file_name in files:
@@ -96,12 +95,19 @@ def main():
9695
args_parser.add_argument(
9796
"-o", "--out", help="where to write the files (default: out)", default="out"
9897
)
98+
args_parser.add_argument(
99+
"-l",
100+
"--library",
101+
action="append",
102+
dest="libraries",
103+
help="the libraries to split (default: [httplib])",
104+
)
99105
args = args_parser.parse_args()
100106

107+
default_libraries = ["httplib"]
101108
search_dirs = ["example"]
102-
lib_names = ["httplib"]
103109

104-
for lib_name in lib_names:
110+
for lib_name in args.libraries or default_libraries:
105111
split(lib_name, search_dirs, args.extension, args.out)
106112

107113

0 commit comments

Comments
 (0)