Fix incorrect argument count error message
The `too many arguments` and `missing required argument(s)` messages should be switched in order for the correct message to be shown to the user.
This commit is contained in:
parent
d1bcd2977c
commit
41ce7d40f6
@ -308,7 +308,7 @@ static int cmd_codecs_proc(FAR struct nsh_vtbl_s *vtbl, int argc,
|
|||||||
{
|
{
|
||||||
sdata = argv[optind];
|
sdata = argv[optind];
|
||||||
}
|
}
|
||||||
else if (optind >= argc)
|
else if (optind < argc)
|
||||||
{
|
{
|
||||||
fmt = g_fmttoomanyargs;
|
fmt = g_fmttoomanyargs;
|
||||||
goto errout;
|
goto errout;
|
||||||
|
@ -1307,7 +1307,7 @@ int cmd_mkfatfs(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
|||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (optind >= argc)
|
else if (optind < argc)
|
||||||
{
|
{
|
||||||
nsh_error(vtbl, g_fmttoomanyargs, argv[0]);
|
nsh_error(vtbl, g_fmttoomanyargs, argv[0]);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
@ -1426,7 +1426,7 @@ int cmd_mkrd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
|||||||
{
|
{
|
||||||
nsectors = (uint32_t)atoi(argv[optind]);
|
nsectors = (uint32_t)atoi(argv[optind]);
|
||||||
}
|
}
|
||||||
else if (optind >= argc)
|
else if (optind < argc)
|
||||||
{
|
{
|
||||||
fmt = g_fmttoomanyargs;
|
fmt = g_fmttoomanyargs;
|
||||||
goto errout_with_fmt;
|
goto errout_with_fmt;
|
||||||
|
@ -1306,7 +1306,7 @@ int cmd_wget(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
|||||||
{
|
{
|
||||||
url = argv[optind];
|
url = argv[optind];
|
||||||
}
|
}
|
||||||
else if (optind >= argc)
|
else if (optind < argc)
|
||||||
{
|
{
|
||||||
fmt = g_fmttoomanyargs;
|
fmt = g_fmttoomanyargs;
|
||||||
goto errout;
|
goto errout;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user