Changeset 42abb10 for commands.c


Ignore:
Timestamp:
Sep 16, 2002, 2:51:33 PM (18 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
af2ca19
Parents:
425c013
Message:
There is now a 'zlist' command that acts like 'znol -l'
'l' is bound to 'zlist'
File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r425c013 r42abb10  
    185185              "display help on using owl",
    186186              "help [command]", ""),
     187
     188  OWLCMD_ARGS("zlist", owl_command_zlist, OWL_CTX_INTERACTIVE,
     189              "List users logged in",
     190              "znol [-f file]",
     191              "Print a znol-style listing of users logged in"),
    187192 
    188193  OWLCMD_VOID("recv:shiftleft", owl_command_shift_left, OWL_CTX_INTERACTIVE,
     
    717722  owl_function_help_for_command(argv[1]);
    718723  return NULL;
     724}
     725
     726char *owl_command_zlist(int argc, char **argv) {
     727  int elapsed=0, timesort=0;
     728  char *file=NULL;
     729
     730  argc--;
     731  argv++;
     732  while (argc) {
     733    if (!strcmp(argv[0], "-e")) {
     734      elapsed=1;
     735      argc--;
     736      argv++;
     737    } else if (!strcmp(argv[0], "-t")) {
     738      timesort=1;
     739      argc--;
     740      argv++;
     741    } else if (!strcmp(argv[0], "-f")) {
     742      if (argc==1) {
     743        owl_function_makemsg("zlist: -f needs an argument");
     744        return(NULL);
     745      }
     746      file=argv[1];
     747      argc-=2;
     748      argv+=2;
     749    } else {
     750      owl_function_makemsg("zlist: unknown argument");
     751      return(NULL);
     752    }
     753  }
     754  owl_function_zlist(file, elapsed, timesort);
     755  return(NULL);
    719756}
    720757
Note: See TracChangeset for help on using the changeset viewer.