forked from KolibriOS/kolibrios
SHELL 0.8.2
- big refactoring, now uses libc.obj - added kfetch command git-svn-id: svn://kolibrios.org@8827 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -1,46 +1,30 @@
|
||||
|
||||
int cmd_help(char cmd[])
|
||||
{
|
||||
int cmd_help(char cmd[]) {
|
||||
int i;
|
||||
|
||||
int i;
|
||||
|
||||
#if LANG_ENG
|
||||
char available[]={" %d commands available:\n\r"};
|
||||
#elif LANG_RUS
|
||||
char available[]={" Š®«¨ç¥á⢮ ¤®áâã¯ëå ª®¬ ¤: %d\n\r"};
|
||||
#endif
|
||||
|
||||
if ( !strlen(cmd) )
|
||||
{
|
||||
int columns_max=3;
|
||||
printf (available, NUM_OF_CMD);
|
||||
for (i = 0; i < NUM_OF_CMD; i++)
|
||||
{
|
||||
printf(" %-12s", COMMANDS[i].name);
|
||||
if ((i) && ((i+1)%columns_max == 0)) printf("\n\r");
|
||||
if ( !strlen(cmd) ) {
|
||||
int columns_max=3;
|
||||
printf (CMD_HELP_AVAIL, NUM_OF_CMD);
|
||||
for (i = 0; i < NUM_OF_CMD; i++) {
|
||||
printf(" %-12s", COMMANDS[i].name);
|
||||
if ((i) && ((i+1)%columns_max == 0)) printf("\n\r");
|
||||
}
|
||||
if ((i)%columns_max != 0) printf("\n\r");
|
||||
return TRUE;
|
||||
}
|
||||
if ((i)%columns_max != 0) printf("\n\r");
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i=0; i<NUM_OF_CMD; i++)
|
||||
if ( !strcmp(cmd, COMMANDS[i].name) )
|
||||
{
|
||||
printf(COMMANDS[i].help);
|
||||
return TRUE;
|
||||
else {
|
||||
for (i=0; i<NUM_OF_CMD; i++)
|
||||
if ( !strcmp(cmd, COMMANDS[i].name) ) {
|
||||
printf(COMMANDS[i].help);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#if LANG_ENG
|
||||
printf (" Command \'%s\' not found.\n\r", cmd);
|
||||
#elif LANG_RUS
|
||||
printf (" Š®¬ ¤ \'%s\' ¥ ©¤¥ .\n\r", cmd);
|
||||
#endif
|
||||
printf (available, NUM_OF_CMD);
|
||||
for (i = 0; i < NUM_OF_CMD; i++)
|
||||
printf(" %s\n\r", COMMANDS[i].name);
|
||||
}
|
||||
printf (CMD_HELP_CMD_NOT_FOUND, cmd);
|
||||
printf (CMD_HELP_AVAIL, NUM_OF_CMD);
|
||||
for (i = 0; i < NUM_OF_CMD; i++)
|
||||
printf(" %s\n\r", COMMANDS[i].name);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user