فهرست منبع

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

svn: 1373
Bryan Drewery 21 سال پیش
والد
کامیت
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.
    Using the comment 'none' will clear a user's comment.
 ::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
    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>
     Deleted bots that are running will be killed.
   
+    'change' syntax is the same as 'add'
+
     'list' shows all the bots currently 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) {
 #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 */
 #ifdef HUB
     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 : "");
 #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;
 
     nick = newsplit(&par);
     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;
     }
 
@@ -1860,7 +1860,10 @@ static void cmd_conf(int idx, char *par)
       ipsix = newsplit(&par);
 
     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);
     save++;
   } else if (!egg_strcasecmp(cmd, "del")) {