forked from KolibriOS/kolibrios
Shell 0.4 from Albom
git-svn-id: svn://kolibrios.org@959 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
31
programs/system/shell/cmd_help.c
Normal file
31
programs/system/shell/cmd_help.c
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
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;
|
||||
}
|
Reference in New Issue
Block a user