irctk

libircclient binding for scripts
git clone https://a3nm.net/git/irctk/
Log | Files | Refs | README

commit ca376bed2e78ef1eeded20efba6ef4e93b77beec
parent 7ae1070b8b057ae90a7f729a2fc1e2ab422b1de8
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Sat, 28 Jul 2012 00:01:35 +0200

add interval-after

Diffstat:
irctk.c | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/irctk.c b/irctk.c @@ -67,6 +67,10 @@ static struct argp_option options[] = { "Wait delay between posted messages (default: 0 for tty stdin, 1 for" " file/pipe)", MISC}, + {"interval-end", 'I', "secs", 0, + "Wait delay between sending the last message and disconnecting" + " (default: 2)", + MISC}, {"retry-after", 'y', "secs", 0, "Wait delay before trying to reconnect (default: 5)", MISC}, @@ -182,6 +186,7 @@ struct arguments int verbosity; int interval; + int interval_after; int retry_after; int retry_factor; @@ -232,6 +237,7 @@ void initialize_args() args.verbosity = 0; args.interval = isatty(fileno(stdin))?0:1000000; + args.interval_after = 2000000; args.retry_after = 5; args.retry_factor = 2; @@ -303,6 +309,9 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state) case 'i': arguments->interval = (int) (atof(arg) * 1000000.); break; + case 'I': + arguments->interval_after = (int) (atof(arg) * 1000000.); + break; case 'y': arguments->retry_after = (int) (atof(arg)); break; @@ -1756,6 +1765,7 @@ int start (int max_wait) debug("[main] exiting"); + usleep(args.interval_after); irc_disconnect(s); return 0;