From 6ee5fdc27d2885ff0f95c011304d2adac7014c52 Mon Sep 17 00:00:00 2001 From: Tobias Girstmair Date: Wed, 29 May 2024 20:42:27 +0200 Subject: [PATCH] implement 'display version' command line switch intentionally undocumented. --- ircpipe.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ircpipe.c b/ircpipe.c index 59a2c63..05839e9 100644 --- a/ircpipe.c +++ b/ircpipe.c @@ -13,6 +13,9 @@ #include +#define PROGNAME "ircpipe" +#define VERSION "0.1" + #define DEFAULT_TLS NO_TLS #define DEFAULT_PORT_TCP "6667" #define DEFAULT_PORT_TLS "6697" @@ -353,7 +356,7 @@ int main(int argc, char **argv) { pass = getenv("IRC_PASSWD"); ca_file = getenv("IRC_CAFILE"); - while ((opt = getopt(argc, argv, "n:j:pPsSkh")) != -1) { + while ((opt = getopt(argc, argv, "n:j:pPsSkhV")) != -1) { switch (opt) { case 'n': nick = optarg; break; case 'p': pass_type = SERVER_PASSWD; break; @@ -362,6 +365,7 @@ int main(int argc, char **argv) { case 'S': tls = NO_TLS; break; case 'k': tls = INSECURE_TLS; break; case 'j': chan = optarg; break; + case 'V': printf(PROGNAME " " VERSION "\n"); return 0; default: irc_help(argv[0], opt != 'h'); } } -- 2.39.3