Changeset bde7714 for commands.c
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.