Commit 2052f4b3 authored by vvaltman's avatar vvaltman

minor updates.

parent 2cc75016
......@@ -75,6 +75,7 @@
int verbosity;
extern int readline_disabled;
extern char *bot_hash;
extern int bot_mode;
int binlog_read;
......@@ -235,6 +236,12 @@ void do_get_string (struct tgl_state *TLS) {
void do_get_values (struct tgl_state *TLS, enum tgl_value_type type, const char *prompt, int num_values,
void (*callback)(struct tgl_state *TLS, const char *string[], void *arg), void *arg) {
if (type == tgl_bot_hash && bot_hash) {
assert (num_values == 1);
one_string_results[0] = bot_hash;
callback (TLS, (void *)one_string_results, arg);
return;
}
one_string_cb = callback;
one_string_num = 0;
one_string_total_args = num_values;
......
......@@ -557,6 +557,7 @@ static void sighup_handler (const int sig) {
char *set_user_name;
char *set_group_name;
int accept_any_tcp;
char *bot_hash;
int change_user_group () {
char *username = set_user_name;
......@@ -642,7 +643,7 @@ void args_parse (int argc, char **argv) {
{"exec", required_argument, 0, 'e'},
{"disable-names", no_argument, 0, 'I'},
{"enable-ipv6", no_argument, 0, '6'},
{"bot", no_argument, 0, 'b'},
{"bot", optional_argument, 0, 'b'},
{"help", no_argument, 0, 'h'},
{"accept-any-tcp", no_argument, 0, 1001},
{"disable-link-preview", no_argument, 0, 1002},
......@@ -672,6 +673,9 @@ void args_parse (int argc, char **argv) {
switch (opt) {
case 'b':
bot_mode ++;
if (optarg) {
bot_hash = optarg;
}
break;
case 1000:
tgl_allocator = &tgl_allocator_debug;
......
Subproject commit e279fef0dc34c12d02e88f82a2fbde5917bc9c56
Subproject commit 418f81be448fdebb04c3809795f8c160ee13280c
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment