Просмотр исходного кода

* Work on cmd_conf change, NOT FINISHED -- FIXME --

svn: 1373
Bryan Drewery 21 лет назад
Родитель
Сommit
d17f719e37
2 измененных файлов с 10 добавлено и 5 удалено
  1. 3 1
      misc/help.txt
  2. 7 4
      src/cmds.c

+ 3 - 1
misc/help.txt

@@ -684,7 +684,7 @@ See also: echo, page, strip
    be seen via 'whois' or 'match'. Non-masters cannot see the comment field.
    be seen via 'whois' or 'match'. Non-masters cannot see the comment field.
    Using the comment 'none' will clear a user's comment.
    Using the comment 'none' will clear a user's comment.
 ::conf:
 ::conf:
-###  $bconf$b <add|del|list|set> [options]
+###  $bconf$b <add|del|change|list|set> [options]
  
  
    This command is used to modify the bot's local shell config. Only
    This command is used to modify the bot's local shell config. Only
    the first bot listed will be able to perform this command. Using the cmd
    the first bot listed will be able to perform this command. Using the cmd
@@ -704,6 +704,8 @@ See also: echo, page, strip
       del <bot>
       del <bot>
     Deleted bots that are running will be killed.
     Deleted bots that are running will be killed.
   
   
+    'change' syntax is the same as 'add'
+
     'list' shows all the bots currently in the config.
     'list' shows all the bots currently in the config.
  
  
     'set' allows changing some variables in the config.
     'set' allows changing some variables in the config.

+ 7 - 4
src/cmds.c

@@ -1833,7 +1833,7 @@ static void cmd_conf(int idx, char *par)
 
 
   if (!cmd) {
   if (!cmd) {
 #ifdef LEAF
 #ifdef LEAF
-    dprintf(idx, "Usage: conf <add|del|list|set> [options]\n");
+    dprintf(idx, "Usage: conf <add|del|change|list|set> [options]\n");
 #endif /* LEAF */
 #endif /* LEAF */
 #ifdef HUB
 #ifdef HUB
     dprintf(idx, "Usage: conf <set> [options]\n");
     dprintf(idx, "Usage: conf <set> [options]\n");
@@ -1843,12 +1843,12 @@ static void cmd_conf(int idx, char *par)
   
   
   putlog(LOG_CMDS, "*", "#%s# conf %s %s", dcc[idx].nick, cmd, par[0] ? par : "");
   putlog(LOG_CMDS, "*", "#%s# conf %s %s", dcc[idx].nick, cmd, par[0] ? par : "");
 #ifdef LEAF
 #ifdef LEAF
-  if (!egg_strcasecmp(cmd, "add")) {
+  if (!egg_strcasecmp(cmd, "add") || !egg_strcasecmp(cmd, "change")) {
     char *nick = NULL, *host = NULL, *ip = NULL, *ipsix = NULL;
     char *nick = NULL, *host = NULL, *ip = NULL, *ipsix = NULL;
 
 
     nick = newsplit(&par);
     nick = newsplit(&par);
     if (!nick || (nick && !nick[0])) {
     if (!nick || (nick && !nick[0])) {
-      dprintf(idx, "Usage: conf add <bot> [<ip|.> <[+]host|.> [ipv6-ip]]\n");
+      dprintf(idx, "Usage: conf %s <bot> [<ip|.> <[+]host|.> [ipv6-ip]]\n", cmd);
       return;
       return;
     }
     }
 
 
@@ -1860,7 +1860,10 @@ static void cmd_conf(int idx, char *par)
       ipsix = newsplit(&par);
       ipsix = newsplit(&par);
 
 
     conf_addbot(nick, ip, host, ipsix);
     conf_addbot(nick, ip, host, ipsix);
-    dprintf(idx, "Added bot: %s\n", nick);
+    if (cmd[0] == 'a' || cmd[0] == 'A')
+      dprintf(idx, "Added bot: %s\n", nick);
+    else
+      dprintf(idx, "Changed bot: %s\n", nick);
     listbot = strdup(nick);
     listbot = strdup(nick);
     save++;
     save++;
   } else if (!egg_strcasecmp(cmd, "del")) {
   } else if (!egg_strcasecmp(cmd, "del")) {