diff --git a/client/common/client.c b/client/common/client.c index cc2d39d37..1b1c40964 100644 --- a/client/common/client.c +++ b/client/common/client.c @@ -316,7 +316,8 @@ int freerdp_client_settings_parse_command_line_ex( status = -1; const char* name = (argc > 0) ? argv[0] : "argc < 1"; - WLog_DBG(TAG, "This is [%s] %s %s", name, freerdp_get_version_string(), freerdp_get_build_config()); + WLog_DBG(TAG, "This is [%s] %s %s", name, freerdp_get_version_string(), + freerdp_get_build_config()); return status; } diff --git a/client/common/cmdline.c b/client/common/cmdline.c index e458c66e0..5164aa806 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -288,12 +288,31 @@ BOOL freerdp_client_print_version(void) return TRUE; } +BOOL freerdp_client_print_version_ex(int argc, char** argv) +{ + WINPR_ASSERT(argc >= 0); + WINPR_ASSERT(argv || (argc == 0)); + const char* name = (argc > 0) ? argv[0] : "argc < 1"; + printf("This is FreeRDP version [%s] %s (%s)\n", name, FREERDP_VERSION_FULL, + FREERDP_GIT_REVISION); + return TRUE; +} + BOOL freerdp_client_print_buildconfig(void) { printf("%s", freerdp_get_build_config()); return TRUE; } +BOOL freerdp_client_print_buildconfig_ex(int argc, char** argv) +{ + WINPR_ASSERT(argc >= 0); + WINPR_ASSERT(argv || (argc == 0)); + const char* name = (argc > 0) ? argv[0] : "argc < 1"; + printf("[%s] %s", name, freerdp_get_build_config()); + return TRUE; +} + static void freerdp_client_print_scancodes(void) { printf("RDP scancodes and their name for use with /kbd:remap\n"); @@ -1776,8 +1795,8 @@ int freerdp_client_settings_command_line_status_print_ex(rdpSettings* settings, if (status == COMMAND_LINE_STATUS_PRINT_BUILDCONFIG) { - freerdp_client_print_version(); - freerdp_client_print_buildconfig(); + freerdp_client_print_version_ex(argc, argv); + freerdp_client_print_buildconfig_ex(argc, argv); goto out; } else if (status == COMMAND_LINE_STATUS_PRINT) diff --git a/include/freerdp/client/cmdline.h b/include/freerdp/client/cmdline.h index 1ffd3d146..1f8c2cb73 100644 --- a/include/freerdp/client/cmdline.h +++ b/include/freerdp/client/cmdline.h @@ -94,7 +94,30 @@ extern "C" FREERDP_API void freerdp_client_warn_deprecated(int argc, char* argv[]); FREERDP_API BOOL freerdp_client_print_version(void); + + /** @brief prints the version of the client including the binary name extracted from \b argv + * + * @param argc the number of command line arguments, must be >= 0 + * @param argv the array of command line argument strings + * + * @return \b TRUE for success + * + * @since version 3.10.0 + */ + FREERDP_API BOOL freerdp_client_print_version_ex(int argc, char** argv); FREERDP_API BOOL freerdp_client_print_buildconfig(void); + + /** @brief prints the buidconfiguration of the client including the binary name extracted from + * \b argv + * + * @param argc the number of command line arguments, must be >= 0 + * @param argv the array of command line argument strings + * + * @return \b TRUE for success + * + * @since version 3.10.0 + */ + FREERDP_API BOOL freerdp_client_print_buildconfig_ex(int argc, char** argv); FREERDP_API BOOL freerdp_client_print_command_line_help(int argc, char** argv); FREERDP_API BOOL freerdp_client_print_command_line_help_ex( int argc, char** argv, const COMMAND_LINE_ARGUMENT_A* custom);