Changeset 7360fab for commands.c
- Timestamp:
- Jun 29, 2002, 1:21:36 PM (23 years ago)
- Branches:
- master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- d36f2cb
- Parents:
- 855ebe7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
commands.c
rb950088 r7360fab 195 195 OWLCMD_ARGS("next", owl_command_next, OWL_CTX_INTERACTIVE, 196 196 "move the pointer to the next message", 197 "recv:next [ --filter <name> ] [ --skip-deleted ] [ --last-if-none ]", 197 "recv:next [ --filter <name> ] [ --skip-deleted ] [ --last-if-none ]\n" 198 " [ --smart-filter | --smart-filter-instance ]", 198 199 "Moves the pointer to the next message in the current view.\n" 199 200 "If --filter is specified, will only consider messages in\n" 200 201 "the filter <name>.\n" 202 "If --smart-filter or --smart-filter-instance is specified,\n" 203 "goes to the next message that is similar to the current message.\n" 201 204 "If --skip-deleted is specified, deleted messages will\n" 202 205 "be skipped.\n" … … 207 210 OWLCMD_ARGS("prev", owl_command_prev, OWL_CTX_INTERACTIVE, 208 211 "move the pointer to the previous message", 209 "recv:prev [ --filter <name> ] [ --skip-deleted ] [ --first-if-none ]", 212 "recv:prev [ --filter <name> ] [ --skip-deleted ] [ --first-if-none ]\n" 213 " [ --smart-filter | --smart-filter-instance ]", 210 214 "Moves the pointer to the next message in the current view.\n" 211 215 "If --filter is specified, will only consider messages in\n" 212 216 "the filter <name>.\n" 217 "If --smart-filter or --smart-filter-instance is specified,\n" 218 "goes to the previous message that is similar to the current message.\n" 213 219 "If --skip-deleted is specified, deleted messages will\n" 214 220 "be skipped.\n" … … 366 372 OWLCMD_ARGS("smartnarrow", owl_command_smartnarrow, OWL_CTX_INTERACTIVE, 367 373 "view only messages similar to the current message", 368 "smartnarrow [-i ]",374 "smartnarrow [-i | --instance]", 369 375 "If the curmsg is a personal message narrow\n" 370 376 " to the converstaion with that user.\n" … … 375 381 "If the curmsg is a class message and '-i' is specied\n" 376 382 " then narrow to the class, instance\n"), 383 384 OWLCMD_ARGS("smartfilter", owl_command_smartfilter, OWL_CTX_INTERACTIVE, 385 "returns the name of a filter based on the current message", 386 "smartfilter [-i | --instance]", 387 "If the curmsg is a personal message, the filter is\n" 388 " the converstaion with that user.\n" 389 "If the curmsg is a class message, instance foo, recip *\n" 390 " message, the filter is the class, inst.\n" 391 "If the curmsg is a class message, the filter is that class.\n" 392 "If the curmsg is a class message and '-i' is specied\n" 393 " the filter is that <class,instance> pair\n"), 377 394 378 395 OWLCMD_ARGS("viewclass", owl_command_viewclass, OWL_CTX_INTERACTIVE, … … 672 689 argc-=1; argv+=1; 673 690 } else if (argc>=2 && !strcmp(argv[1], "--filter")) { 674 filter = argv[2]; 691 filter = owl_strdup(argv[2]); 692 argc-=2; argv+=2; 693 } else if (argc>=2 && !strcmp(argv[1], "--smart-filter")) { 694 filter = owl_function_smartfilter(0); 695 argc-=2; argv+=2; 696 } else if (argc>=2 && !strcmp(argv[1], "--smart-filter-instance")) { 697 filter = owl_function_smartfilter(1); 675 698 argc-=2; argv+=2; 676 699 } else { … … 680 703 } 681 704 owl_function_nextmsg_full(filter, skip_deleted, last_if_none); 705 if (filter) owl_free(filter); 682 706 return(NULL); 683 707 } … … 694 718 argc-=1; argv+=1; 695 719 } else if (argc>=2 && !strcmp(argv[1], "--filter")) { 696 filter = argv[2];720 filter = owl_strdup(argv[2]); 697 721 argc-=2; argv+=2; 698 } else { 722 } else if (argc>=2 && !strcmp(argv[1], "--smart-filter")) { 723 filter = owl_function_smartfilter(0); 724 argc-=2; argv+=2; 725 } else if (argc>=2 && !strcmp(argv[1], "--smart-filter-instance")) { 726 filter = owl_function_smartfilter(1); 727 argc-=2; argv+=2; 728 } else { 699 729 owl_function_makemsg("Invalid arguments to command 'prev'."); 700 730 return(NULL); … … 702 732 } 703 733 owl_function_prevmsg_full(filter, skip_deleted, first_if_none); 734 if (filter) owl_free(filter); 704 735 return(NULL); 705 736 } 706 737 707 738 char *owl_command_smartnarrow(int argc, char **argv, char *buff) { 739 char *filtname = NULL; 740 708 741 if (argc == 1) { 709 owl_function_smartnarrow(0);710 } else if (argc == 2 && !strcmp(argv[1], "-i")) {711 owl_function_smartnarrow(1);742 filtname = owl_function_smartfilter(0); 743 } else if (argc == 2 && (!strcmp(argv[1], "-i") || !strcmp(argv[1], "--instance"))) { 744 filtname = owl_function_smartfilter(1); 712 745 } else { 713 746 owl_function_makemsg("Wrong number of arguments for %s", argv[0]); 714 747 } 715 return NULL; 748 if (filtname) { 749 owl_function_change_view(filtname); 750 owl_free(filtname); 751 } 752 return NULL; 753 } 754 755 char *owl_command_smartfilter(int argc, char **argv, char *buff) { 756 char *filtname = NULL; 757 758 if (argc == 1) { 759 filtname = owl_function_smartfilter(0); 760 } else if (argc == 2 && (!strcmp(argv[1], "-i") || !strcmp(argv[1], "--instance"))) { 761 filtname = owl_function_smartfilter(1); 762 } else { 763 owl_function_makemsg("Wrong number of arguments for %s", argv[0]); 764 } 765 return filtname; 716 766 } 717 767 … … 1183 1233 1184 1234 char *owl_command_viewclass(int argc, char **argv, char *buff) { 1235 char *filtname; 1185 1236 if (argc!=2) { 1186 1237 owl_function_makemsg("Wrong number of arguments to viewclass command"); 1187 1238 return NULL; 1188 1239 } 1189 owl_function_fastclassinstfilt(argv[1], NULL); 1240 filtname = owl_function_fastclassinstfilt(argv[1], NULL); 1241 owl_function_change_view(filtname); 1242 owl_free(filtname); 1190 1243 return NULL; 1191 1244 } 1192 1245 1193 1246 char *owl_command_viewuser(int argc, char **argv, char *buff) { 1247 char *filtname; 1194 1248 if (argc!=2) { 1195 1249 owl_function_makemsg("Wrong number of arguments to viewuser command"); 1196 1250 return NULL; 1197 1251 } 1198 owl_function_fastuserfilt(argv[1]); 1252 filtname = owl_function_fastuserfilt(argv[1]); 1253 owl_function_change_view(filtname); 1254 owl_free(filtname); 1199 1255 return NULL; 1200 1256 } … … 1233 1289 } 1234 1290 1235 if (argc==3 && !strcmp(argv[1], "-id")) {1291 if (argc==3 && (!strcmp(argv[1], "-id") || !strcmp(argv[1], "--id"))) { 1236 1292 owl_function_delete_by_id(atoi(argv[2]), 1); 1237 1293 return NULL; … … 1261 1317 } 1262 1318 1263 if (argc==3 && !strcmp(argv[1], "-id")) {1319 if (argc==3 && (!strcmp(argv[1], "-id") || !strcmp(argv[1], "--id"))) { 1264 1320 owl_function_delete_by_id(atoi(argv[2]), 0); 1265 1321 return NULL;
Note: See TracChangeset
for help on using the changeset viewer.