/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. |