Changeset bde7714
- Timestamp:
- Sep 22, 2002, 3:20:00 PM (22 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:
- 5a6e6b9
- Parents:
- f9c43ae
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
rf9c43ae rbde7714 17 17 instances out for the 'reply' command. 18 18 Added -R/usr/athena/lib to the build for Athena 19 Started updating the intro document 20 Small changes to help / about 21 The 'subscribe' and 'unsubscribe' commands (and their aliases) now 22 update .zephyr.subs by default. If either is given the '-t' 23 (for "temporary") option the .zephyr.subs will not be updated 19 24 20 25 1.2.3 -
commands.c
r42abb10 rbde7714 132 132 OWLCMD_ARGS("subscribe", owl_command_subscribe, OWL_CTX_ANY, 133 133 "subscribe to a zephyr class, instance, recipient", 134 "subscribe <class> <instance> [recipient]",134 "subscribe [-t] <class> <instance> [recipient]", 135 135 "Subscribe the specified class and instance. If the recipient\n" 136 136 "is not listed on the command line it defaults\n" 137 "to * (the wildcard recipient).\n"), 137 "to * (the wildcard recipient). If the -t option is present\n" 138 "the subscription will only be temporary, i.e., it will not\n" 139 "be written to the subscription file and will therefore not\n" 140 "be present the next time owl is started.\n"), 138 141 OWLCMD_ALIAS("sub", "subscribe"), 139 142 140 143 OWLCMD_ARGS("unsubscribe", owl_command_unsubscribe, OWL_CTX_ANY, 141 144 "unsubscribe from a zephyr class, instance, recipient", 142 "unsubscribe <class> <instance> [recipient]",145 "unsubscribe [-t] <class> <instance> [recipient]", 143 146 "Unsubscribe from the specified class and instance. If the\n" 144 147 "recipient is not listed on the command line it defaults\n" 145 "to * (the wildcard recipient).\n"), 148 "to * (the wildcard recipient). If the -t option is present\n" 149 "the unsubscription will only be temporary, i.e., it will not\n" 150 "be updated in the subscription file and will therefore not\n" 151 "be in effect the next time owl is started.\n"), 146 152 OWLCMD_ALIAS("unsub", "unsubscribe"), 147 153 … … 724 730 } 725 731 726 char *owl_command_zlist(int argc, char **argv ) {732 char *owl_command_zlist(int argc, char **argv, char *buff) { 727 733 int elapsed=0, timesort=0; 728 734 char *file=NULL; … … 1131 1137 char *owl_command_subscribe(int argc, char **argv, char *buff) { 1132 1138 char *recip=""; 1133 1139 int temp=0; 1140 1134 1141 if (argc<3) { 1135 1142 owl_function_makemsg("Not enough arguments to the subscribe command"); 1136 return NULL; 1137 } else if (argc>4) { 1143 return(NULL); 1144 } 1145 argc--; 1146 argv++; 1147 1148 if (!strcmp(argv[0], "-t")) { 1149 temp=1; 1150 argc--; 1151 argv++; 1152 } 1153 if (argc<2) { 1154 owl_function_makemsg("Not enough arguments to the subscribe command"); 1155 return(NULL); 1156 } 1157 1158 if (argc>3) { 1138 1159 owl_function_makemsg("Too many arguments to the subscribe command"); 1139 return NULL;1140 } 1141 1142 if (argc== 3) {1160 return(NULL); 1161 } 1162 1163 if (argc==2) { 1143 1164 recip=""; 1144 } else if (argc==4) { 1145 recip=argv[3]; 1146 } 1147 1148 owl_function_subscribe(argv[1], argv[2], recip); 1149 return NULL; 1165 } else if (argc==3) { 1166 recip=argv[2]; 1167 } 1168 1169 owl_function_subscribe(argv[0], argv[1], recip); 1170 if (!temp) { 1171 owl_zephyr_addsub(NULL, argv[0], argv[1], recip); 1172 } 1173 return(NULL); 1150 1174 } 1151 1175 … … 1153 1177 char *owl_command_unsubscribe(int argc, char **argv, char *buff) { 1154 1178 char *recip=""; 1179 int temp=0; 1155 1180 1156 1181 if (argc<3) { 1157 1182 owl_function_makemsg("Not enough arguments to the unsubscribe command"); 1158 return NULL; 1159 } else if (argc>4) { 1183 return(NULL); 1184 } 1185 argc--; 1186 argv++; 1187 1188 if (!strcmp(argv[0], "-t")) { 1189 temp=1; 1190 argc--; 1191 argv++; 1192 } 1193 if (argc<2) { 1194 owl_function_makemsg("Not enough arguments to the subscribe command"); 1195 return(NULL); 1196 } 1197 1198 if (argc>3) { 1160 1199 owl_function_makemsg("Too many arguments to the unsubscribe command"); 1161 return NULL;1162 } 1163 1164 if (argc== 3) {1200 return(NULL); 1201 } 1202 1203 if (argc==2) { 1165 1204 recip=""; 1166 } else if (argc==4) { 1167 recip=argv[3]; 1168 } 1169 1170 owl_function_unsubscribe(argv[1], argv[2], recip); 1171 return NULL; 1205 } else if (argc==3) { 1206 recip=argv[2]; 1207 } 1208 1209 owl_function_unsubscribe(argv[0], argv[1], recip); 1210 if (!temp) { 1211 owl_zephyr_delsub(NULL, argv[0], argv[1], recip); 1212 } 1213 return(NULL); 1172 1214 } 1173 1215 … … 1675 1717 owl_global_set_needrefresh(&g); 1676 1718 } 1677 -
doc/intro.txt
r61d27fb rbde7714 1 2 $Id$ 3 4 5 Owl is a tty, curses-based zephyr client. This is a quick guide to 6 learning how to use it. 7 8 ==================== 9 OVERVIEW OF FEATURES 10 ==================== 11 o) As a tty client it can be run over telnet, rlogin or text ssh sessions 12 13 o) It uses a perl configuration file for setting preferences and 14 formatting messages 15 16 o) emacs style editing of messages 17 18 o) It is easy to use and runs without a configfile. 19 20 o) There will future support for AIM and ICQ 21 22 o) There will be future support for advanced sorting of messages 23 24 =============== 25 GETTING STARTED 26 =============== 1 ======================== 2 Quick Guide To Using Owl 3 ======================== 4 5 ======================= 6 Section 1: INTRODUCTION 7 ======================= 8 9 Owl is a tty, curses-based instant messaging client. This is a quick 10 guide to learning how to use it. Currently it supports only zephyr, 11 but other messaging protocols, including AIM and Jabber, are on the 12 way. Some major features of owl include: 13 14 o) As a tty client it can be run over telnet, rlogin or text ssh 15 sessions 16 17 o) It uses a perl configuration file for setting preferences and 18 formatting messages 19 20 o) Emacs style editing of messages 21 22 o) It is easy to use and runs without a configfile. 23 24 o) Advanced sorting and coloring of messages 25 26 ========================== 27 Section 2: GETTING STARTED 28 ========================== 29 27 30 Owl will run happily without a configfile, so to get started just run 28 it. Owl will take over the terminal window it's started in. 29 30 The Screen 31 ---------- 32 There are three main parts to the screen. The large top portion of 33 the screen is where zephyrs are displayed. The status bar separates 34 this area from the one below and displays some status information. 35 The space below that is used to type in messages and is also used by 36 owl to give warnings and information to the user. 31 the program. Owl will take over the terminal window it's started in, 32 so you may wish to have another terminal around at the same time. 33 34 On Athena you can find owl in the ktools locker. So to run it you can 35 type: 36 37 add ktools 38 owl 39 40 at the Athena% prompt. If you wish to run the latest beta release of 41 owl type 'owl-beta' instead of 'owl'. 42 43 The Screen Layout 44 ----------------- 45 There are three main parts to the owl screen. The large top portion 46 of the screen is where zephyrs are displayed. The status bar 47 separates this area from the one below and displays some status 48 information. The space below that is used to type in messages and is 49 also used by owl to give warnings and information to the user. 50 51 On Line Help 52 ------------ 53 Owl has a full on line help system. Pressing the 'h' key will bring 54 up the basic help screen. Further help can be obtained using the help 55 command. 37 56 38 57 Sending a Zephyr 39 58 ---------------- 40 To send a zephyr to yourself hitthe 'z' key. This will start a59 To send a zephyr to yourself press the 'z' key. This will start a 41 60 zwrite command, which you can finish by typing the name of the user 42 61 you wish to send to, followed by enter. Begin typing your message. 43 62 You will notice that most emacs-style editing is available. When you 44 are ready to send t ype Control-D. If you wish to cancel type45 Control-C.46 47 If instead of a user you wish to send to class/instance simply supply48 -c and -i arguments to the zwrite command.63 are ready to send the message type Control-D or a dot ('.') on a line 64 by itself. If instead you wish to cancel the message type Control-C. 65 66 If you wish to send to a class/instance pair simply supply -c and -i 67 arguments to the zwrite command as you normally would. 49 68 50 69 Manipulating Messages … … 52 71 When there are one or more zephyrs in the message window, one of them 53 72 will be the 'current' message. Owl will indicate which one it is with 54 an arrow t o the left of the message. The following keys will move you55 between messages 73 an arrow that looks like this: -> . The following keys will move you 74 to different messages: 56 75 57 76 n move to the next non-deleted message … … 61 80 < move to the first message 62 81 > move to the last message 82 C-v page down 83 M-v page up 63 84 right scroll the screen to the right 64 85 left scroll the screen to the left 65 86 P move to the next personal message 66 87 M-P move to the previous personal message 67 T Mark all 'trash' messages for deletion68 88 69 89 When you are ready to delete a message you can mark it for deletion 70 90 and a 'D' will appear to the left of the message. Messages will not 71 actually be removed until you perform an expunge. 91 actually be removed until you perform an expunge. The following keys 92 are used to delete, undelete and expunge messages: 72 93 73 94 d mark a message for deletion 74 95 u unmark a message for deletion 75 96 x expunge deleted messages 76 T mark all automated messages for deletion 97 T mark all 'trash' messages for deletion 98 M-D mark all messages in the view for deletion 99 M-u unmark all messages in the view for deletion 77 100 78 101 If you would like to respond to a zephyr sent to you there is a reply 79 shortcut. This will reply to a personal zephyr, or if the zephyr is 80 sent to a zephyr class it will reply to the zephyr class. 81 82 r reply to a zephyr 83 84 You can scroll within the current message using: 102 shortcut. 103 104 r Reply. Personal zephyrs get a personal reply, 105 class/instance zephyrs get a public reply. 106 R Reply to sender. Always replies personally 107 to the user. 108 M-r Reply but allow editing of the command line. 109 M-R Reply to sender but allow editing of the 110 command line. 111 112 In the event that the current message is too large to fit on the 113 screen, you can scroll within the message using the following keys: 85 114 86 115 SPACE page down … … 89 118 BACKSPACE line up 90 119 91 The pointer will change to indicate that the message is not starting92 at the first line.120 The message pointer will change to indicate that the message is not 121 starting at the first line. 93 122 94 123 Two other keys that relate to the current message: … … 102 131 Some other funcions that can be performed with a single keystroke: 103 132 104 A toggle zaway 105 h print the help screen 133 A toggle zaway on or off 106 134 C-l refresh and resize the screen 107 135 C-z suspend … … 110 138 ------------ 111 139 Owl has a command mode where you can enter more detailed commands for 112 owl to process. To enter command mode:140 owl to process. To enter command press the color (':') key: 113 141 114 142 : begin command mode … … 116 144 Owl will give you a command prompt and you can begin typing your 117 145 command. Type Enter to execute the command, Control-C to cancel. 118 Currently support commands are: 119 120 quit , exit exit owl 121 zwrite send a zephyr 122 reply reply to the current zephyr 123 set set a variable 124 print print a variable 125 zlog [in|out] send a login or logout message 126 version print the owl version number 127 subscribe subscribe to a class, instance, recipient 128 unsubscribe unsubscribe from a class, instance, recipient 129 unsuball unsubscribe from all messagse 130 getsubs print a list of current subscriptions 131 zlocate locate a user 132 info print detailed information about a message 133 help print the help screen 134 next move to the next message 135 prev move to the previous message 136 next-notdel move to the next non-deleted message 137 prev-notdel move to the previous not-deleted message 138 expunge expunge messages marked for deletion 139 first move to the first message 140 last move to the last message 141 resize resize owl to the current window 142 suspend suspend owl 143 exec run a shell command 144 zaway [on|off|<msg>] Turn zaway on, off, or set the message 145 load-subs load subscriptions from a file 146 status print info about owl status 147 about print info about owl 146 There are many commands. The basic commands are listed on the basic 147 help screen (by pressing 'h'). If you'd like a list of all commands 148 you can use the command "show commands". To get detailed information 149 on the syntax and use of a command you can use the command 'help 150 <command>' as in: 151 152 help zwrite 148 153 149 154 Variables 150 155 --------- 151 The 'set' and 'print' commands let set and print the values of owl 152 variables. The currently supported variables are these: 153 154 Variables: 155 name settings default meaning 156 --------------- -------- ------- ------- 157 appendtosepbar <string> string to append to the end of the sepbar 158 bell on,off on enable / disable the terminal bell 159 burningears on,off off [NOT YET IMPLEMENTED] beep on messages matching patterns 160 classlogging on,off off turn class logging on or off 161 classpath <path> ~/zlog/class 162 path for logging class zephyrs 163 debug on,off on whether debugging is enabled 164 debug_file <path> /var/tmp/owldebug 165 path for logging debug messages when debugging is enabled 166 disable-ctrl-d on,off off don't send zephyrs on C-d 167 168 displayoutgoing on,off on display outgoing messages 169 logging on,off off turn personal logging on or off 170 loginsubs on,off on load logins from .anyone on startup 171 logpath <path> ~/zlog/people 172 path for logging personal zephyrs 173 personalbell on,off off ring the terminal bell when personal messages are receive 174 rxping on,off off display received pings 175 shutdownlogout on,off on send a logout message when owl exits 176 startuplogin on,off on send a login message when owl starts 177 summarymode on,off off [NOT YET IMPLEMENTED] 178 txping on,off on send pings 179 typewinsize int > 0 8 number of lines in the typing window 180 webbrowser none,netscape,galeon netscape web browser to use to launch URLs 181 zaway_msg <string> "I'm sorry..." 182 current zaway msg for responding to zephyrs when away 183 zaway_msg_default <string> "I'm sorry..." 184 default zaway msg for responding to zephyrs when away 185 zsig <string> zephyr signature 186 zsigproc <path> <null> name of a program to run that will generate zsigs 187 188 189 ================ 190 THE CONFIG FILE 191 ================ 156 157 Owl has a number of internal variables that can be used to change the 158 behavior the program. The 'print' command will let you view the value 159 of a variable and the 'set' commmand will let you set the value of a 160 variable. For example: 161 162 set personalbell on 163 164 will set the value of the variable 'personalbell' to on. The command: 165 166 print personalbell 167 168 will show you the current value. The 'print' command with no 169 arguments will show you the value of all variables. A list of all 170 variables is available on the basic help screen, or by using the 171 command "show variables". The command "show variable <variablename>" 172 will show you detailed information about a variable and how to use it. 173 As in: 174 175 show variable personalbell 176 177 ============================= 178 Section 3: FILTERS AND COLORS 179 ============================= 180 181 182 183 ========================== 184 Section 4: THE CONFIG FILE 185 ========================== 192 186 193 187 *** WARNING: This interface may change substantially in the near future *** … … 227 221 228 222 229 =================== 230 FURTHER INFORMATION 231 =================== 223 ============================== 224 Section 5: FURTHER INFORMATION 225 ============================== 226 227 $Id$ -
functions.c
rf9c43ae rbde7714 1065 1065 strcat(buff, "\nOwl was written by James Kretchmar at the Massachusetts\n"); 1066 1066 strcat(buff, "Institute of Technology. The first version, 0.5, was\n"); 1067 strcat(buff, "released in March 2002 \n");1067 strcat(buff, "released in March 2002.\n"); 1068 1068 strcat(buff, "\n"); 1069 1069 strcat(buff, "The name 'owl' was chosen in reference to the owls in the\n"); -
help.c
r65fc0900 rbde7714 63 63 " C-z Suspend\n" 64 64 " h Print this help message\n" 65 " : , M-x Enter one of the commands below\n"65 " : , M-x Enter command mode\n" 66 66 "\n\n" 67 67 ); -
zephyr.c
r56330ff rbde7714 408 408 } 409 409 } 410 411 void owl_zephyr_addsub(char *filename, char *class, char *inst, char *recip) { 412 char *line, subsfile[LINE], buff[LINE]; 413 FILE *file; 414 415 line=owl_zephyr_makesubline(class, inst, recip); 416 417 if (filename==NULL) { 418 sprintf(subsfile, "%s/%s", owl_global_get_homedir(&g), ".zephyr.subs"); 419 } else { 420 strcpy(subsfile, filename); 421 } 422 423 /* first check if it exists already */ 424 file=fopen(subsfile, "r"); 425 if (!file) { 426 owl_function_makemsg("Error opening file %s", subsfile); 427 owl_free(line); 428 return; 429 } 430 while (fgets(buff, LINE, file)!=NULL) { 431 if (!strcasecmp(buff, line)) { 432 owl_function_makemsg("Subscription already present in %s", subsfile); 433 owl_free(line); 434 return; 435 } 436 } 437 438 /* if we get here then we didn't find it */ 439 fclose(file); 440 file=fopen(subsfile, "a"); 441 if (!file) { 442 owl_function_makemsg("Error opening file %s for writing", subsfile); 443 owl_free(line); 444 return; 445 } 446 fputs(line, file); 447 fclose(file); 448 owl_function_makemsg("Subscription added"); 449 450 owl_free(line); 451 } 452 453 void owl_zephyr_delsub(char *filename, char *class, char *inst, char *recip) { 454 char *line, subsfile[LINE], buff[LINE], *text; 455 char backupfilename[LINE]; 456 FILE *file, *backupfile; 457 int size; 458 459 line=owl_zephyr_makesubline(class, inst, recip); 460 461 /* open the subsfile for reading */ 462 if (filename==NULL) { 463 sprintf(subsfile, "%s/%s", owl_global_get_homedir(&g), ".zephyr.subs"); 464 } else { 465 strcpy(subsfile, filename); 466 } 467 file=fopen(subsfile, "r"); 468 if (!file) { 469 owl_function_makemsg("Error opening file %s", subsfile); 470 owl_free(line); 471 return; 472 } 473 474 /* open the backup file for writing */ 475 sprintf(backupfilename, "%s.backup", subsfile); 476 backupfile=fopen(backupfilename, "w"); 477 if (!backupfile) { 478 owl_function_makemsg("Error opening file %s for writing", backupfilename); 479 owl_free(line); 480 return; 481 } 482 483 /* we'll read the entire file into memory, minus the line we don't want and 484 * and at the same time create a backup file */ 485 text=malloc(LINE); 486 size=LINE; 487 while (fgets(buff, LINE, file)!=NULL) { 488 /* if we don't match the line, add to text */ 489 if (strcasecmp(buff, line)) { 490 size+=LINE; 491 text=realloc(text, size); 492 strcat(text, buff); 493 } 494 495 /* write to backupfile */ 496 fputs(buff, backupfile); 497 } 498 fclose(backupfile); 499 fclose(file); 500 501 /* now open the original subs file for writing and write out the 502 * subs */ 503 file=fopen(subsfile, "w"); 504 if (!file) { 505 owl_function_makemsg("WARNING: Error opening %s to rewrite subscriptions. Use %s to restore", subsfile, backupfilename); 506 owl_function_beep(); 507 owl_free(line); 508 return; 509 } 510 511 fputs(text, file); 512 fclose(file); 513 owl_free(line); 514 515 owl_function_makemsg("Subscription removed"); 516 } 517 518 char *owl_zephyr_makesubline(char *class, char *inst, char *recip) { 519 /* caller must free the return */ 520 char *out; 521 522 out=owl_malloc(strlen(class)+strlen(inst)+strlen(recip)+30); 523 sprintf(out, "%s,%s,%s\n", class, inst, !strcmp(recip, "") ? "*" : recip); 524 return(out); 525 }
Note: See TracChangeset
for help on using the changeset viewer.