Changeset 7869e48 for commands.c
- Timestamp:
- Jan 12, 2013, 1:43:13 PM (11 years ago)
- Children:
- e3a0d71, 4485285
- Parents:
- 4626016
- git-author:
- Jason Gross <jgross@mit.edu> (01/12/13 13:13:18)
- git-committer:
- Jason Gross <jgross@mit.edu> (01/12/13 13:43:13)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
commands.c
r39a531d r7869e48 69 69 "", 70 70 ""), 71 71 72 72 OWLCMD_ARGS("start-command", owl_command_start_command, OWL_CTX_INTERACTIVE, 73 73 "prompts the user to enter a command", … … 125 125 "send an AIM message", 126 126 "aimwrite <user> [-m <message...>]", 127 "Send an aim message to a user.\n\n" 127 "Send an aim message to a user.\n\n" 128 128 "The following options are available:\n\n" 129 129 "-m Specifies a message to send without prompting.\n"), … … 139 139 "Behaves like zwrite but uses encryption. Not for use with\n" 140 140 "personal messages\n"), 141 141 142 142 OWLCMD_ARGS("reply", owl_command_reply, OWL_CTX_INTERACTIVE, 143 143 "reply to the current message", … … 217 217 OWLCMD_VOID("unsuball", owl_command_unsuball, OWL_CTX_ANY, 218 218 "unsubscribe from all zephyrs", "", ""), 219 219 220 220 OWLCMD_VOID("getsubs", owl_command_getsubs, OWL_CTX_ANY, 221 221 "print all current subscriptions", … … 299 299 "display detailed information about the current message", 300 300 "", ""), 301 301 302 302 OWLCMD_ARGS("help", owl_command_help, OWL_CTX_INTERACTIVE, 303 303 "display help on using BarnOwl", … … 330 330 "scrolls receive window to specified position", "", ""), 331 331 332 OWLCMD_VOID("recv:pagedown", owl_function_mainwin_pagedown, 332 OWLCMD_VOID("recv:pagedown", owl_function_mainwin_pagedown, 333 333 OWL_CTX_INTERACTIVE, 334 334 "scrolls down by a page", "", ""), … … 346 346 347 347 OWLCMD_INT ("recv:scroll", owl_function_page_curmsg, OWL_CTX_INTERACTIVE, 348 "scrolls current message up or down", 349 "recv:scroll <numlines>", 348 "scrolls current message up or down", 349 "recv:scroll <numlines>", 350 350 "Scrolls the current message up or down by <numlines>.\n" 351 351 "Scrolls up if <numlines> is negative, else scrolls down.\n"), … … 396 396 397 397 OWLCMD_VOID("last", owl_command_last, OWL_CTX_INTERACTIVE, 398 "move the pointer to the last message", "", 398 "move the pointer to the last message", "", 399 399 "Moves the pointer to the last message in the view.\n" 400 400 "If we are already at the last message in the view,\n" … … 509 509 OWLCMD_VOID("status", owl_command_status, OWL_CTX_ANY, 510 510 "print status information about the running BarnOwl", "", ""), 511 511 512 512 OWLCMD_ARGS("zlocate", owl_command_zlocate, OWL_CTX_INTERACTIVE, 513 513 "locate a user", 514 "zlocate [-d] <user> ...", 514 "zlocate [-d] <user> ...", 515 515 "Performs a zlocate on one ore more users and puts the result\n" 516 516 "int a popwin. If -d is specified, does not authenticate\n" 517 517 "the lookup request.\n"), 518 518 519 519 OWLCMD_ARGS("filter", owl_command_filter, OWL_CTX_ANY, 520 520 "create a message filter", … … 674 674 "Show errors will show a list of errors encountered by BarnOwl.\n\n" 675 675 "SEE ALSO: filter, view, alias, bindkey, help\n"), 676 676 677 677 OWLCMD_ARGS("delete", owl_command_delete, OWL_CTX_INTERACTIVE, 678 678 "mark a message for deletion", … … 799 799 /****************************************************************/ 800 800 801 OWLCMD_VOID_CTX("edit:move-next-word", owl_editwin_move_to_nextword, 801 OWLCMD_VOID_CTX("edit:move-next-word", owl_editwin_move_to_nextword, 802 802 OWL_CTX_EDIT, 803 803 "moves cursor forward a word", 804 804 "", ""), 805 805 806 OWLCMD_VOID_CTX("edit:move-prev-word", owl_editwin_move_to_previousword, 806 OWLCMD_VOID_CTX("edit:move-prev-word", owl_editwin_move_to_previousword, 807 807 OWL_CTX_EDIT, 808 808 "moves cursor backwards a word", … … 814 814 "", ""), 815 815 816 OWLCMD_VOID_CTX("edit:move-to-buffer-end", owl_editwin_move_to_end, 816 OWLCMD_VOID_CTX("edit:move-to-buffer-end", owl_editwin_move_to_end, 817 817 OWL_CTX_EDIT, 818 818 "moves cursor to the bottom right (end) of the buffer", 819 819 "", ""), 820 820 821 OWLCMD_VOID_CTX("edit:move-to-line-end", owl_editwin_move_to_line_end, 821 OWLCMD_VOID_CTX("edit:move-to-line-end", owl_editwin_move_to_line_end, 822 822 OWL_CTX_EDIT, 823 823 "moves cursor to the end of the line", 824 824 "", ""), 825 825 826 OWLCMD_VOID_CTX("edit:move-to-line-start", owl_editwin_move_to_line_start, 826 OWLCMD_VOID_CTX("edit:move-to-line-start", owl_editwin_move_to_line_start, 827 827 OWL_CTX_EDIT, 828 828 "moves cursor to the beginning of the line", 829 829 "", ""), 830 830 831 OWLCMD_VOID_CTX("edit:move-left", owl_editwin_key_left, 831 OWLCMD_VOID_CTX("edit:move-left", owl_editwin_key_left, 832 832 OWL_CTX_EDIT, 833 833 "moves the cursor left by a character", … … 854 854 "", ""), 855 855 856 OWLCMD_VOID_CTX("edit:delete-next-char", owl_editwin_delete_char, 856 OWLCMD_VOID_CTX("edit:delete-next-char", owl_editwin_delete_char, 857 857 OWL_CTX_EDIT, 858 858 "deletes the character to the right of the cursor", … … 864 864 "", ""), 865 865 866 OWLCMD_VOID_CTX("edit:delete-all", owl_editwin_clear, 866 OWLCMD_VOID_CTX("edit:delete-all", owl_editwin_clear, 867 867 OWL_CTX_EDIT, 868 868 "deletes all of the contents of the buffer", … … 874 874 "", ""), 875 875 876 OWLCMD_VOID_CTX("edit:fill-paragraph", owl_editwin_fill_paragraph, 876 OWLCMD_VOID_CTX("edit:fill-paragraph", owl_editwin_fill_paragraph, 877 877 OWL_CTX_EDIT, 878 878 "fills the current paragraph to line-wrap well", 879 879 "", ""), 880 880 881 OWLCMD_VOID_CTX("edit:recenter", owl_editwin_recenter, 881 OWLCMD_VOID_CTX("edit:recenter", owl_editwin_recenter, 882 882 OWL_CTX_EDIT, 883 883 "recenters the buffer", 884 884 "", ""), 885 885 886 OWLCMD_ARGS_CTX("edit:insert-text", owl_command_edit_insert_text, 886 OWLCMD_ARGS_CTX("edit:insert-text", owl_command_edit_insert_text, 887 887 OWL_CTX_EDIT, 888 888 "inserts text into the buffer", 889 889 "edit:insert-text <text>", ""), 890 890 891 OWLCMD_VOID_CTX("edit:cancel", owl_command_edit_cancel, 891 OWLCMD_VOID_CTX("edit:cancel", owl_command_edit_cancel, 892 892 OWL_CTX_EDIT, 893 893 "cancels the current command", 894 894 "", ""), 895 895 896 OWLCMD_VOID_CTX("edit:history-next", owl_command_edit_history_next, 896 OWLCMD_VOID_CTX("edit:history-next", owl_command_edit_history_next, 897 897 OWL_CTX_EDIT, 898 898 "replaces the text with the next history", 899 899 "", ""), 900 900 901 OWLCMD_VOID_CTX("edit:history-prev", owl_command_edit_history_prev, 901 OWLCMD_VOID_CTX("edit:history-prev", owl_command_edit_history_prev, 902 902 OWL_CTX_EDIT, 903 903 "replaces the text with the previous history", … … 932 932 OWLCMD_ALIAS ("editresponse:done", "edit:done"), 933 933 934 OWLCMD_VOID_CTX("edit:move-up-line", owl_editwin_key_up, 934 OWLCMD_VOID_CTX("edit:move-up-line", owl_editwin_key_up, 935 935 OWL_CTX_EDITMULTI, 936 936 "moves the cursor up one line", 937 937 "", ""), 938 938 939 OWLCMD_VOID_CTX("edit:move-down-line", owl_editwin_key_down, 939 OWLCMD_VOID_CTX("edit:move-down-line", owl_editwin_key_down, 940 940 OWL_CTX_EDITMULTI, 941 941 "moves the cursor down one line", 942 942 "", ""), 943 943 944 OWLCMD_VOID_CTX("edit:done", owl_command_edit_done, 944 OWLCMD_VOID_CTX("edit:done", owl_command_edit_done, 945 945 OWL_CTX_EDIT, 946 946 "Finishes entering text in the editwin.", 947 947 "", ""), 948 948 949 OWLCMD_VOID_CTX("edit:done-or-delete", owl_command_edit_done_or_delete, 949 OWLCMD_VOID_CTX("edit:done-or-delete", owl_command_edit_done_or_delete, 950 950 OWL_CTX_EDITMULTI, 951 951 "completes the command, but only if at end of message", 952 "", 952 "", 953 953 "If only whitespace is to the right of the cursor,\n" 954 954 "runs 'edit:done'.\n"\ … … 971 971 /****************************************************************/ 972 972 973 OWLCMD_VOID_CTX("popless:scroll-down-page", owl_viewwin_pagedown, 973 OWLCMD_VOID_CTX("popless:scroll-down-page", owl_viewwin_pagedown, 974 974 OWL_CTX_POPLESS, 975 975 "scrolls down one page", 976 976 "", ""), 977 977 978 OWLCMD_VOID_CTX("popless:scroll-down-line", owl_viewwin_linedown, 978 OWLCMD_VOID_CTX("popless:scroll-down-line", owl_viewwin_linedown, 979 979 OWL_CTX_POPLESS, 980 980 "scrolls down one line", 981 981 "", ""), 982 982 983 OWLCMD_VOID_CTX("popless:scroll-up-page", owl_viewwin_pageup, 983 OWLCMD_VOID_CTX("popless:scroll-up-page", owl_viewwin_pageup, 984 984 OWL_CTX_POPLESS, 985 985 "scrolls up one page", 986 986 "", ""), 987 987 988 OWLCMD_VOID_CTX("popless:scroll-up-line", owl_viewwin_lineup, 988 OWLCMD_VOID_CTX("popless:scroll-up-line", owl_viewwin_lineup, 989 989 OWL_CTX_POPLESS, 990 990 "scrolls up one line", 991 991 "", ""), 992 992 993 OWLCMD_VOID_CTX("popless:scroll-to-top", owl_viewwin_top, 993 OWLCMD_VOID_CTX("popless:scroll-to-top", owl_viewwin_top, 994 994 OWL_CTX_POPLESS, 995 995 "scrolls to the top of the buffer", 996 996 "", ""), 997 997 998 OWLCMD_VOID_CTX("popless:scroll-to-bottom", owl_viewwin_bottom, 998 OWLCMD_VOID_CTX("popless:scroll-to-bottom", owl_viewwin_bottom, 999 999 OWL_CTX_POPLESS, 1000 1000 "scrolls to the bottom of the buffer", 1001 1001 "", ""), 1002 1002 1003 OWLCMD_INT_CTX ("popless:scroll-right", owl_viewwin_right, 1003 OWLCMD_INT_CTX ("popless:scroll-right", owl_viewwin_right, 1004 1004 OWL_CTX_POPLESS, 1005 1005 "scrolls right in the buffer", 1006 1006 "popless:scroll-right <num-chars>", ""), 1007 1007 1008 OWLCMD_INT_CTX ("popless:scroll-left", owl_viewwin_left, 1008 OWLCMD_INT_CTX ("popless:scroll-left", owl_viewwin_left, 1009 1009 OWL_CTX_POPLESS, 1010 1010 "scrolls left in the buffer", 1011 1011 "popless:scroll-left <num-chars>", ""), 1012 1012 1013 OWLCMD_VOID_CTX("popless:quit", owl_command_popless_quit, 1013 OWLCMD_VOID_CTX("popless:quit", owl_command_popless_quit, 1014 1014 OWL_CTX_POPLESS, 1015 1015 "exits the popless window", … … 1066 1066 return NULL; 1067 1067 } 1068 1068 1069 1069 owl_function_help_for_command(argv[1]); 1070 1070 return NULL; … … 1252 1252 { 1253 1253 char *filename; 1254 1254 1255 1255 if (argc!=2) { 1256 1256 owl_function_makemsg("usage: dump <filename>"); … … 1281 1281 if (argc>=1 && !strcmp(argv[1], "--skip-deleted")) { 1282 1282 skip_deleted=1; 1283 argc-=1; argv+=1; 1283 argc-=1; argv+=1; 1284 1284 } else if (argc>=1 && !strcmp(argv[1], "--last-if-none")) { 1285 1285 last_if_none=1; 1286 argc-=1; argv+=1; 1286 argc-=1; argv+=1; 1287 1287 } else if (argc>=2 && !strcmp(argv[1], "--filter")) { 1288 1288 filter = g_strdup(argv[2]); 1289 argc-=2; argv+=2; 1289 argc-=2; argv+=2; 1290 1290 } else if (argc>=2 && !strcmp(argv[1], "--smart-filter")) { 1291 1291 filter = owl_function_smartfilter(0, 0); 1292 argc-=2; argv+=2; 1292 argc-=2; argv+=2; 1293 1293 } else if (argc>=2 && !strcmp(argv[1], "--smart-filter-instance")) { 1294 1294 filter = owl_function_smartfilter(1, 0); 1295 argc-=2; argv+=2; 1295 argc-=2; argv+=2; 1296 1296 } else { 1297 1297 owl_function_makemsg("Invalid arguments to command 'next'."); … … 1311 1311 if (argc>=1 && !strcmp(argv[1], "--skip-deleted")) { 1312 1312 skip_deleted=1; 1313 argc-=1; argv+=1; 1313 argc-=1; argv+=1; 1314 1314 } else if (argc>=1 && !strcmp(argv[1], "--first-if-none")) { 1315 1315 first_if_none=1; 1316 argc-=1; argv+=1; 1316 argc-=1; argv+=1; 1317 1317 } else if (argc>=2 && !strcmp(argv[1], "--filter")) { 1318 1318 filter = g_strdup(argv[2]); 1319 argc-=2; argv+=2; 1319 argc-=2; argv+=2; 1320 1320 } else if (argc>=2 && !strcmp(argv[1], "--smart-filter")) { 1321 1321 filter = owl_function_smartfilter(0, 0); 1322 argc-=2; argv+=2; 1322 argc-=2; argv+=2; 1323 1323 } else if (argc>=2 && !strcmp(argv[1], "--smart-filter-instance")) { 1324 1324 filter = owl_function_smartfilter(1, 0); 1325 argc-=2; argv+=2; 1325 argc-=2; argv+=2; 1326 1326 } else { 1327 1327 owl_function_makemsg("Invalid arguments to command 'prev'."); … … 1387 1387 filtname = owl_function_smartfilter(1, 0); 1388 1388 } else { 1389 owl_function_makemsg("Wrong number of arguments for %s", argv[0]); 1389 owl_function_makemsg("Wrong number of arguments for %s", argv[0]); 1390 1390 } 1391 1391 return filtname; … … 1582 1582 owl_function_printallvars(); 1583 1583 return NULL; 1584 } 1584 } 1585 1585 1586 1586 if (argc > 1 && !strcmp("-q",argv[1])) { … … 1656 1656 1657 1657 var=argv[1]; 1658 1658 1659 1659 v = owl_variable_get_var(owl_global_get_vardict(&g), var); 1660 1660 if (v) { … … 1708 1708 int i; 1709 1709 if (argc < 2) { 1710 owl_function_makemsg("Invalid arguments to 'multi' command."); 1710 owl_function_makemsg("Invalid arguments to 'multi' command."); 1711 1711 return NULL; 1712 1712 } … … 1718 1718 break; 1719 1719 } else if (newbuff[i] != ' ') { 1720 owl_function_makemsg("Invalid arguments to 'multi' command."); 1720 owl_function_makemsg("Invalid arguments to 'multi' command."); 1721 1721 g_free(newbuff); 1722 1722 return NULL; … … 2012 2012 const char *const *myargv; 2013 2013 int myargc; 2014 2014 2015 2015 if (!owl_global_is_aimloggedin(&g)) { 2016 2016 owl_function_error("You are not logged in to AIM."); … … 2064 2064 { 2065 2065 int edit=0; 2066 2066 2067 2067 if (argc>=2 && !strcmp("-e", argv[1])) { 2068 2068 edit=1; … … 2071 2071 } 2072 2072 2073 if ((argc==1) || (argc==2 && !strcmp(argv[1], "all"))) { 2073 if ((argc==1) || (argc==2 && !strcmp(argv[1], "all"))) { 2074 2074 owl_function_reply(0, !edit); 2075 2075 } else if (argc==2 && !strcmp(argv[1], "sender")) { … … 2078 2078 const owl_message *m; 2079 2079 const owl_view *v; 2080 v = owl_global_get_current_view(&g); 2080 v = owl_global_get_current_view(&g); 2081 2081 m = owl_view_get_element(v, owl_global_get_curmsg(&g)); 2082 2082 if (m) owl_zephyr_zaway(m); … … 2096 2096 { 2097 2097 int auth; 2098 2098 2099 2099 if (argc<2) { 2100 2100 owl_function_makemsg("Too few arguments for zlocate command"); … … 2212 2212 return(NULL); 2213 2213 } 2214 2214 2215 2215 } 2216 2216 return(NULL); … … 2230 2230 owl_function_show_filter(argv[2]); 2231 2231 } 2232 } else if (argc==2 2232 } else if (argc==2 2233 2233 && (!strcmp(argv[1], "zpunts") || !strcmp(argv[1], "zpunted"))) { 2234 2234 owl_function_show_zpunts(); … … 2275 2275 } else if (!strcmp(argv[1], "startup")) { 2276 2276 const char *filename; 2277 2277 2278 2278 filename=owl_global_get_startupfile(&g); 2279 2279 owl_function_popless_file(filename); … … 2332 2332 if (argc>1 && !strcmp(argv[1], "--no-move")) { 2333 2333 move_after = 0; 2334 argc--; 2334 argc--; 2335 2335 argv++; 2336 2336 } … … 2393 2393 if (argc>1 && !strcmp(argv[1], "--no-move")) { 2394 2394 move_after = 0; 2395 argc--; 2395 argc--; 2396 2396 argv++; 2397 2397 } … … 2434 2434 { 2435 2435 char *filtname; 2436 2436 2437 2437 if (argc < 3 || argc > 4) { 2438 2438 owl_function_makemsg("Wrong number of arguments to colorclass command"); … … 2504 2504 owl_function_smartzpunt(1); 2505 2505 } else { 2506 owl_function_makemsg("Wrong number of arguments for %s", argv[0]); 2506 owl_function_makemsg("Wrong number of arguments for %s", argv[0]); 2507 2507 } 2508 2508 return NULL; … … 2598 2598 buffstart=skiptokens(buff, 2); 2599 2599 } 2600 2600 2601 2601 if (argc==1 || (argc==2 && !strcmp(argv[1], "-r"))) { 2602 2602 /* When continuing a search, don't consider the current message. */ … … 2606 2606 owl_function_search_helper(true, direction); 2607 2607 } 2608 2608 2609 2609 return(NULL); 2610 2610 } … … 2616 2616 buffstart=skiptokens(buff, 1); 2617 2617 owl_function_set_search(*buffstart ? buffstart : NULL); 2618 2618 2619 2619 return(NULL); 2620 2620 }
Note: See TracChangeset
for help on using the changeset viewer.