Merge pull request #10815 from akallabeth/improve-client-config

[client,common] include binary name in client buildconfig
This commit is contained in:
akallabeth 2024-11-04 09:47:37 +01:00 committed by GitHub
commit 7d5193d3d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 47 additions and 3 deletions

View File

@ -315,7 +315,9 @@ int freerdp_client_settings_parse_command_line_ex(
if (!freerdp_client_settings_post_process(settings))
status = -1;
WLog_DBG(TAG, "This is %s %s", freerdp_get_version_string(), freerdp_get_build_config());
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());
return status;
}

View File

@ -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)

View File

@ -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);