blsuki: Error out if unexpected arguments are supplied
This can be especially helpful, as the Fedora version of the blscfg actually made use of positional arguments, but current implementation switched to parameters. For example what used to be "blscfg (hd0,gpt2)/..." now should be "blscfg --path (hd0,gpt2)/...)". In case of old configs/scripts still supplying positional arguments we will now error out instead of just ignoring them and falling back to defaults silently. Signed-off-by: Radoslav Kolev <radoslav.kolev@suse.com> Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
parent
cfeff5e071
commit
25b7f6b934
@ -1458,9 +1458,11 @@ blsuki_cmd (grub_extcmd_context_t ctxt, enum blsuki_cmd_type cmd_type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static grub_err_t
|
static grub_err_t
|
||||||
grub_cmd_blscfg (grub_extcmd_context_t ctxt, int argc __attribute__ ((unused)),
|
grub_cmd_blscfg (grub_extcmd_context_t ctxt, int argc,
|
||||||
char **args __attribute__ ((unused)))
|
char **args __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
|
if (argc != 0)
|
||||||
|
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("unexpected argument(s) found, see --help"));
|
||||||
return blsuki_cmd (ctxt, BLSUKI_BLS_CMD);
|
return blsuki_cmd (ctxt, BLSUKI_BLS_CMD);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1468,9 +1470,11 @@ static grub_extcmd_t bls_cmd;
|
|||||||
|
|
||||||
#ifdef GRUB_MACHINE_EFI
|
#ifdef GRUB_MACHINE_EFI
|
||||||
static grub_err_t
|
static grub_err_t
|
||||||
grub_cmd_uki (grub_extcmd_context_t ctxt, int argc __attribute__ ((unused)),
|
grub_cmd_uki (grub_extcmd_context_t ctxt, int argc,
|
||||||
char **args __attribute__ ((unused)))
|
char **args __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
|
if (argc != 0)
|
||||||
|
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("unexpected argument(s) found, see --help"));
|
||||||
return blsuki_cmd (ctxt, BLSUKI_UKI_CMD);
|
return blsuki_cmd (ctxt, BLSUKI_UKI_CMD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user