From b9a0c72fd1ffa668b2e725f01fce66e3a2c82b05 Mon Sep 17 00:00:00 2001
From: "Todd C. Miller" <Todd.Miller@sudo.ws>
Date: Tue, 30 Mar 2021 15:17:31 -0600
Subject: [PATCH] Don't report a usage error for "sudo -V". GitHub issue #95

---
 src/parse_args.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/parse_args.c b/src/parse_args.c
index eeca9af7a..50933816d 100644
--- a/src/parse_args.c
+++ b/src/parse_args.c
@@ -1,7 +1,7 @@
 /*
  * SPDX-License-Identifier: ISC
  *
- * Copyright (c) 1993-1996, 1998-2020 Todd C. Miller <Todd.Miller@sudo.ws>
+ * Copyright (c) 1993-1996, 1998-2021 Todd C. Miller <Todd.Miller@sudo.ws>
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -511,8 +511,10 @@ parse_args(int argc, char **argv, int *old_optind, int *nargc, char ***nargv,
 		    valid_flags = VALIDATE_VALID_FLAGS;
 		    break;
 		case 'V':
-		    if (mode && mode != MODE_VERSION)
-			usage_excl();
+		    if (mode && mode != MODE_VERSION) {
+			if (strcmp(progname, "sudoedit") != 0)
+			    usage_excl();
+		    }
 		    mode = MODE_VERSION;
 		    valid_flags = 0;
 		    break;
-- 
2.33.0

