1
0
Fork 1
mirror of https://gitlab.postmarketos.org/postmarketOS/pmbootstrap.git synced 2025-07-13 11:29:46 +03:00

pmb.parse.arguments: Type hint and remove unused arguments from add_kernel_arg() (MR 2514)

Presumably, args and kwargs are just here to retain compatibility with
add_argument() from argparse.ArgumentParser, but they aren't actually
used and consequently only give the illusion of compatibility. Just
remove them to simplify the function signature.
This commit is contained in:
Newbyte 2024-12-20 15:35:56 +01:00
parent 7bca381dea
commit 3ee75e61a5
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB

View file

@ -820,7 +820,9 @@ def add_packages_arg(subparser, name="packages", *args, **kwargs):
arg.completer = package_completer # type: ignore[attr-defined]
def add_kernel_arg(subparser, name="package", nargs="?", *args, **kwargs):
def add_kernel_arg(
subparser: argparse.ArgumentParser, name: str = "package", nargs: int | str = "?"
) -> None:
arg = subparser.add_argument(
name, nargs=nargs, help="kernel package (e.g. linux-postmarketos-allwinner)"
)