diff --git a/src/lib/deskflow/App.h b/src/lib/deskflow/App.h index a65ad90e3..1aea861de 100644 --- a/src/lib/deskflow/App.h +++ b/src/lib/deskflow/App.h @@ -130,59 +130,53 @@ private: #else #define DAEMON_RUNNING(running_) #endif +constexpr static auto s_helpGeneralArgs = // + " -d, --debug filter out log messages with priority below level.\n" + " level may be: FATAL, ERROR, WARNING, NOTE, INFO,\n" + " DEBUG, DEBUG1, DEBUG2.\n" + " -n, --name use screen-name instead the hostname to identify\n" + " this screen in the configuration.\n" + " -1, --no-restart do not try to restart on failure.\n" + "* --restart restart the server automatically if it fails.\n" + " -l --log write log messages to file.\n" + " --enable-crypto enable TLS encryption.\n" + " --tls-cert specify the path to the TLS certificate file.\n"; -#define HELP_COMMON_INFO_1 \ - " -d, --debug filter out log messages with priority below " \ - "level.\n" \ - " level may be: FATAL, ERROR, WARNING, NOTE, " \ - "INFO,\n" \ - " DEBUG, DEBUG1, DEBUG2.\n" \ - " -n, --name use screen-name instead the hostname to " \ - "identify\n" \ - " this screen in the configuration.\n" \ - " -1, --no-restart do not try to restart on failure.\n" \ - "* --restart restart the server automatically if it fails.\n" \ - " -l --log write log messages to file.\n" \ - " --enable-crypto enable TLS encryption.\n" \ - " --tls-cert specify the path to the TLS certificate file.\n" +constexpr static auto s_helpVersionArgs = // + " -h, --help display this help and exit.\n" + " --version display version information and exit.\n"; -#define HELP_COMMON_INFO_2 \ - " -h, --help display this help and exit.\n" \ - " --version display version information and exit.\n" - -#define HELP_COMMON_ARGS \ - " [--name ]" \ - " [--restart|--no-restart]" \ - " [--debug ]" +constexpr static auto s_helpCommonArgs = // + " [--name ]" + " [--restart|--no-restart]" + " [--debug ]"; // system args (windows/unix) #if SYSAPI_UNIX // unix daemon mode args -#define HELP_SYS_ARGS " [--daemon|--no-daemon]" -#define HELP_SYS_INFO \ - " -f, --no-daemon run in the foreground.\n" \ - "* --daemon run as a daemon.\n" +constexpr static auto s_helpSysArgs = " [--daemon|--no-daemon]"; +constexpr static auto s_helpSysInfo = // + " -f, --no-daemon run in the foreground.\n" + "* --daemon run as a daemon.\n"; #elif SYSAPI_WIN32 // windows args -#define HELP_SYS_ARGS " [--service ] [--relaunch]" -#define HELP_SYS_INFO \ - " --service manage the windows service, valid options " \ - "are:\n" \ - " install/uninstall/start/stop\n" \ - " --relaunch persistently relaunches process in current " \ - "user \n" \ - " session (useful for vista and upward).\n" +constexpr static auto s_helpSysArgs = " [--service ] [--relaunch]"; +constexpr static auto s_helpSysInfo = // + " --service manage the windows service, valid options are:\n" + " install/uninstall/start/stop\n" + " --relaunch persistently relaunches process in current user \n" + " session (useful for vista and upward).\n"; #endif #if !defined(WINAPI_LIBEI) && WINAPI_XWINDOWS -const auto kHelpNoWayland = "\n" - "Your Linux distribution does not support Wayland EI (emulated input)\n" - "which is required for Wayland support. Please use a Linux distribution\n" - "that supports Wayland EI.\n"; +constexpr static auto s_helpNoWayland = // + "\nYour Linux distribution does not support Wayland EI (emulated input)\n" + "which is required for Wayland support. Please use a Linux distribution\n" + "that supports Wayland EI.\n"; #else -const auto kHelpNoWayland = ""; +constexpr static auto s_helpNoWayland = ""; #endif diff --git a/src/lib/deskflow/ClientApp.cpp b/src/lib/deskflow/ClientApp.cpp index 33bb98455..7a857a757 100644 --- a/src/lib/deskflow/ClientApp.cpp +++ b/src/lib/deskflow/ClientApp.cpp @@ -106,12 +106,12 @@ void ClientApp::help() #ifdef WINAPI_XWINDOWS << " [--display ]" #endif - << HELP_SYS_ARGS << HELP_COMMON_ARGS << " " + << s_helpSysArgs << s_helpCommonArgs << " " << "\n\n" << "Connect to a " << kAppName << " mouse/keyboard sharing server.\n" << "\n" << " -a, --address
local network interface address.\n" - << HELP_COMMON_INFO_1 << HELP_SYS_INFO << " --yscroll defines the vertical scrolling delta,\n" + << s_helpGeneralArgs << s_helpSysInfo << " --yscroll defines the vertical scrolling delta,\n" << " which is 120 by default.\n" << " --sync-language enable language synchronization.\n" << " --invert-scroll invert scroll direction on this\n" @@ -120,10 +120,10 @@ void ClientApp::help() << " --display when in X mode, connect to the X server\n" << " at .\n" #endif - << HELP_COMMON_INFO_2 << "\n" + << s_helpVersionArgs << "\n" << "* marks defaults.\n" - << kHelpNoWayland + << s_helpNoWayland << "\n" << "The server address is of the form: [][:].\n" diff --git a/src/lib/deskflow/ServerApp.cpp b/src/lib/deskflow/ServerApp.cpp index 6e04362b8..228fdea84 100644 --- a/src/lib/deskflow/ServerApp.cpp +++ b/src/lib/deskflow/ServerApp.cpp @@ -109,16 +109,16 @@ void ServerApp::help() << " [--display ]" #endif - << HELP_SYS_ARGS HELP_COMMON_ARGS "\n" + << s_helpSysArgs << s_helpCommonArgs << "\n" << "\n" << "Start the " << kAppName << " mouse/keyboard sharing server.\n" << "\n" << " -a, --address
listen for clients on the given address.\n" << " -c, --config path of the configuration file\n" - << HELP_COMMON_INFO_1 + << s_helpGeneralArgs << " --disable-client-cert-check disable client SSL certificate \n" " checking (deprecated)\n" - << HELP_SYS_INFO HELP_COMMON_INFO_2 << "\n" + << s_helpSysInfo << s_helpVersionArgs << "\n" #if WINAPI_XWINDOWS << " --display when in X mode, connect to the X server\n" @@ -127,7 +127,7 @@ void ServerApp::help() << "* marks defaults.\n" - << kHelpNoWayland + << s_helpNoWayland << "\n" << "The argument for --address is of the form: [][:]. "