/trunk/uspace/app/bdsh/cmds/modules/quit/quit.c |
---|
35,9 → 35,8 |
#include "cmds.h" |
static char *cmdname = "quit"; |
unsigned int cli_quit = 0; |
extern volatile int cli_lasterror; |
extern volatile unsigned int cli_quit; |
extern const char *progname; |
void * help_cmd_quit(unsigned int level) |
/trunk/uspace/app/bdsh/cmds/modules/help/help.c |
---|
40,7 → 40,6 |
static char *cmdname = "help"; |
extern const char *progname; |
extern unsigned int cli_interactive; |
#define HELP_IS_MODULE 1 |
#define HELP_IS_BUILTIN 0 |
126,10 → 125,8 |
} |
} |
printf("%sAvailable commands are:\n", cli_interactive ? "\n " : ""); |
if (cli_interactive) |
printf( |
" ------------------------------------------------------------\n"); |
printf("\n Available commands are:\n"); |
printf(" ------------------------------------------------------------\n"); |
/* First, show a list of built in commands that are available in this mode */ |
for (cmd = builtins; cmd->name != NULL; cmd++, i++) { |
155,11 → 152,8 |
} |
} |
/* Provide a little more information and inform them of history / line |
* editing features if they are present */ |
if (cli_interactive) |
printf("\n Try %s %s for more information on how `%s' works.\n\n", |
cmdname, cmdname, cmdname); |
printf("\n Try %s %s for more information on how `%s' works.\n\n", |
cmdname, cmdname, cmdname); |
return CMD_SUCCESS; |
} |
/trunk/uspace/app/bdsh/cmds/modules/README |
---|
1,8 → 1,15 |
Modules are commands or full programs (anything can be made into a module that can return |
int type) should go here. Note, modules do not update the structures containing user info |
such as the working directory, euid, etc. |
Modules are commands or full programs (anything can be made into a module |
that can return int type) should go here. Note, modules do not (can not) |
update or read cliuser_t. |
Stuff that needs to write to the user structures contained in scli.h should be made as |
built-in commands, not modules. |
Stuff that needs to write to the user structures contained in scli.h should |
be made as built-in commands, not modules, but there are very few times when |
you would want to do that. |
See the README file in the bdsh root directory for a quick overview of how to |
write a new command, or convert an existig stand-alone program into a module |
for BDSH. |
/trunk/uspace/app/bdsh/cmds/builtins/README |
---|
4,13 → 4,18 |
Examples of what should be a built-in and not a module would be: |
cd (the cwd needs to be updated) |
prompt (the prompt needs to be updated) |
enable (the euid needs to be updated) |
cd (cliuser_t->cwd needs to be updated) |
In the future, more user preferences will be set via built-in commands, |
such as the formatting of the prompt string (HelenOS doesn't yet have |
an environment, much less PS*, even if it did we'd likely do it a little |
differently). |
.... etc. |
Anything that does _not_ need to write to this structure should be included |
as a module, not a built in. |
Anything that does _not_ need to use this structure should be included |
as a module, not a built in. If you want to include a new command, there |
is a 99% chance that you want it to be a module. |
For now, a skeleton directory of stuff that will exist lives here. |