pmbootstrap kconfig edit|migrate: should need exactly 1 argument
Right now it is possible to run pmbootstrap kconfig edit
and pmbootstrap will crash later on. It should stop with saying that exactly 1 argument is required.
The fix is probably something like the following, though it creates a list of kernels instead of one kernel string. So related code needs to be adjusted too. I've also tried required=True, but that didn't really make it a required argument (I guess because it is a positional argument?).
diff --git a/pmb/parse/arguments.py b/pmb/parse/arguments.py
index c1c6c15b..a6acf20f 100644
--- a/pmb/parse/arguments.py
+++ b/pmb/parse/arguments.py
@@ -683,7 +683,7 @@ def arguments_kconfig(subparser):
action="store_true",
help="use nconfig rather than menuconfig for kernel" " configuration",
)
- add_kernel_arg(edit)
+ add_kernel_arg(edit, nargs=1)
# "pmbootstrap kconfig migrate"
migrate = sub.add_parser(
@@ -696,7 +696,7 @@ def arguments_kconfig(subparser):
migrate.add_argument(
"--arch", choices=arch_choices, dest="arch", type=lambda x: Arch.from_str(x)
)
- add_kernel_arg(migrate)
+ add_kernel_arg(migrate, nargs=1)
def arguments_repo_bootstrap(subparser):
Edited by Administrator