فهرست منبع

* Port [3538] to 1.2.14
* Bot no longer requires (or uses) '-B' to spawn bots. (now: ./binary <botnick>)


svn: 3541

Bryan Drewery 19 سال پیش
والد
کامیت
589ec3fa18
4فایلهای تغییر یافته به همراه18 افزوده شده و 9 حذف شده
  1. 1 0
      doc/UPDATES
  2. 1 1
      src/conf.c
  3. 15 7
      src/main.c
  4. 1 1
      src/misc.c

+ 1 - 0
doc/UPDATES

@@ -60,6 +60,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Made 'ident-botnick' variable to decide to send username vs botnick for non-ident.
 * Default servers/servers6/alias list updated ('set -YES var -' to use it)
 * Fix MODE parsing bug
+* Bot no longer requires (or uses) '-B' to spawn bots. (now: ./binary <botnick>)
 
 1.2.13 - http://wraith.shatow.net/milestone/1.2.13
 * Fix cmd_chanset accepting invalid flags

+ 1 - 1
src/conf.c

@@ -91,7 +91,7 @@ void spawnbot(const char *nick)
   char *run = (char *) my_calloc(1, size);
   int status = 0;
 
-  simple_snprintf(run, size, "%s -B %s", shell_escape(binname), shell_escape(nick));
+  simple_snprintf(run, size, "%s %s", shell_escape(binname), shell_escape(nick));
   sdprintf("Spawning '%s': %s", nick, run);
   status = system(run);
   if (status == -1 || WEXITSTATUS(status))

+ 15 - 7
src/main.c

@@ -262,13 +262,15 @@ 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("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"));
-  printf(format, STR("-c"), STR("Crypt/Hash functions (MD5/SHA1/AES256)"));
+  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"));
-  printf(format, STR("-d <infile> <outfile>"), STR("Decrypt infile to outfile"));
+//  printf(format, STR("-e <infile> <outfile>"), STR("Encrypt infile to outfile"));
+//  printf(format, STR("-d <infile> <outfile>"), STR("Decrypt infile to outfile"));
   printf(format, STR("-D"), STR("Enables debug mode (see -n)"));
   printf(format, STR("-E [error code]"), STR("Display Error codes english translation"));
 /*  printf(format, STR("-g <file>"), STR("Generates a template config file"));
@@ -276,9 +278,9 @@ static void show_help()
 */
   printf(format, "-h", "Display this help listing");
   printf(format, STR("-k <botname>"), STR("Terminates (botname) with kill -9 (see also: -r)"));
-  printf(format, STR("-n"), STR("Disables backgrounding bot (requires -B)"));
+  printf(format, STR("-n"), STR("Disables backgrounding bot (requires [-B] <botnick>)"));
   printf(format, STR("-r <botname>"), STR("Restarts the specified bot (see also: -k)"));
-  printf(format, STR("-s"), STR("Disables checking for ptrace/strace during startup (no pass needed)"));
+//  printf(format, STR("-s"), STR("Disables checking for ptrace/strace during startup (no pass needed)"));
   printf(format, STR("-t"), STR("Enables \"Partyline\" emulation (requires -nB)"));
   printf(format, STR("-u <binary>"), STR("Update binary, Automatically kill/respawn bots"));
   printf(format, STR("-U <binary>"), STR("Update binary"));
@@ -289,7 +291,7 @@ static void show_help()
 // leaf: BkLP
 #define PARSE_FLAGS STR("0234:aB:cCd:De:EH:k:hnr:tu:U:v")
 #define FLAGS_CHECKPASS STR("cCdDeEhknrtuUv")
-static void dtx_arg(int argc, char *argv[])
+static void dtx_arg(int& argc, char *argv[])
 {
   int i = 0;
   char *p = NULL;
@@ -403,6 +405,12 @@ static void dtx_arg(int argc, char *argv[])
         break;
     }
   }
+
+  if ((argc - (optind - 1)) == 2) {
+    used_B = 1;
+    strlcpy(origbotname, argv[optind], HANDLEN + 1);
+    strlcpy(origbotnick, argv[optind], HANDLEN + 1);
+  }
 }
 
 /* Timer info */

+ 1 - 1
src/misc.c

@@ -731,7 +731,7 @@ restart(int idx)
   char *argv[4] = { NULL, NULL, NULL, NULL };
   char shit[7] = "";
 
-  simple_sprintf(shit, "-%s%s%sB", !backgrd ? "n" : "", term_z ? "t" : "", sdebug ? "D" : "");
+  simple_sprintf(shit, "-%s%s%s", !backgrd ? "n" : "", term_z ? "t" : "", sdebug ? "D" : "");
 
   argv[0] = strdup(shell_escape(binname));
   argv[1] = strdup(shit);