|
|
@@ -16,16 +16,18 @@ |
|
|
|
|
|
|
|
#define VERSION_STRING "1" |
|
|
|
|
|
|
|
void |
|
|
|
DECL void |
|
|
|
help(void) |
|
|
|
{ |
|
|
|
ERRMSG(PROGN ": usage\n" |
|
|
|
"-channel CHANNEL - Sets the target channel\n" |
|
|
|
"-url URL - Sets the target URL\n" |
|
|
|
"Use format username[:password]@server[:port], port defaults to 6667.\n"); |
|
|
|
"-db DBFILE - Sets the database file (default: probotic_data.sqlite)\n" |
|
|
|
"-identify PASSWORD - Identifies against NickServ\n" |
|
|
|
"\nUse format username[:password]@server[:port], port defaults to 6667.\n"); |
|
|
|
} |
|
|
|
|
|
|
|
void |
|
|
|
DECL void |
|
|
|
version(void) |
|
|
|
{ |
|
|
|
ERRMSG(PROGN ": " VERSION_STRING); |
|
|
@@ -45,7 +47,10 @@ main (int argc, |
|
|
|
{ |
|
|
|
++arg; |
|
|
|
if (strcmp(arg, "version") == 0) |
|
|
|
{ ERR(1, PROGN ": Version " VERSION_STRING); } |
|
|
|
{ |
|
|
|
version(); |
|
|
|
return 1; |
|
|
|
} |
|
|
|
else if (strcmp(arg, "help") == 0) |
|
|
|
{ goto help; } |
|
|
|
if (argc < 2) |
|
|
@@ -54,19 +59,10 @@ main (int argc, |
|
|
|
{ db = argv[1]; } |
|
|
|
else if (strcmp(arg, "url") == 0) |
|
|
|
{ parse_url(argv[1]); } |
|
|
|
/* else if (strcmp(arg, "server") == 0) */ |
|
|
|
/* { free(creds.server); creds.server = strdup(argv[1]); } */ |
|
|
|
/* else if (strcmp(arg, "port") == 0) */ |
|
|
|
/* { creds.port = atoi(argv[1]); } */ |
|
|
|
else if (strcmp(arg, "channel") == 0) |
|
|
|
{ free(creds.channel); creds.channel = strdup(argv[1]); } |
|
|
|
else if (strcmp(arg, "identify") == 0) |
|
|
|
{ ident_password = argv[1]; } |
|
|
|
|
|
|
|
/* else if (strcmp(arg, "username") == 0) */ |
|
|
|
/* { free(creds.username); creds.username = strdup(argv[1]); } */ |
|
|
|
/* else if (strcmp(arg, "password") == 0) */ |
|
|
|
/* { free(creds.password); creds.password = strdup(argv[1]); } */ |
|
|
|
else |
|
|
|
{ |
|
|
|
ERR(1,"Unknown command provided"); |
|
|
|