From 7c2fac69e66456617b94d26026fcab6b379814c5 Mon Sep 17 00:00:00 2001
From: Ondrej Holy <oholy@redhat.com>
Date: Wed, 26 Feb 2020 11:12:46 +0100
Subject: [PATCH] Do not advertise /usb in help output if the channel is not
built
The help output advertise an option and an example for usb redirection
regardless of the fact whether the urbdrc channel was built or not.
This is confusing for people. Let's do not show /usb in help if it is
not built.
---
client/common/cmdline.c | 2 ++
client/common/cmdline.h | 2 ++
2 files changed, 4 insertions(+)
diff --git a/client/common/cmdline.c b/client/common/cmdline.c
index 103b4d245..44510a58c 100644
--- a/client/common/cmdline.c
+++ b/client/common/cmdline.c
@@ -166,7 +166,9 @@ BOOL freerdp_client_print_command_line_help_ex(int argc, char** argv,
printf("\n");
printf("Multimedia Redirection: /multimedia:sys:oss,dev:/dev/dsp1,decoder:ffmpeg\n");
printf("Multimedia Redirection: /multimedia:sys:alsa\n");
+#ifdef CHANNEL_URBDRC_CLIENT
printf("USB Device Redirection: /usb:id,dev:054c:0268\n");
+#endif
printf("\n");
printf("For Gateways, the https_proxy environment variable is respected:\n");
#ifdef _WIN32
diff --git a/client/common/cmdline.h b/client/common/cmdline.h
index 7f1d9e03f..b87871e64 100644
--- a/client/common/cmdline.h
+++ b/client/common/cmdline.h
@@ -173,7 +173,9 @@ static COMMAND_LINE_ARGUMENT_A args[] =
{ "toggle-fullscreen", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueTrue, NULL, -1, NULL, "Alt+Ctrl+Enter toggles fullscreen" },
{ "u", COMMAND_LINE_VALUE_REQUIRED, "[<domain>\\]<user> or <user>[@<domain>]", NULL, NULL, -1, NULL, "Username" },
{ "unmap-buttons", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL, "Let server see real physical pointer button"},
+#ifdef CHANNEL_URBDRC_CLIENT
{ "usb", COMMAND_LINE_VALUE_REQUIRED, "[dbg,][dev:<dev>,][id|addr,][auto]", NULL, NULL, -1, NULL, "Redirect USB device" },
+#endif
{ "v", COMMAND_LINE_VALUE_REQUIRED, "<server>[:port]", NULL, NULL, -1, NULL, "Server hostname" },
{ "vc", COMMAND_LINE_VALUE_REQUIRED, "<channel>[,<options>]", NULL, NULL, -1, NULL, "Static virtual channel" },
{ "version", COMMAND_LINE_VALUE_FLAG | COMMAND_LINE_PRINT_VERSION, NULL, NULL, NULL, -1, NULL, "Print version" },
--
2.26.0