summary refs log tree commit diff
path: root/chat.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-01-10 18:00:41 -0500
committerJune McEnroe <june@causal.agency>2021-01-10 18:00:41 -0500
commitc6cd90c2dd491d31d7bf8cff3e31bf361a955b1b (patch)
treecc5a4a3fda384d63db43a25112349e41fe3fe8ba /chat.c
parentAllow interspersing flags and config files (diff)
downloadcatgirl-c6cd90c2dd491d31d7bf8cff3e31bf361a955b1b.tar.gz
catgirl-c6cd90c2dd491d31d7bf8cff3e31bf361a955b1b.zip
Print chain to stdout with -o
Diffstat (limited to '')
-rw-r--r--chat.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/chat.c b/chat.c
index 99a529c..3f020fd 100644
--- a/chat.c
+++ b/chat.c
@@ -137,10 +137,10 @@ int main(int argc, char *argv[]) {
 #endif
 
 	bool insecure = false;
+	bool printCert = false;
 	const char *bind = NULL;
 	const char *host = NULL;
 	const char *port = "6697";
-	const char *chain = NULL;
 	const char *trust = NULL;
 	const char *cert = NULL;
 	const char *priv = NULL;
@@ -169,7 +169,7 @@ int main(int argc, char *argv[]) {
 		{ .val = 'k', .name = "priv", required_argument },
 		{ .val = 'l', .name = "log", no_argument },
 		{ .val = 'n', .name = "nick", required_argument },
-		{ .val = 'o', .name = "write-chain", required_argument },
+		{ .val = 'o', .name = "print-chain", no_argument },
 		{ .val = 'p', .name = "port", required_argument },
 		{ .val = 'r', .name = "real", required_argument },
 		{ .val = 's', .name = "save", required_argument },
@@ -204,7 +204,7 @@ int main(int argc, char *argv[]) {
 			break; case 'k': priv = optarg;
 			break; case 'l': logEnable = true;
 			break; case 'n': nick = optarg;
-			break; case 'o': insecure = true; chain = optarg;
+			break; case 'o': insecure = true; printCert = true;
 			break; case 'p': port = optarg;
 			break; case 'r': real = optarg;
 			break; case 's': save = optarg;
@@ -238,9 +238,9 @@ int main(int argc, char *argv[]) {
 	commandCompleteAdd();
 
 	ircConfig(insecure, trust, cert, priv);
-	if (chain) {
+	if (printCert) {
 		ircConnect(bind, host, port);
-		ircWriteChain(chain);
+		ircPrintCert();
 		ircClose();
 		return EX_OK;
 	}