Commit 153d5e5853a81c12e6cca6d33811d97ab94768bb

Stefan Sperling 2022-07-04T09:55:03

add option-conflict handling for 'got tag' -s and -V options

diff --git a/got/got.c b/got/got.c
index 77e02b0..2f855d5 100644
--- a/got/got.c
+++ b/got/got.c
@@ -7386,11 +7386,27 @@ cmd_tag(int argc, char *argv[])
 			    "-c option can only be used when creating a tag");
 		if (tagmsg)
 			option_conflict('l', 'm');
+		if (signer_id)
+			option_conflict('l', 's');
+		if (verify_tags)
+			option_conflict('l', 'V');
 		if (argc > 1)
 			usage_tag();
 	} else if (argc != 1)
 		usage_tag();
 
+	if (verify_tags) {
+		if (commit_id_arg != NULL)
+			errx(1,
+			    "-c option can only be used when creating a tag");
+		if (tagmsg)
+			option_conflict('V', 'm');
+		if (signer_id)
+			option_conflict('V', 's');
+		if (do_list)
+			option_conflict('V', 'l');
+	}
+
 	if (argc == 1)
 		tag_name = argv[0];