1,9 → 1,6 |
|
#define FALSE 0 |
#define TRUE 1 |
#define SHELL_VERSION "0.4.4" |
|
#define SHELL_VERSION "0.4" |
|
extern char PATH[256]; |
extern char PARAM[256]; |
|
31,52 → 28,70 |
|
/// =========================================================== |
|
const NUM_OF_CMD = 19; |
int NUM_OF_CMD; |
|
const char HELP_COMMANDS[][10]= |
/// =========================================================== |
|
typedef struct |
{ |
"about", |
"alias", |
"cd", |
"date", |
"echo", |
"exit", |
"free", |
"help", |
"kill", |
"ls", |
"mkdir", |
"more", |
"ps", |
"pwd", |
"reboot", |
"rm", |
"rmdir", |
"touch", |
"ver" |
}; |
const char* name; |
const char* help; |
const void* handler; |
} command_t; |
|
const char HELP_DESC [][70]= |
/// =========================================================== |
|
int cmd_about(char arg[]); |
int cmd_alias(char arg[]); |
int cmd_ccpuid(char dir[]); |
int cmd_cd(char dir[]); |
int cmd_clear(char arg[]); |
int cmd_date(char arg[]); |
int cmd_echo(char text[]); |
int cmd_exit(char arg[]); |
int cmd_free(char arg[]); |
int cmd_help(char cmd[]); |
int cmd_kill(char process[]); |
int cmd_ls(char dir[]); |
int cmd_mkdir(char dir[]); |
int cmd_more(char file[]); |
int cmd_ps(char arg[]); |
int cmd_pwd(char arg[]); |
int cmd_reboot(char arg[]); |
int cmd_rm(char file[]); |
int cmd_rmdir(char dir[]); |
int cmd_touch(char file[]); |
int cmd_ver(char arg[]); |
int cmd_sleep(char arg[]); |
|
/// =========================================================== |
|
const command_t COMMANDS[]= |
{ |
" Displays information about the program\n\r", |
" Allows the user view the current aliases\n\r", |
" Changes directories\n\r", |
" Returns the date and time\n\r", |
" Echoes the data to the screen\n\r", |
" Exits program\n\r", |
" Displays total, free and used memory\n\r", |
" Gives help\n\r", |
" Stops a running process\n\r", |
" Lists the files in a directory\n\r", |
" Makes directory\n\r", |
" Displays a data file to the screen\n\r", |
" Lists the current processes running\n\r", |
" Displays the name of the working directory\n\r", |
" Reboots the computer\n\r", |
" Removes files\n\r", |
" Removes directories\n\r", |
" Creates an empty file or updates the time/date stamp on a file\n\r", |
" Displays version\n\r" |
{"about", " Displays information about the program\n\r", &cmd_about}, |
{"alias", " Allows the user view the current aliases\n\r", &cmd_alias}, |
{"ccpuid"," Displays CPU information\n\r", &cmd_ccpuid}, |
{"cd", " Changes directories\n\r", &cmd_cd}, |
{"clear", " Clears the display\n\r", &cmd_clear}, |
{"date", " Returns the date and time\n\r", &cmd_date}, |
{"echo", " Echoes the data to the screen\n\r", &cmd_echo}, |
{"exit", " Exits program\n\r", &cmd_exit}, |
{"free", " Displays total, free and used memory\n\r", &cmd_free}, |
{"help", " Gives help\n\r", &cmd_help}, |
{"kill", " Stops a running process\n\r", &cmd_kill}, |
{"ls", " Lists the files in a directory\n\r", &cmd_ls}, |
{"mkdir", " Makes directory\n\r", &cmd_mkdir}, |
{"more", " Displays a data file to the screen\n\r", &cmd_more}, |
{"ps", " Lists the current processes running\n\r", &cmd_ps}, |
{"pwd", " Displays the name of the working directory\n\r", &cmd_pwd}, |
{"reboot"," Reboots the computer\n\r", &cmd_reboot}, |
{"rm", " Removes files\n\r", &cmd_rm}, |
{"rmdir", " Removes directories\n\r", &cmd_rmdir}, |
{"sleep", " Stops the shell for the desired period\n\r", &cmd_sleep}, |
{"touch", " Creates an empty file or updates the time/date stamp on a file\n\r", &cmd_touch}, |
{"ver", " Displays version\n\r", &cmd_ver}, |
}; |
|
/// =========================================================== |
|
|