Changeset 2527615 for commands.c


Ignore:
Timestamp:
Oct 12, 2002, 11:14:41 AM (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:
b12c219
Parents:
d023c25
Message:
The 'zlocate' command can now handle multiple users
File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r2adaf1d r2527615  
    366366  OWLCMD_ARGS("zlocate", owl_command_zlocate, OWL_CTX_INTERACTIVE,
    367367              "locate a user",
    368               "zlocate [-d] <user>",
    369               "Performs a zlocate on a user and puts the result into\n"
    370               "a popwin.  If -d is specified, does not authenticate\n"
     368              "zlocate [-d] <user> ...",
     369              "Performs a zlocate on one ore more users and puts the result\n"
     370              "int a popwin.  If -d is specified, does not authenticate\n"
    371371              "the lookup request.\n"),
    372372 
     
    13351335
    13361336char *owl_command_zlocate(int argc, char **argv, char *buff) {
    1337   if (argc==2) {
    1338     owl_function_zlocate(argv[1], 1);
    1339   } else if (argc==3) {
    1340     if (!strcmp(argv[1], "-d")) {
    1341       owl_function_zlocate(argv[2], 0);
     1337  int auth;
     1338 
     1339  if (argc<2) {
     1340    owl_function_makemsg("Too few arguments for zlocate command");
     1341    return NULL;
     1342  }
     1343
     1344  auth=1;
     1345  if (!strcmp(argv[1], "-d")) {
     1346    if (argc>2) {
     1347      auth=0;
     1348      argc--;
     1349      argv++;
    13421350    } else {
    1343       owl_function_makemsg("Invalid option to the zlocate command");
     1351      owl_function_makemsg("Missing arguments for zlocate command");
    13441352      return NULL;
    13451353    }
    1346   } else {
    1347     owl_function_makemsg("Wrong number of arguments for zlocate command");
    1348     return NULL;
    1349   }
     1354  }
     1355
     1356  argc--;
     1357  argv++;
     1358  owl_function_zlocate(argc, argv, auth);
    13501359  return NULL;
    13511360}
Note: See TracChangeset for help on using the changeset viewer.