From b43843901846c1ca1e426e1b9395178c9604a320 Mon Sep 17 00:00:00 2001
From: si-gui <245140120@qq.com>
Date: Wed, 27 Jan 2021 20:57:42 +0800
Subject: [PATCH] Fix freerdp-shadow-cli exit codes for help and version option

Signed-off-by: si-gui <245140120@qq.com>
---
 server/shadow/shadow.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/server/shadow/shadow.c b/server/shadow/shadow.c
index fcf8bd3..16f7dfb 100644
--- a/server/shadow/shadow.c
+++ b/server/shadow/shadow.c
@@ -42,6 +42,7 @@ int main(int argc, char** argv)
 {
 	MSG msg;
 	int status = 0;
+	int rc = 0;
 	DWORD dwExitCode;
 	rdpSettings* settings;
 	rdpShadowServer* server;
@@ -71,7 +72,9 @@ int main(int argc, char** argv)
 
 	if ((status = shadow_server_parse_command_line(server, argc, argv)) < 0)
 	{
-		shadow_server_command_line_status_print(server, argc, argv, status);
+		rc = shadow_server_command_line_status_print(server, argc, argv, status);
+		if (rc <= COMMAND_LINE_STATUS_PRINT && rc >= COMMAND_LINE_STATUS_PRINT_LAST)
+			status = 0;
 		goto fail_parse_command_line;
 	}
 
-- 
2.23.0

