[common,cmdline] add new functions

* Add freerdp_client_print_version_ex and
  freerdp_client_print_buildconfig_ex to print version and build
  configuration along with the binary name calling it
* Use these new functions instead of the ones that only print out
  version and/or buildconfig
This commit is contained in:
akallabeth
2024-11-04 08:48:06 +01:00
parent ecc84158b7
commit fb3a127d00
3 changed files with 46 additions and 3 deletions

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)