summary refs log tree commit diff
path: root/chat.c
diff options
context:
space:
mode:
authorC. McEnroe2021-01-10 18:00:41 -0500
committerC. McEnroe2021-01-10 18:00:41 -0500
commitc6cd90c2dd491d31d7bf8cff3e31bf361a955b1b (patch)
treecc5a4a3fda384d63db43a25112349e41fe3fe8ba /chat.c
parentcdff668d8f2523bdff624d5f357ccc5ed6ee21a0 (diff)
Print chain to stdout with -o
Diffstat (limited to 'chat.c')
-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;
 	}