Changeset e2ea8d7e in mainline for uspace/app/bdsh/cmds


Ignore:
Timestamp:
2008-08-27T05:36:12Z (17 years ago)
Author:
Tim Post <echo@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1b4b7b6
Parents:
b510d52
Message:

Housekeeping list, complete lingering things before they get forgotten:

  • cli_*() now sets a global cli_errno, error functions cleaned up
  • Finish internal cli_*() functions in util.c
  • Don't expose cli_init() or cli_finit()
  • Get rid of unused globals
  • Don't set globals in commands themselves
  • Update README files
  • Fix stale comments
Location:
uspace/app/bdsh/cmds
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/builtins/README

    rb510d52 re2ea8d7e  
    55Examples of what should be a built-in and not a module would be:
    66
    7 cd     (the cwd needs to be updated)
    8 prompt (the prompt needs to be updated)
    9 enable (the euid needs to be updated)
     7cd     (cliuser_t->cwd needs to be updated)
     8
     9In the future, more user preferences will be set via built-in commands,
     10such as the formatting of the prompt string (HelenOS doesn't yet have
     11an environment, much less PS*, even if it did we'd likely do it a little
     12differently).
    1013
    1114.... etc.
    1215
    13 Anything that does _not_ need to write to this structure should be included
    14 as a module, not a built in.
     16Anything that does _not_ need to use this structure should be included
     17as a module, not a built in. If you want to include a new command, there
     18is a 99% chance that you want it to be a module.
    1519
    16 For now, a skeleton directory of stuff that will exist lives here.
     20
     21
  • uspace/app/bdsh/cmds/modules/README

    rb510d52 re2ea8d7e  
    1 Modules are commands or full programs (anything can be made into a module that can return
    2 int type) should go here. Note, modules do not update the structures containing user info
    3 such as the working directory, euid, etc.
     1Modules are commands or full programs (anything can be made into a module
     2that can return int type) should go here. Note, modules do not (can not)
     3update or read cliuser_t.
    44
    5 Stuff that needs to write to the user structures contained in scli.h should be made as
    6 built-in commands, not modules.
     5Stuff that needs to write to the user structures contained in scli.h should
     6be made as built-in commands, not modules, but there are very few times when
     7you would want to do that.
     8
     9See the README file in the bdsh root directory for a quick overview of how to
     10write a new command, or convert an existig stand-alone program into a module
     11for BDSH.
    712
    813
     14
     15
  • uspace/app/bdsh/cmds/modules/help/help.c

    rb510d52 re2ea8d7e  
    4141static char *cmdname = "help";
    4242extern const char *progname;
    43 extern unsigned int cli_interactive;
    4443
    4544#define HELP_IS_MODULE   1
     
    127126        }
    128127
    129         printf("%sAvailable commands are:\n", cli_interactive ? "\n  " : "");
    130         if (cli_interactive)
    131                 printf(
    132                         "  ------------------------------------------------------------\n");
     128        printf("\n  Available commands are:\n");
     129        printf("  ------------------------------------------------------------\n");
    133130
    134131        /* First, show a list of built in commands that are available in this mode */
     
    156153        }
    157154
    158         /* Provide  a little more information and inform them of history / line
    159          * editing features if they are present */
    160         if (cli_interactive)
    161                 printf("\n  Try %s %s for more information on how `%s' works.\n\n",
    162                         cmdname, cmdname, cmdname);
     155        printf("\n  Try %s %s for more information on how `%s' works.\n\n",
     156                cmdname, cmdname, cmdname);
    163157
    164158        return CMD_SUCCESS;
  • uspace/app/bdsh/cmds/modules/quit/quit.c

    rb510d52 re2ea8d7e  
    3636
    3737static char *cmdname = "quit";
    38 unsigned int cli_quit = 0;
    3938
    40 extern volatile int cli_lasterror;
     39extern volatile unsigned int cli_quit;
    4140extern const char *progname;
    4241
Note: See TracChangeset for help on using the changeset viewer.