Skip to content

Commit eabcd4c

Browse files
Add args to main (#252)
1 parent 57edfce commit eabcd4c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pybind11_stubgen/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import logging
55
import re
66
from argparse import ArgumentParser, Namespace
7+
from collections.abc import Sequence
78
from pathlib import Path
89

910
from pybind11_stubgen.parser.interface import IParser
@@ -300,12 +301,12 @@ class Parser(
300301
return parser
301302

302303

303-
def main():
304+
def main(argv: Sequence[str] | None = None) -> None:
304305
logging.basicConfig(
305306
level=logging.INFO,
306307
format="%(name)s - [%(levelname)7s] %(message)s",
307308
)
308-
args = arg_parser().parse_args(namespace=CLIArgs())
309+
args = arg_parser().parse_args(argv, namespace=CLIArgs())
309310

310311
parser = stub_parser_from_args(args)
311312
printer = Printer(invalid_expr_as_ellipses=not args.print_invalid_expressions_as_is)

0 commit comments

Comments
 (0)