kolibrios-fun/programs/system/shell/cmd_help.c
Kirill Lipatov (Leency) 939f824d96 Shell 0.4 from Albom
git-svn-id: svn://kolibrios.org@959 a494cfbc-eb01-0410-851d-a64ba20cac60
2008-12-14 11:55:46 +00:00

32 lines
561 B
C

int cmd_help(char cmd[])
{
int i;
char available[]={" %d commands available:\n\r"};
if (NULL == cmd)
{
printf (available, NUM_OF_CMD);
for (i = 0; i < NUM_OF_CMD; i++)
printf(" %s\n\r", HELP_COMMANDS[i]);
}
else
{
for (i=0; i<NUM_OF_CMD; i++)
if ( !strcmp(cmd, HELP_COMMANDS[i]) )
{
printf(HELP_DESC[i]);
return TRUE;
}
printf (" Command \'%s\' not found.\n\r", cmd);
printf (available, NUM_OF_CMD);
for (i = 0; i < NUM_OF_CMD; i++)
printf(" %s\n\r", HELP_COMMANDS[i]);
}
return FALSE;
}