Shell 0.4.51. See History.txt for details.

git-svn-id: svn://kolibrios.org@1669 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Nasarus 2010-10-21 04:37:59 +00:00
parent 4b4d896f8a
commit 1428ddf584
9 changed files with 84 additions and 85 deletions

View File

@ -35,8 +35,7 @@
#include "cmd/cmd_clear.c"
#include "cmd/cmd_ccpuid.c"
#include "cmd/cmd_sleep.c"
#include "cmd/cmd_turnoff.c"
#include "cmd/cmd_kerver.c"
#include "cmd/cmd_shutdown.c"
#include "cmd/cmd_uptime.c"
#include "modules/module_command.c"

View File

@ -1,27 +0,0 @@
int cmd_kerver(char param[])
{
char *kvbuf;
char *vA, *vB, *vC, *vD;
unsigned *Rev;
kvbuf = malloc(16);
kol_get_kernel_ver(kvbuf);
vA = kvbuf+0;
vA = *vA;
vB = kvbuf+1;
vB = *vB;
vC = kvbuf+2;
vC = *vC;
vD = kvbuf+3;
vD = *vD;
Rev = kvbuf+5;
Rev = *Rev;
#if LANG_ENG
printf (" KolibriOS v%d.%d.%d.%d. Kernel SVN-rev.: %d\n\r", vA, vB, vC, vD, Rev);
#elif LANG_RUS
printf (" Š®«¨¡à¨Ž‘ v%d.%d.%d.%d. SVN-ॢ. ï¤à : %d\n\r", vA, vB, vC, vD, Rev);
#endif
free(kvbuf);
return TRUE;
}

View File

@ -1,5 +1,5 @@
int cmd_turnoff(char param[])
int cmd_shutdown(char param[])
{
kol_system_end(2);
return TRUE;

View File

@ -1,6 +1,36 @@
int cmd_ver(char param[])
{
printf (" %s\n\r", SHELL_VERSION);
return TRUE;
if (!strcmp(param, "kernel"))
{
char *kvbuf;
char *vA, *vB, *vC, *vD;
unsigned *Rev;
kvbuf = malloc(16);
kol_get_kernel_ver(kvbuf);
vA = kvbuf+0;
vA = *vA;
vB = kvbuf+1;
vB = *vB;
vC = kvbuf+2;
vC = *vC;
vD = kvbuf+3;
vD = *vD;
Rev = kvbuf+5;
Rev = *Rev;
#if LANG_ENG
printf (" KolibriOS v%d.%d.%d.%d. Kernel SVN-rev.: %d\n\r", vA, vB, vC, vD, Rev);
#elif LANG_RUS
printf (" Š®«¨¡à¨Ž‘ v%d.%d.%d.%d. SVN-ॢ. ï¤à : %d\n\r", vA, vB, vC, vD, Rev);
#endif
free(kvbuf);
return TRUE;
}
else
{
printf (" Shell v%s\n\r", SHELL_VERSION);
return TRUE;
}
}

View File

@ -1,5 +1,5 @@
#define SHELL_VERSION "0.4.5"
#define SHELL_VERSION "0.4.51"
extern char PATH[256];
extern char PARAM[256];
@ -63,8 +63,7 @@ int cmd_rmdir(char dir[]);
int cmd_touch(char file[]);
int cmd_ver(char arg[]);
int cmd_sleep(char arg[]);
int cmd_turnoff(char arg[]);
int cmd_kerver(char arg[]);
int cmd_shutdown(char arg[]);
int cmd_uptime(char param[]);
/// ===========================================================

View File

@ -10,7 +10,6 @@ const command_t COMMANDS[]=
{"exit", " Exits from Shell\n\r", &cmd_exit},
{"memory", " Displays total, free and used memory\n\r", &cmd_memory},
{"help", " Gives help on commands. Usage:\n\r help ;it lists all builtins\n\r help <command> ;help on command\n\r", &cmd_help},
{"kerver", " Displays the information about a version of KoOS kernel\n\r", &cmd_kerver},
{"kill", " Stops a running process. Usage:\n\r kill <PID of process>\n\r", &cmd_kill},
{"ls", " Lists the files in a directory. Usage:\n\r ls ;lists the files in current directory\n\r ls <directory> ;lists the files at specified folder\n\r", &cmd_ls},
{"mkdir", " Makes directory. Usage:\n\r mkdir <folder name> ;creates the folder in working directory\n\r mkdir <path><folder name> ;create folder by specified path\n\r", &cmd_mkdir},
@ -21,8 +20,8 @@ const command_t COMMANDS[]=
{"rm", " Removes a file. Usage:\n\r rm file name>\n\r", &cmd_rm},
{"rmdir", " Removes a folder. Usage:\n\r rmdir <directory>\n\r", &cmd_rmdir},
{"sleep", " Stops the shell for the desired period. Usage:\n\r sleep <time in the 1/100 of second>\n\r Example:\n\r sleep 500 ;pause for 5sec.\n\r", &cmd_sleep},
{"shutdown"," Turns off the computer\n\r", &cmd_shutdown},
{"touch", " Creates an empty file or updates the time/date stamp on a file. Usage:\n\r touch <file name>\n\r", &cmd_touch},
{"turnoff"," Turns off the computer\n\r", &cmd_turnoff},
{"uptime", " Displays the uptime", &cmd_uptime},
{"ver", " Displays version of Shell\n\r", &cmd_ver},
{"ver", " Displays version. Usage:\n\r ver ;Shell version\n\r ver kernel ;version of KoOS kernel\n\r", &cmd_ver},
};

View File

@ -10,7 +10,6 @@ const command_t COMMANDS[]=
{"exit", " ‚ë室 ¨§ ª®­á®«¨\n\r", &cmd_exit},
{"memory", " <20>®ª §ë¢ ¥â ®¡êñ¬ ¯ ¬ïâ¨: ¢á¥©, ᢮¡®¤­®© ¨ ¨á¯®«ì§ã¥¬®©\n\r", &cmd_memory},
{"help", " ‘¯à ¢ª  ¯® ª®¬ ­¤ ¬. ˆá¯®«ì§®¢ ­¨¥:\n\r help ;ᯨ᮪ ¢á¥å ª®¬ ­¤\n\r help <ª®¬ ­¤ > ;á¯à ¢ª  ¯® ª®¬ ­¤¥\n\r", &cmd_help},
{"kerver", " ‚뢮¤¨â ¨­ä®à¬ æ¨î ® ¢¥àᨨ ï¤à  KoOS\n\r", &cmd_kerver},
{"kill", " “¡¨¢ ¥â ¯à®æ¥áá. ˆá¯®«ì§®¢ ­¨¥:\n\r kill <PID ¯à®æ¥áá >\n\r", &cmd_kill},
{"ls", " ‚뢮¤¨â ᯨ᮪ ä ©«®¢. ˆá¯®«ì§®¢ ­¨¥:\n\r ls ;ᯨ᮪ ä ©«®¢ ¢ ⥪ã饬 ª â «®£¥\n\r ls <¤¨à¥ªâ®à¨ï> ;ᯨ᮪ ä ©«®¢ ¨§ § ¤ ­­®© ¤¨à¥ªâ®à¨¨\n\r", &cmd_ls},
{"mkdir", " ‘®§¤ ¥â ª â «®£. ˆá¯®«ì§®¢ ­¨¥:\n\r mkdir <¨¬ï ¯ ¯ª¨> ;ᮧ¤ âì ¯ ¯ªã ¢ ⥪ã饬 ª â «®£¥\n\r mkdir <¯ãâì><¨¬ï ¯ ¯ª¨> ;ᮧ¤ âì ¯ ¯ªã ¯® 㪠§ ­­®¬ã ¯ãâ¨\n\r", &cmd_mkdir},
@ -21,8 +20,8 @@ const command_t COMMANDS[]=
{"rm", " “¤ «ï¥â ä ©«. ˆá¯®«ì§®¢ ­¨¥:\n\r rm <¨¬ï ä ©« >\n\r", &cmd_rm},
{"rmdir", " “¤ «ï¥â ¯ ¯ªã. ˆá¯®«ì§®¢ ­¨¥:\n\r rmdir <¤¨à¥ªâ®à¨ï>\n\r", &cmd_rmdir},
{"sleep", " Žáâ ­ ¢«¨¢ ¥â à ¡®âã Shell'  ­  § ¤ ­­®¥ ¢à¥¬ï. ˆá¯®«ì§®¢ ­¨¥:\n\r sleep <¨­â¥à¢ « ¢ á®âëå ¤®«ï ᥪ㭤ë>\n\r <20>ਬ¥à:\n\r sleep 500 ;¯ ã§  ­  5 ᥪ.\n\r", &cmd_sleep},
{"shutdown"," ‚몫î砥⠪®¬¯ìîâ¥à\n\r", &cmd_shutdown},
{"touch", " ‘®§¤ ñâ ¯ãá⮩ ä ©« ¨«¨ ¨§¬¥­ï¥â ¤ âã/¢à¥¬ï ᮧ¤ ­¨ï ä ©« . ˆá¯®«ì§®¢ ­¨¥:\n\r touch <¨¬ï ä ©« >\n\r", &cmd_touch},
{"turnoff"," ‚몫î砥⠪®¬¯ìîâ¥à\n\r", &cmd_turnoff},
{"uptime", " <20>®ª §ë¢ ¥â uptime", &cmd_uptime},
{"ver", " <20>®ª §ë¢ ¥â ¢¥àá¨î Shell' \n\r", &cmd_ver},
{"ver", " <20>®ª §ë¢ ¥â ¢¥àá¨î. ˆá¯®«ì§®¢ ­¨¥:\n\r ver ;¢¥àá¨ï Shell' \n\r ver kernel ;¢¥àá¨ï ¨ ­®¬¥à ॢ¨§¨¨ ï¤à  Š®Ž‘\n\r", &cmd_ver},
};