From 98f4a2b02232747b9f5fda1bec2d82c32b2e769a Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 23 Oct 2024 16:32:14 +0200 Subject: [PATCH] [client,various] print client specific only on help do not print if version or other command was run --- client/SDL/SDL2/sdl_freerdp.cpp | 15 ++++++++++++++- client/SDL/SDL3/sdl_freerdp.cpp | 15 ++++++++++++++- client/X11/cli/xfreerdp.c | 17 ++++++++++++++--- 3 files changed, 42 insertions(+), 5 deletions(-) diff --git a/client/SDL/SDL2/sdl_freerdp.cpp b/client/SDL/SDL2/sdl_freerdp.cpp index 4cb04b1e2..31907e194 100644 --- a/client/SDL/SDL2/sdl_freerdp.cpp +++ b/client/SDL/SDL2/sdl_freerdp.cpp @@ -1663,9 +1663,22 @@ int main(int argc, char* argv[]) if (status) { rc = freerdp_client_settings_command_line_status_print(settings, status, argc, argv); - SdlPref::print_config_file_help(2); if (freerdp_settings_get_bool(settings, FreeRDP_ListMonitors)) sdl_list_monitors(sdl); + else + { + switch (status) + { + case COMMAND_LINE_STATUS_PRINT: + case COMMAND_LINE_STATUS_PRINT_VERSION: + case COMMAND_LINE_STATUS_PRINT_BUILDCONFIG: + break; + case COMMAND_LINE_STATUS_PRINT_HELP: + default: + SdlPref::print_config_file_help(2); + break; + } + } return rc; } diff --git a/client/SDL/SDL3/sdl_freerdp.cpp b/client/SDL/SDL3/sdl_freerdp.cpp index 368096c55..aec44811a 100644 --- a/client/SDL/SDL3/sdl_freerdp.cpp +++ b/client/SDL/SDL3/sdl_freerdp.cpp @@ -1647,9 +1647,22 @@ int main(int argc, char* argv[]) if (status) { rc = freerdp_client_settings_command_line_status_print(settings, status, argc, argv); - SdlPref::print_config_file_help(3); if (freerdp_settings_get_bool(settings, FreeRDP_ListMonitors)) sdl_list_monitors(sdl); + else + { + switch (status) + { + case COMMAND_LINE_STATUS_PRINT: + case COMMAND_LINE_STATUS_PRINT_VERSION: + case COMMAND_LINE_STATUS_PRINT_BUILDCONFIG: + break; + case COMMAND_LINE_STATUS_PRINT_HELP: + default: + SdlPref::print_config_file_help(3); + break; + } + } return rc; } diff --git a/client/X11/cli/xfreerdp.c b/client/X11/cli/xfreerdp.c index 97e31d5f2..9a0ef647b 100644 --- a/client/X11/cli/xfreerdp.c +++ b/client/X11/cli/xfreerdp.c @@ -80,11 +80,22 @@ int main(int argc, char* argv[]) { rc = freerdp_client_settings_command_line_status_print(settings, status, argc, argv); - xfreerdp_print_help(); - if (freerdp_settings_get_bool(settings, FreeRDP_ListMonitors)) xf_list_monitors(xfc); - + else + { + switch (status) + { + case COMMAND_LINE_STATUS_PRINT: + case COMMAND_LINE_STATUS_PRINT_VERSION: + case COMMAND_LINE_STATUS_PRINT_BUILDCONFIG: + break; + case COMMAND_LINE_STATUS_PRINT_HELP: + default: + xfreerdp_print_help(); + break; + } + } goto out; }