Changeset 425c013 for commands.c


Ignore:
Timestamp:
Sep 16, 2002, 1:33:00 PM (22 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
42abb10
Parents:
5145235
Message:
'zlog in' will now take an optional thrid argument to set the 'tty'
variable before setting the zlocation
File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r5eeea3b r425c013  
    4646  OWLCMD_ARGS("zlog", owl_command_zlog, OWL_CTX_ANY,
    4747              "send a login or logout notification",
    48               "zlog in\nzlog out",
     48              "zlog in [tty]\nzlog out",
    4949              "zlog in will send a login notification, zlog out will send a\n"
    5050              "logout notification.  By default a login notification is sent\n"
    5151              "when owl is started and a logout notification is sent when owl\n"
    5252              "is exited.  This behavior can be changed with the 'startuplogin'\n"
    53               "and 'shudownlogout' variables.\n"),
     53              "and 'shudownlogout' variables.  If a tty is specified for zlog in\n"
     54              "then the owl variable 'tty' will be set to that string, causing\n"
     55              "it to be used as the zephyr location tty.\n"),
    5456
    5557  OWLCMD_VOID("quit", owl_command_quit, OWL_CTX_ANY,
     
    10621064
    10631065char *owl_command_zlog(int argc, char **argv, char *buff) {
    1064   if (argc != 2) {
     1066  if ((argc<2) || (argc>3)) {
    10651067    owl_function_makemsg("Wrong number of arguments for zlog command");
    1066     return NULL;
     1068    return(NULL);
    10671069  }
    10681070
    10691071  if (!strcmp(argv[1], "in")) {
     1072    if (argc>2) {
     1073      owl_global_set_tty(&g, argv[2]);
     1074    }
    10701075    owl_function_zlog_in();
    10711076  } else if (!strcmp(argv[1], "out")) {
     1077    if (argc!=2) {
     1078      owl_function_makemsg("Wrong number of arguments for zlog command");
     1079      return(NULL);
     1080    }
    10721081    owl_function_zlog_out();
    10731082  } else {
    10741083    owl_function_makemsg("Invalid subcommand for zlog");
    10751084  }
    1076   return NULL;
     1085  return(NULL);
    10771086}
    10781087
Note: See TracChangeset for help on using the changeset viewer.