wireless/wapi: Improve some output.

This commit is contained in:
Gregory Nutt 2017-04-12 07:09:37 -06:00
parent 65d59f8458
commit 58da85523d
2 changed files with 73 additions and 20 deletions

View file

@ -76,6 +76,8 @@ typedef void (*cmd3_t)(int sock, FAR const char *arg1,
static int wapi_str2int(FAR const char *str);
static double wapi_str2double(FAR const char *str);
static unsigned int wapi_str2ndx(FAR const char *name, FAR const char **list,
unsigned int listlen);
static void wapi_show_cmd(int sock, FAR const char *ifname);
static void wapi_ip_cmd(int sock, FAR const char *ifname,
@ -196,7 +198,13 @@ static unsigned int wapi_str2ndx(FAR const char *name, FAR const char **list,
}
}
WAPI_ERROR("ERROR: Invalid string: %s\n", name);
WAPI_ERROR("ERROR: Invalid option string: %s\n", name);
WAPI_ERROR(" Valid options include:\n");
for (ndx = 0; ndx < listlen; ndx++)
{
WAPI_ERROR(" - %s\n", list[ndx]);
}
exit(EXIT_FAILURE);
}