NSH: Improve an error message

This commit is contained in:
Gregory Nutt 2016-02-08 16:29:54 -06:00
parent 3df8b716dc
commit b54aa2b081
2 changed files with 11 additions and 3 deletions

View File

@ -314,7 +314,7 @@ o arp [-a <ipaddr>|-d <ipaddr>|-s <ipaddr> <hwaddr>]
Example:
nsh> arp -a 10.0.0.1
nsh: arp: ioctl failed: 22
nsh: arp: no such ARP entry: 10.0.0.1
nsh> arp -s 10.0.0.1 00:13:3b:12:73:e6
nsh> arp -a 10.0.0.1
@ -322,7 +322,7 @@ o arp [-a <ipaddr>|-d <ipaddr>|-s <ipaddr> <hwaddr>]
nsh> arp -d 10.0.0.1
nsh> arp -a 10.0.0.1
nsh: arp: ioctl failed: 22
nsh: arp: no such ARP entry: 10.0.0.1
o base64dec [-w] [-f] <string or filepath>

View File

@ -1254,7 +1254,15 @@ int cmd_arp(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
/* Error exits */
errout_cmdfaild:
nsh_output(vtbl, g_fmtcmdfailed, argv[0], "ioctl", NSH_ERRNO);
if (ret == -ENOENT)
{
nsh_output(vtbl, g_fmtnosuch, argv[0], "ARP entry", argv[2]);
}
else
{
nsh_output(vtbl, g_fmtcmdfailed, argv[0], "ioctl", NSH_ERRNO);
}
return ERROR;
errout_missing: