summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO4
-rw-r--r--blabouncer.c9
-rw-r--r--functions.h2
-rw-r--r--message.c2
4 files changed, 15 insertions, 2 deletions
diff --git a/TODO b/TODO
index 2753cf7..580fa95 100644
--- a/TODO
+++ b/TODO
@@ -1 +1,5 @@
Support multiple connect commands.
+
+Support arrays or similar in the configuration file (for nick(s), connectcommand(s), etc.)
+
+All the TODOs sprinkled throughout the code!
diff --git a/blabouncer.c b/blabouncer.c
index 119e725..ecd8d00 100644
--- a/blabouncer.c
+++ b/blabouncer.c
@@ -864,9 +864,16 @@ int main(int argc, char *argv[]) {
// TODO - Do better command line argument handling (no required order)
char helptext[] = "usage: %s [-f] [-c /path/to/blabouncer.conf] (-f for foreground mode)\n";
if (argc == 2) {
- if (strcmp(argv[1], "-f")) {
+ if (strcmp(argv[1], "-f") && strcmp(argv[1], "-v") && strcmp(argv[1], "--version")) {
fprintf(stderr, helptext, argv[0]);
exit(1);
+ } else if (!strcmp(argv[1], "-v") || !strcmp(argv[1], "--version")) {
+ printf("blabouncer version %s\n", VERSION);
+ printf("Copyright (C) 2019 Luke Bratch <luke@bratch.co.uk>.\n");
+ printf("blabouncer is free software, and you are welcome to redistribute it under\n");
+ printf("the terms of the GNU General Public License, version 3.\n");
+ printf("See the file named COPYING for details.\n");
+ exit(0);
} else {
settings.background = 0;
}
diff --git a/functions.h b/functions.h
index 009a019..226548a 100644
--- a/functions.h
+++ b/functions.h
@@ -53,6 +53,8 @@
#define MAXCHANNELS 1024 // Let's assume 1024 is reasonable for now (it's configured per IRCd)
#define MAXRFCNICKLEN 9 // From RFC 1459
+#define VERSION "0.1" // Blabouncer version
+
// Write debug string to file.
// Debug level is provided by level, set to one of DEBUG_CRIT, DEBUG_SOME or DEBUG_FULL.
// Debug is only written if the global int "debug" is greater than or equal to the level.
diff --git a/message.c b/message.c
index 3e9f15c..4505ee1 100644
--- a/message.c
+++ b/message.c
@@ -855,7 +855,7 @@ int processclientmessage(SSL *server_ssl, char *str, struct client *clients, int
}
// Send our own greeting message
- snprintf(outgoingmsg, MAXDATASIZE, "NOTICE %s :Welcome to blabouncer!", ircdstate->ircnick);
+ snprintf(outgoingmsg, MAXDATASIZE, "NOTICE %s :Welcome to blabouncer version %s!", ircdstate->ircnick, VERSION);
sendtoclient(sourcefd, outgoingmsg, clients, settings, 0);
snprintf(outgoingmsg, MAXDATASIZE, "NOTICE %s :Blabouncer commands are all prefixed with BLABOUNCER which you can usually send using \"/QUOTE BLABOUNCER\"", ircdstate->ircnick);
sendtoclient(sourcefd, outgoingmsg, clients, settings, 0);