Skip to content

Commit ff5f1d1

Browse files
authored
Simplify arg handling
1 parent a383371 commit ff5f1d1

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

openapi_generator_cli/__init__.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,9 @@ def run(args: list[str] | None = None) -> subprocess.CompletedProcess[bytes]:
5858

5959
def cli(argv: list[str] | None = None) -> None:
6060
"""Run the OpenAPI Generator CLI with the arguments provided on the command line."""
61-
argv = argv or sys.argv
62-
args = []
63-
if len(argv) > 1:
64-
args = argv[1:]
61+
args = (argv or sys.argv)[1:]
6562
sys.exit(run(args).returncode)
6663

6764

6865
if __name__ == "__main__":
69-
cli(sys.argv)
66+
cli()

0 commit comments

Comments
 (0)