Changes in commands.c [864ed35:451db9e]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
commands.c
r864ed35 r451db9e 51 51 "when owl is started and a logout notification is sent when owl\n" 52 52 "is exited. This behavior can be changed with the 'startuplogin'\n" 53 "and 'shu downlogout' variables. If a tty is specified for zlog in\n"53 "and 'shutdownlogout' variables. If a tty is specified for zlog in\n" 54 54 "then the owl variable 'tty' will be set to that string, causing\n" 55 55 "it to be used as the zephyr location tty.\n"), … … 193 193 OWLCMD_ARGS("subscribe", owl_command_subscribe, OWL_CTX_ANY, 194 194 "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"), 202 203 OWLCMD_ALIAS("sub", "subscribe"), 203 204 204 205 OWLCMD_ARGS("unsubscribe", owl_command_unsubscribe, OWL_CTX_ANY, 205 206 "unsubscribe from a zephyr class, instance, recipient", 206 "unsubscribe [-t] <class> <instance> [recipient]",207 "unsubscribe [-t] <class> [instance [recipient]]", 207 208 "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"), 213 215 OWLCMD_ALIAS("unsub", "unsubscribe"), 214 216 … … 245 247 "delete a buddy from a buddylist", 246 248 "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"), 248 250 249 251 OWLCMD_ARGS("join", owl_command_join, OWL_CTX_INTERACTIVE, … … 263 265 "zpunt <instance>", 264 266 "The zpunt command will supress message to the specified\n" 265 "zephyr triplet. In the second usage messages a s supressed\n"267 "zephyr triplet. In the second usage messages are suppressed\n" 266 268 "for class MESSAGE and the named instance.\n\n" 267 269 "SEE ALSO: zunpunt, show zpunts\n"), … … 271 273 "zunpunt <class> <instance> [recipient]\n" 272 274 "zunpunt <instance>", 273 "The zunpunt command will allow messages that were previo sly\n"275 "The zunpunt command will allow messages that were previously\n" 274 276 "suppressed to be received again.\n\n" 275 277 "SEE ALSO: zpunt, show zpunts\n"), … … 545 547 " true\n" 546 548 " false\n" 547 "Spaces must be present before and after parenthes is. If the\n"549 "Spaces must be present before and after parentheses. If the\n" 548 550 "optional color arguments are used they specifies the colors that\n" 549 551 "messages matching this filter should be displayed in.\n\n" … … 592 594 "If the curmsg is a personal message narrow\n" 593 595 " 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 thennarrow\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" 597 599 " to the class.\n" 598 "If the curmsg is a class message and '-i' is speci ed\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"), 600 602 601 603 OWLCMD_ARGS("smartfilter", owl_command_smartfilter, OWL_CTX_INTERACTIVE, … … 604 606 "If the curmsg is a personal message, the filter is\n" 605 607 " the conversation with that user.\n" 606 "If the curmsg is a class message, instance foo, recip *\n"607 " message, the filter is t he class, inst.\n"608 "If the curmsg is a <MESSAGE, foo, *>\n" 609 " message, the filter is to that instance.\n" 608 610 "If the curmsg is a class message, the filter is that class.\n" 609 611 "If the curmsg is a class message and '-i' is specied\n" 610 " the filter is t hat <class,instance> pair\n"),612 " the filter is to that class and instance.\n"), 611 613 612 614 OWLCMD_ARGS("viewclass", owl_command_viewclass, OWL_CTX_INTERACTIVE, … … 674 676 "If no message id is specified the current message is marked\n" 675 677 "for deletion. Otherwise the message with the given message\n" 676 "id is marked for del tion.\n"678 "id is marked for deletion.\n" 677 679 "If '--no-move' is specified, don't move after deletion.\n" 678 680 "If 'trash' is specified, deletes all trash/auto messages\n" … … 688 690 "If no message id is specified the current message is\n" 689 691 "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" 691 693 "If '--no-move' is specified, don't move after deletion.\n" 692 694 "If 'view' is specified, undeletes all messages\n" … … 713 715 "getvar <varname>", ""), 714 716 717 OWLCMD_ARGS("getfilter", owl_command_getfilter, OWL_CTX_INTERACTIVE, 718 "returns the definition of a filter", 719 "getfilter <filtername>", ""), 720 715 721 OWLCMD_ARGS("getstyle", owl_command_getstyle, OWL_CTX_INTERACTIVE, 716 722 "returns the name of the style for the current view", … … 723 729 "specified string and move the cursor there. If no string\n" 724 730 "argument is supplied then the previous one is used. By\n" 725 "default searches are done fo wards,if -r is used the search\n"731 "default searches are done forwards; if -r is used the search\n" 726 732 "is performed backwards"), 727 733 … … 732 738 "argument and makes it the default argument for future\n" 733 739 "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."), 735 741 736 742 OWLCMD_ARGS("aimlogin", owl_command_aimlogin, OWL_CTX_ANY, … … 750 756 751 757 OWLCMD_ARGS("message", owl_command_message, OWL_CTX_ANY, 752 "Display an informat ative message",758 "Display an informative message", 753 759 "message <message>", 754 760 ""), … … 1739 1745 char *owl_command_subscribe(int argc, char **argv, char *buff) 1740 1746 { 1741 char * recip="";1747 char *class, *instance, *recip=""; 1742 1748 int temp=0; 1743 1749 int ret=0; 1744 1745 if (argc <3) {1750 1751 if (argc < 2) { 1746 1752 owl_function_makemsg("Not enough arguments to the subscribe command"); 1747 1753 return(NULL); … … 1755 1761 argv++; 1756 1762 } 1757 if (argc <2) {1763 if (argc < 1) { 1758 1764 owl_function_makemsg("Not enough arguments to the subscribe command"); 1759 1765 return(NULL); 1760 1766 } 1761 1767 1762 if (argc >3) {1768 if (argc > 3) { 1763 1769 owl_function_makemsg("Too many arguments to the subscribe command"); 1764 1770 return(NULL); 1765 1771 } 1766 1772 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) { 1768 1782 recip=""; 1769 1783 } else if (argc==3) { … … 1771 1785 } 1772 1786 1773 ret = owl_function_subscribe( argv[0], argv[1], recip);1787 ret = owl_function_subscribe(class, instance, recip); 1774 1788 if (!temp && !ret) { 1775 owl_zephyr_addsub(NULL, argv[0], argv[1], recip);1789 owl_zephyr_addsub(NULL, class, instance, recip); 1776 1790 } 1777 1791 return(NULL); … … 1781 1795 char *owl_command_unsubscribe(int argc, char **argv, char *buff) 1782 1796 { 1783 char * recip="";1797 char *class, *instance, *recip=""; 1784 1798 int temp=0; 1785 1799 1786 if (argc <3) {1800 if (argc < 2) { 1787 1801 owl_function_makemsg("Not enough arguments to the unsubscribe command"); 1788 1802 return(NULL); … … 1796 1810 argv++; 1797 1811 } 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) { 1804 1818 owl_function_makemsg("Too many arguments to the unsubscribe command"); 1805 1819 return(NULL); 1806 1820 } 1807 1821 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) { 1809 1831 recip=""; 1810 1832 } else if (argc==3) { … … 1812 1834 } 1813 1835 1814 owl_function_unsubscribe( argv[0], argv[1], recip);1836 owl_function_unsubscribe(class, instance, recip); 1815 1837 if (!temp) { 1816 owl_zephyr_delsub(NULL, argv[0], argv[1], recip);1838 owl_zephyr_delsub(NULL, class, instance, recip); 1817 1839 } 1818 1840 return(NULL); … … 2461 2483 } 2462 2484 2485 char *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 2463 2499 char *owl_command_search(int argc, char **argv, char *buff) 2464 2500 { … … 2580 2616 cmd = owl_message_get_attribute_value(m, "yescommand"); 2581 2617 if(!cmd) { 2582 owl_function_error("No yescommand!");2618 owl_function_error("No 'yes' command!"); 2583 2619 return; 2584 2620 } … … 2614 2650 cmd = owl_message_get_attribute_value(m, "nocommand"); 2615 2651 if(!cmd) { 2616 owl_function_error("No nocommand!");2652 owl_function_error("No 'no' command!"); 2617 2653 return; 2618 2654 }
Note: See TracChangeset
for help on using the changeset viewer.