2010-10-17 23:50:55 +04:00
|
|
|
|
|
|
|
|
|
int cmd_help(char cmd[])
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
int i;
|
|
|
|
|
|
2010-10-21 03:58:36 +04:00
|
|
|
|
#if LANG_ENG
|
|
|
|
|
char available[]={" %d commands available:\n\r"};
|
|
|
|
|
#elif LANG_RUS
|
2011-01-30 14:52:46 +03:00
|
|
|
|
char available[]={" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢮ <20><><EFBFBD><EFBFBD>㯭<EFBFBD><E3AFAD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: %d\n\r"};
|
2010-10-21 03:58:36 +04:00
|
|
|
|
#endif
|
2010-10-17 23:50:55 +04:00
|
|
|
|
|
|
|
|
|
if ( !strlen(cmd) )
|
|
|
|
|
{
|
|
|
|
|
printf (available, NUM_OF_CMD);
|
|
|
|
|
for (i = 0; i < NUM_OF_CMD; i++)
|
|
|
|
|
printf(" %s\n\r", COMMANDS[i].name);
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
for (i=0; i<NUM_OF_CMD; i++)
|
|
|
|
|
if ( !strcmp(cmd, COMMANDS[i].name) )
|
|
|
|
|
{
|
|
|
|
|
printf(COMMANDS[i].help);
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
2010-10-21 03:58:36 +04:00
|
|
|
|
#if LANG_ENG
|
|
|
|
|
printf (" Command \'%s\' not found.\n\r", cmd);
|
|
|
|
|
#elif LANG_RUS
|
|
|
|
|
printf (" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \'%s\' <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.\n\r", cmd);
|
|
|
|
|
#endif
|
2010-10-17 23:50:55 +04:00
|
|
|
|
printf (available, NUM_OF_CMD);
|
|
|
|
|
for (i = 0; i < NUM_OF_CMD; i++)
|
|
|
|
|
printf(" %s\n\r", COMMANDS[i].name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
2013-02-17 19:22:51 +04:00
|
|
|
|
|