Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r14965e5 rd544237  
    9292              "Use 'show keymaps' to see the existing keymaps.\n"
    9393              "Key sequences may be things like M-C-t or NPAGE.\n\n"
    94               "Ex.: bindkey recv C-b command zwrite -c barnowl"
    95               "SEE ALSO: bindkey"),
     94              "Ex.: bindkey recv C-b command zwrite -c barnowl\n"
     95              "Ex.: bindkey recv m command start-command zwrite -c my-class -i \n\n"
     96              "SEE ALSO: unbindkey, start-command"),
    9697
    9798  OWLCMD_ARGS("unbindkey", owl_command_unbindkey, OWL_CTX_ANY,
     
    100101              "Removes a binding of a key sequence within a keymap.\n"
    101102              "Use 'show keymaps' to see the existing keymaps.\n"
    102               "Ex.: unbindkey recv H"
     103              "Ex.: unbindkey recv H\n\n"
    103104              "SEE ALSO: bindkey"),
    104105
    105106  OWLCMD_ARGS("zwrite", owl_command_zwrite, OWL_CTX_INTERACTIVE,
    106107              "send a zephyr",
    107               "zwrite [-n] [-C] [-c class] [-i instance] [-r realm] [-O opcde] [<user> ...] [-m <message...>]",
     108              "zwrite [-n] [-C] [-c class] [-i instance] [-r realm] [-O opcode] [<user> ...] [-m <message...>]",
    108109              "Zwrite send a zephyr to the one or more users specified.\n\n"
    109110              "The following options are available:\n\n"
     
    137138  OWLCMD_ARGS("zcrypt", owl_command_zcrypt, OWL_CTX_INTERACTIVE,
    138139              "send an encrypted zephyr",
    139               "zcrypt [-n] [-C] [-c class] [-i instance] [-r realm] [-O opcde] [-m <message...>]\n",
     140              "zcrypt [-n] [-C] [-c class] [-i instance] [-r realm] [-O opcode] [-m <message...>]\n",
    140141              "Behaves like zwrite but uses encryption.  Not for use with\n"
    141142              "personal messages\n"),
     
    147148              "allow editing.\n\n"
    148149              "If 'sender' is specified, reply to the sender.\n\n"
    149               "If 'all' or no args are specified, reply publically to the\n"
     150              "If 'all' or no args are specified, reply publicly to the\n"
    150151              "same class/instance for non-personal messages and to the\n"
    151152              "sender for personal messages.\n\n"
     
    265266              "zpunt <class> <instance> [recipient]\n"
    266267              "zpunt <instance>",
    267               "The zpunt command will supress message to the specified\n"
     268              "The zpunt command will suppress messages to the specified\n"
    268269              "zephyr triplet.  In the second usage messages are suppressed\n"
    269270              "for class MESSAGE and the named instance.\n\n"
     
    282283              "punt <filter-text>",
    283284              "punt <filter-text (multiple words)>\n"
    284               "The punt command will supress message to the specified\n"
     285              "The punt command will suppress messages to the specified\n"
    285286              "filter\n\n"
    286287              "SEE ALSO:  unpunt, zpunt, show zpunts\n"),
     
    585586              "name style after the -s argument.\n"
    586587              "\n"
    587               "The other usages listed above are abbreivated forms that simply set\n"
     588              "The other usages listed above are abbreviated forms that simply set\n"
    588589              "the filter of the current view. The -d option allows you to write a\n"
    589590              "filter expression that will be dynamically created by owl and then\n"
     
    593594  OWLCMD_ARGS("smartnarrow", owl_command_smartnarrow, OWL_CTX_INTERACTIVE,
    594595              "view only messages similar to the current message",
    595               "smartnarrow [-i | --instance]  [-r | --relatde]",
     596              "smartnarrow [-i | --instance]  [-r | --related]",
    596597              "If the curmsg is a personal message narrow\n"
    597598              "   to the conversation with that user.\n"
     
    613614              "   message, the filter is to that instance.\n"
    614615              "If the curmsg is a class message, the filter is that class.\n"
    615               "If the curmsg is a class message and '-i' is specied\n"
     616              "If the curmsg is a class message and '-i' is specified\n"
    616617              "    the filter is to that class and instance.\n"),
    617618
     
    673674              "for formatting messages.\n\n"
    674675              "Show variables will list the names of all variables.\n\n"
    675               "Show errors will show a list of errors ecountered by Owl.\n\n"
     676              "Show errors will show a list of errors encountered by Owl.\n\n"
    676677              "SEE ALSO: filter, view, alias, bindkey, help\n"),
    677678 
     
    742743              "set the search highlight string without searching",
    743744              "setsearch <string>",
    744               "The setsearch command highlights all occurences of its\n"
     745              "The setsearch command highlights all occurrences of its\n"
    745746          "argument and makes it the default argument for future\n"
    746747          "search commands, but does not move the cursor.  With\n"
     
    12941295  char opt;
    12951296  int instance = 0, related = 0, i;
    1296   char **tmp_argv = owl_malloc(sizeof(char *) * argc);
     1297  const char **tmp_argv = owl_malloc(sizeof(char *) * argc);
    12971298
    12981299  for (i = 0; i < argc; i++)
    1299     tmp_argv[i] = owl_strdup(argv[i]);
    1300 
    1301   static struct option options[] = {
     1300    tmp_argv[i] = argv[i];
     1301
     1302  static const struct option options[] = {
    13021303    {"instance", 0, 0, 'i'},
    13031304    {"related",  0, 0, 'r'},
    13041305    {NULL,       0, 0, 0}};
    1305   while ((opt = getopt_long(argc, tmp_argv, "ir", options, NULL)) != -1) {
     1306
     1307  optind = 0;
     1308  while ((opt = getopt_long(argc, (char **)tmp_argv, "ir", options, NULL)) != -1) {
    13061309    switch (opt) {
    13071310      case 'i':
     
    13171320  }
    13181321
    1319   for (i = 0; i < argc; i++)
    1320     owl_free(tmp_argv[i]);
    1321   owl_free(tmp_argv);
    1322 
    13231322  filtname = owl_function_smartfilter(instance, related);
    13241323
     
    13291328
    13301329done:
    1331   optind = 0; /* reset getopt */
     1330  owl_free(tmp_argv);
     1331
    13321332  return NULL;
    13331333}
     
    16081608char *owl_command_exec(int argc, const char *const *argv, const char *buff)
    16091609{
    1610   return owl_function_exec(argc, argv, buff, 0);
     1610  return owl_function_exec(argc, argv, buff, OWL_OUTPUT_RETURN);
    16111611}
    16121612
    16131613char *owl_command_pexec(int argc, const char *const *argv, const char *buff)
    16141614{
    1615   return owl_function_exec(argc, argv, buff, 1);
     1615  return owl_function_exec(argc, argv, buff, OWL_OUTPUT_POPUP);
    16161616}
    16171617
    16181618char *owl_command_aexec(int argc, const char *const *argv, const char *buff)
    16191619{
    1620   return owl_function_exec(argc, argv, buff, 2);
     1620  return owl_function_exec(argc, argv, buff, OWL_OUTPUT_ADMINMSG);
    16211621}
    16221622
    16231623char *owl_command_perl(int argc, const char *const *argv, const char *buff)
    16241624{
    1625   return owl_function_perl(argc, argv, buff, 0);
     1625  return owl_function_perl(argc, argv, buff, OWL_OUTPUT_RETURN);
    16261626}
    16271627
    16281628char *owl_command_pperl(int argc, const char *const *argv, const char *buff)
    16291629{
    1630   return owl_function_perl(argc, argv, buff, 1);
     1630  return owl_function_perl(argc, argv, buff, OWL_OUTPUT_POPUP);
    16311631}
    16321632
    16331633char *owl_command_aperl(int argc, const char *const *argv, const char *buff)
    16341634{
    1635   return owl_function_perl(argc, argv, buff, 2);
     1635  return owl_function_perl(argc, argv, buff, OWL_OUTPUT_ADMINMSG);
    16361636}
    16371637
Note: See TracChangeset for help on using the changeset viewer.