Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r864ed35 r451db9e  
    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.  If a tty is specified for zlog in\n"
     53              "and 'shutdownlogout' variables.  If a tty is specified for zlog in\n"
    5454              "then the owl variable 'tty' will be set to that string, causing\n"
    5555              "it to be used as the zephyr location tty.\n"),
     
    193193  OWLCMD_ARGS("subscribe", owl_command_subscribe, OWL_CTX_ANY,
    194194              "subscribe to a zephyr class, instance, recipient",
    195               "subscribe [-t] <class> <instance> [recipient]",
    196               "Subscribe the specified class and instance.  If the recipient\n"
    197               "is not listed on the command line it defaults\n"
    198               "to * (the wildcard recipient).  If the -t option is present\n"
    199               "the subscription will only be temporary, i.e., it will not\n"
    200               "be written to the subscription file and will therefore not\n"
    201               "be present the next time owl is started.\n"),
     195              "subscribe [-t] <class> [instance [recipient]]",
     196              "Subscribe to the specified class and instance.  If the\n"
     197              "instance or recipient is not listed on the command\n"
     198              "line they default to * (the wildcard recipient).\n"
     199              "If the -t option is present the subscription will\n"
     200              "only be temporary, i.e., it will not be written to\n"
     201              "the subscription file and will therefore not be\n"
     202              "present the next time owl is started.\n"),
    202203  OWLCMD_ALIAS("sub", "subscribe"),
    203204
    204205  OWLCMD_ARGS("unsubscribe", owl_command_unsubscribe, OWL_CTX_ANY,
    205206              "unsubscribe from a zephyr class, instance, recipient",
    206               "unsubscribe [-t] <class> <instance> [recipient]",
     207              "unsubscribe [-t] <class> [instance [recipient]]",
    207208              "Unsubscribe from the specified class and instance.  If the\n"
    208               "recipient is not listed on the command line it defaults\n"
    209               "to * (the wildcard recipient).  If the -t option is present\n"
    210               "the unsubscription will only be temporary, i.e., it will not\n"
    211               "be updated in the subscription file and will therefore not\n"
    212               "be in effect the next time owl is started.\n"),
     209              "instance or recipient is not listed on the command\n"
     210              "line they default to * (the wildcard recipient).\n"
     211              "If the -t option is present the unsubscription will\n"
     212              "only be temporary, i.e., it will not be updated in\n"
     213              "the subscription file and will therefore not be\n"
     214              "in effect the next time owl is started.\n"),
    213215  OWLCMD_ALIAS("unsub", "unsubscribe"),
    214216
     
    245247              "delete a buddy from a buddylist",
    246248              "delbuddy <protocol> <screenname>",
    247               "Delete the named buddy to your buddylist.  <protocol< can be aim or zephyr\n"),
     249              "Delete the named buddy from your buddylist.  <protocol> can be aim or zephyr\n"),
    248250
    249251  OWLCMD_ARGS("join", owl_command_join, OWL_CTX_INTERACTIVE,
     
    263265              "zpunt <instance>",
    264266              "The zpunt command will supress message to the specified\n"
    265               "zephyr triplet.  In the second usage messages as supressed\n"
     267              "zephyr triplet.  In the second usage messages are suppressed\n"
    266268              "for class MESSAGE and the named instance.\n\n"
    267269              "SEE ALSO:  zunpunt, show zpunts\n"),
     
    271273              "zunpunt <class> <instance> [recipient]\n"
    272274              "zunpunt <instance>",
    273               "The zunpunt command will allow messages that were previosly\n"
     275              "The zunpunt command will allow messages that were previously\n"
    274276              "suppressed to be received again.\n\n"
    275277              "SEE ALSO:  zpunt, show zpunts\n"),
     
    545547              "    true\n"
    546548              "    false\n"
    547               "Spaces must be present before and after parenthesis.  If the\n"
     549              "Spaces must be present before and after parentheses.  If the\n"
    548550              "optional color arguments are used they specifies the colors that\n"
    549551              "messages matching this filter should be displayed in.\n\n"
     
    592594              "If the curmsg is a personal message narrow\n"
    593595              "   to the conversation with that user.\n"
    594               "If the curmsg is a class message, instance foo, recip *\n"
    595               "   message, narrow to the class, inst.\n"
    596               "If the curmsg is a class message then narrow\n"
     596              "If the curmsg is a <MESSAGE, foo, *>\n"
     597              "   message, narrow to the instance.\n"
     598              "If the curmsg is a class message, narrow\n"
    597599              "    to the class.\n"
    598               "If the curmsg is a class message and '-i' is specied\n"
    599               "    then narrow to the class, instance\n"),
     600              "If the curmsg is a class message and '-i' is specified\n"
     601              "    then narrow to the class and instance.\n"),
    600602
    601603  OWLCMD_ARGS("smartfilter", owl_command_smartfilter, OWL_CTX_INTERACTIVE,
     
    604606              "If the curmsg is a personal message, the filter is\n"
    605607              "   the conversation with that user.\n"
    606               "If the curmsg is a class message, instance foo, recip *\n"
    607               "   message, the filter is the class, inst.\n"
     608              "If the curmsg is a <MESSAGE, foo, *>\n"
     609              "   message, the filter is to that instance.\n"
    608610              "If the curmsg is a class message, the filter is that class.\n"
    609611              "If the curmsg is a class message and '-i' is specied\n"
    610               "    the filter is that <class,instance> pair\n"),
     612              "    the filter is to that class and instance.\n"),
    611613
    612614  OWLCMD_ARGS("viewclass", owl_command_viewclass, OWL_CTX_INTERACTIVE,
     
    674676              "If no message id is specified the current message is marked\n"
    675677              "for deletion.  Otherwise the message with the given message\n"
    676               "id is marked for deltion.\n"
     678              "id is marked for deletion.\n"
    677679              "If '--no-move' is specified, don't move after deletion.\n"
    678680              "If 'trash' is specified, deletes all trash/auto messages\n"
     
    688690              "If no message id is specified the current message is\n"
    689691              "unmarked for deletion.  Otherwise the message with the\n"
    690               "given message id is marked for undeltion.\n"
     692              "given message id is unmarked for deletion.\n"
    691693              "If '--no-move' is specified, don't move after deletion.\n"
    692694              "If 'view' is specified, undeletes all messages\n"
     
    713715              "getvar <varname>", ""),
    714716
     717  OWLCMD_ARGS("getfilter", owl_command_getfilter, OWL_CTX_INTERACTIVE,
     718              "returns the definition of a filter",
     719              "getfilter <filtername>", ""),
     720
    715721  OWLCMD_ARGS("getstyle", owl_command_getstyle, OWL_CTX_INTERACTIVE,
    716722              "returns the name of the style for the current view",
     
    723729              "specified string and move the cursor there.  If no string\n"
    724730              "argument is supplied then the previous one is used.  By\n"
    725               "default searches are done fowards, if -r is used the search\n"
     731              "default searches are done forwards; if -r is used the search\n"
    726732              "is performed backwards"),
    727733
     
    732738          "argument and makes it the default argument for future\n"
    733739          "search commands, but does not move the cursor.  With\n"
    734           "no argument, it makes search inactive."),
     740          "no argument, it makes search highlighting inactive."),
    735741
    736742  OWLCMD_ARGS("aimlogin", owl_command_aimlogin, OWL_CTX_ANY,
     
    750756
    751757  OWLCMD_ARGS("message", owl_command_message, OWL_CTX_ANY,
    752               "Display an informatative message",
     758              "Display an informative message",
    753759              "message <message>",
    754760              ""),
     
    17391745char *owl_command_subscribe(int argc, char **argv, char *buff)
    17401746{
    1741   char *recip="";
     1747  char *class, *instance, *recip="";
    17421748  int temp=0;
    17431749  int ret=0;
    1744  
    1745   if (argc<3) {
     1750
     1751  if (argc < 2) {
    17461752    owl_function_makemsg("Not enough arguments to the subscribe command");
    17471753    return(NULL);
     
    17551761    argv++;
    17561762  }
    1757   if (argc<2) {
     1763  if (argc < 1) {
    17581764    owl_function_makemsg("Not enough arguments to the subscribe command");
    17591765    return(NULL);
    17601766  }
    17611767
    1762   if (argc>3) {
     1768  if (argc > 3) {
    17631769    owl_function_makemsg("Too many arguments to the subscribe command");
    17641770    return(NULL);
    17651771  }
    17661772
    1767   if (argc==2) {
     1773  class = argv[0];
     1774
     1775  if (argc == 1) {
     1776    instance = "*";
     1777  } else {
     1778    instance = argv[1];
     1779  }
     1780
     1781  if (argc <= 2) {
    17681782    recip="";
    17691783  } else if (argc==3) {
     
    17711785  }
    17721786
    1773   ret = owl_function_subscribe(argv[0], argv[1], recip);
     1787  ret = owl_function_subscribe(class, instance, recip);
    17741788  if (!temp && !ret) {
    1775     owl_zephyr_addsub(NULL, argv[0], argv[1], recip);
     1789    owl_zephyr_addsub(NULL, class, instance, recip);
    17761790  }
    17771791  return(NULL);
     
    17811795char *owl_command_unsubscribe(int argc, char **argv, char *buff)
    17821796{
    1783   char *recip="";
     1797  char *class, *instance, *recip="";
    17841798  int temp=0;
    17851799
    1786   if (argc<3) {
     1800  if (argc < 2) {
    17871801    owl_function_makemsg("Not enough arguments to the unsubscribe command");
    17881802    return(NULL);
     
    17961810    argv++;
    17971811  }
    1798   if (argc<2) {
    1799     owl_function_makemsg("Not enough arguments to the subscribe command");
    1800     return(NULL);
    1801   }
    1802 
    1803   if (argc>3) {
     1812  if (argc < 1) {
     1813    owl_function_makemsg("Not enough arguments to the unsubscribe command");
     1814    return(NULL);
     1815  }
     1816
     1817  if (argc > 3) {
    18041818    owl_function_makemsg("Too many arguments to the unsubscribe command");
    18051819    return(NULL);
    18061820  }
    18071821
    1808   if (argc==2) {
     1822  class = argv[0];
     1823
     1824  if (argc == 1) {
     1825    instance = "*";
     1826  } else {
     1827    instance = argv[1];
     1828  }
     1829
     1830  if (argc <= 2) {
    18091831    recip="";
    18101832  } else if (argc==3) {
     
    18121834  }
    18131835
    1814   owl_function_unsubscribe(argv[0], argv[1], recip);
     1836  owl_function_unsubscribe(class, instance, recip);
    18151837  if (!temp) {
    1816     owl_zephyr_delsub(NULL, argv[0], argv[1], recip);
     1838    owl_zephyr_delsub(NULL, class, instance, recip);
    18171839  }
    18181840  return(NULL);
     
    24612483}
    24622484
     2485char *owl_command_getfilter(int argc, char **argv, char *buf)
     2486{
     2487  owl_filter *f;
     2488  if (argc != 2) {
     2489    owl_function_makemsg("Wrong number of arguments for %s", argv[0]);
     2490    return NULL;
     2491  }
     2492  f = owl_global_get_filter(&g, argv[1]);
     2493  if (!f) {
     2494    return NULL;
     2495  }
     2496  return owl_filter_print(f);
     2497}
     2498
    24632499char *owl_command_search(int argc, char **argv, char *buff)
    24642500{
     
    25802616  cmd = owl_message_get_attribute_value(m, "yescommand");
    25812617  if(!cmd) {
    2582     owl_function_error("No yes command!");
     2618    owl_function_error("No 'yes' command!");
    25832619    return;
    25842620  }
     
    26142650  cmd = owl_message_get_attribute_value(m, "nocommand");
    26152651  if(!cmd) {
    2616     owl_function_error("No no command!");
     2652    owl_function_error("No 'no' command!");
    26172653    return;
    26182654  }
Note: See TracChangeset for help on using the changeset viewer.