Changeset 6c56f42
- Timestamp:
- 2010-04-11T23:04:24Z (15 years ago)
- Branches:
- master
- Children:
- aa44bdd
- Parents:
- eabc9d2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
root_commands.c
reabc9d2 r6c56f42 92 92 void root_command( irc_t *irc, char *cmd[] ) 93 93 { 94 int i ;94 int i, len; 95 95 96 96 if( !cmd[0] ) 97 97 return; 98 98 99 len = strlen( cmd[0] ); 99 100 for( i = 0; commands[i].command; i++ ) 100 if( g_strcasecmp( commands[i].command, cmd[0] ) == 0 ) 101 { 101 if( g_strncasecmp( commands[i].command, cmd[0], len ) == 0 ) 102 { 103 if( commands[i+1].command && 104 g_strncasecmp( commands[i+1].command, cmd[0], len ) == 0 ) 105 /* Only match on the first letters if the match is unique. */ 106 break; 107 102 108 MIN_ARGS( commands[i].required_parameters ); 103 109 … … 1179 1185 #endif 1180 1186 1187 /* IMPORTANT: Keep this list sorted! The short command logic needs that. */ 1181 1188 const command_t commands[] = { 1189 { "account", 1, cmd_account, 0 }, 1190 { "add", 2, cmd_add, 0 }, 1191 { "drop", 1, cmd_drop, 0 }, 1182 1192 { "help", 0, cmd_help, 0 }, 1183 { "account", 1, cmd_account, 0 },1184 1193 { "identify", 1, cmd_identify, 0 }, 1194 { "no", 0, cmd_yesno, 0 }, 1185 1195 { "register", 1, cmd_register, 0 }, 1186 { "drop", 1, cmd_drop, 0 }, 1196 { "remove", 1, cmd_remove, 0 }, 1197 { "rename", 2, cmd_rename, 0 }, 1187 1198 { "save", 0, cmd_save, 0 }, 1188 { "add", 2, cmd_add, 0 },1189 { "remove", 1, cmd_remove, 0 },1190 #if 01191 { "info", 1, cmd_info, 0 },1192 #endif1193 { "rename", 2, cmd_rename, 0 },1194 #if 01195 { "block", 1, cmd_block, 0 },1196 { "allow", 1, cmd_allow, 0 },1197 #endif1198 1199 { "set", 0, cmd_set, 0 }, 1199 1200 { "yes", 0, cmd_yesno, 0 }, 1200 { "no", 0, cmd_yesno, 0 },1201 1201 #if 0 1202 { "allow", 1, cmd_allow, 0 }, 1202 1203 { "blist", 0, cmd_blist, 0 }, 1204 { "block", 1, cmd_block, 0 }, 1205 { "chat", 1, cmd_chat, 0 }, 1206 { "ft", 0, cmd_transfer, 0 }, 1207 { "info", 1, cmd_info, 0 }, 1208 { "join_chat", 2, cmd_join_chat, 0 }, 1203 1209 { "nick", 1, cmd_nick, 0 }, 1204 1210 { "qlist", 0, cmd_qlist, 0 }, 1205 { "join_chat", 2, cmd_join_chat, 0 },1206 { "chat", 1, cmd_chat, 0 },1207 1211 { "transfer", 0, cmd_transfer, 0 }, 1208 1212 #endif
Note: See TracChangeset
for help on using the changeset viewer.