diff options
| author | Koichiro IWAO <meta@vmeta.jp> | 2018-04-09 19:23:41 +0900 |
|---|---|---|
| committer | Koichiro IWAO <meta@vmeta.jp> | 2018-04-10 23:58:31 +0900 |
| commit | b2b42d28f37f8553f9183b90715aa2cd511a7f7d (patch) | |
| tree | 47a517c3757b7998dbd7069b8a6a83c7df58738d /xrdp/xrdp.c | |
| parent | 48aafc1866131c2c4157f26c956aea622b15531b (diff) | |
| download | xrdp-proprietary-b2b42d28f37f8553f9183b90715aa2cd511a7f7d.tar.gz xrdp-proprietary-b2b42d28f37f8553f9183b90715aa2cd511a7f7d.zip | |
xrdp: add OpenSSL version to --version
While here, cleanup --help, --version, and when unknown option.
Diffstat (limited to 'xrdp/xrdp.c')
| -rw-r--r-- | xrdp/xrdp.c | 53 |
1 files changed, 34 insertions, 19 deletions
diff --git a/xrdp/xrdp.c b/xrdp/xrdp.c index 437bd825..6e87d91f 100644 --- a/xrdp/xrdp.c +++ b/xrdp/xrdp.c @@ -46,6 +46,31 @@ static long g_sync_param2 = 0; static long (*g_sync_func)(long param1, long param2); /*****************************************************************************/ +void +print_version(void) +{ + g_writeln("xrdp %s", PACKAGE_VERSION); + g_writeln(" A Remote Desktop Protocol Server."); + g_writeln(" Copyright (C) 2004-2018 Jay Sorg, " + "Neutrino Labs, and all contributors."); + g_writeln(" See https://github.com/neutrinolabs/xrdp for more information."); + g_writeln("%s", ""); + g_writeln(" Compiled with %s", get_openssl_version()); +} + +/*****************************************************************************/ +void +print_help(void) +{ + g_writeln("Usage: xrdp [options]"); + g_writeln(" -h, --help show help"); + g_writeln(" -n, --nodaemon don't fork into background"); + g_writeln(" -k, --kill shut down xrdp"); + g_writeln(" -p, --port tcp listen port"); + g_writeln(" -f, --fork fork on new connection"); +} + +/*****************************************************************************/ /* This function is used to run a function from the main thread. Sync_func is the function pointer that will run from main thread The function can have two long in parameters and must return long */ @@ -393,9 +418,12 @@ main(int argc, char **argv) if (xrdp_process_params(argc, argv, startup_params) != 0) { - g_writeln("Unknown Parameter"); - g_writeln("xrdp -h for help"); + print_version(); + g_writeln("%s", ""); + print_help(); g_writeln("%s", ""); + + g_writeln("Unknown option"); g_deinit(); g_exit(1); } @@ -405,30 +433,17 @@ main(int argc, char **argv) if (startup_params->help) { + print_version(); g_writeln("%s", ""); - g_writeln("xrdp: A Remote Desktop Protocol server."); - g_writeln("Copyright (C) Jay Sorg 2004-2014"); - g_writeln("See http://www.xrdp.org for more information."); - g_writeln("%s", ""); - g_writeln("Usage: xrdp [options]"); - g_writeln(" -h, --help show help"); - g_writeln(" -n, --nodaemon don't fork into background"); - g_writeln(" -k, --kill shut down xrdp"); - g_writeln(" -p, --port tcp listen port"); - g_writeln(" -f, --fork fork on new connection"); - g_writeln("%s", ""); + print_help(); + g_deinit(); g_exit(0); } if (startup_params->version) { - g_writeln("%s", ""); - g_writeln("xrdp: A Remote Desktop Protocol server."); - g_writeln("Copyright (C) Jay Sorg 2004-2014"); - g_writeln("See http://www.xrdp.org for more information."); - g_writeln("Version %s", PACKAGE_VERSION); - g_writeln("%s", ""); + print_version(); g_deinit(); g_exit(0); } |
