Explorar o código

* Port [3750] to 1.2.15
* Bots can now be started as ./binary bot.conf instead of ./binary bot. (Disable autocron and manually crontab it to start like this)



svn: 3751

Bryan Drewery %!s(int64=18) %!d(string=hai) anos
pai
achega
3709f28731
Modificáronse 2 ficheiros con 9 adicións e 2 borrados
  1. 1 0
      doc/UPDATES
  2. 8 2
      src/main.c

+ 1 - 0
doc/UPDATES

@@ -29,6 +29,7 @@
 * Change default ip/host/ip6 to a * in the binary config
 * Silently fix user mistake of giving hostname in ip field in binary config
 * Fix datadir being expanded to full path (fixes #405)
+* Bots can now be started as ./binary bot.conf instead of ./binary bot. (Disable autocron and manually crontab it to start like this)
 
 1.2.14 - http://wraith.botpack.net/milestone/1.2.14
 * Fix another bug in shell functions. (fixes #321)

+ 8 - 2
src/main.c

@@ -265,11 +265,11 @@ static void show_help()
   egg_snprintf(format, sizeof format, "%%-30s %%-30s\n");
 
   printf(STR("%s\n\n"), version);
-  printf(STR("%s [options] [botnick]\n"));
+  printf(STR("%s [options] [botnick[.conf]]\n"));
   printf(STR("Not supplying any options will make all bots in the binary spawn.\n"));
   printf(format, "Option", "Description");
   printf(format, "------", "-----------");
-  printf(format, STR("-B <botnick>"), STR("Starts the specified bot [deprecated]"));
+  printf(format, STR("[-B] <botnick>"), STR("Starts the specified bot [deprecated]"));
   printf(format, STR("-c"), STR("Config file editor [reads env: EDITOR] [No auto update]"));
   printf(format, STR("-C"), STR("Config file editor [reads env: EDITOR]"));
 //  printf(format, STR("-e <infile> <outfile>"), STR("Encrypt infile to outfile"));
@@ -413,6 +413,12 @@ static void dtx_arg(int& argc, char *argv[])
     used_B = 1;
     strlcpy(origbotname, argv[optind], HANDLEN + 1);
     strlcpy(origbotnick, argv[optind], HANDLEN + 1);
+    /* Trim off .conf */
+    char *p = strchr(origbotname, '.');
+    if (p) {
+      origbotname[(p - origbotname)] = 0;
+      origbotnick[(p - origbotname)] = 0;
+    }
   }
 }