diff options
| author | metalefty <meta@vmeta.jp> | 2017-01-19 13:12:38 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-01-19 13:12:38 +0900 |
| commit | 27b58884fd6fafd5a34237a110dbb44e338662ca (patch) | |
| tree | 19909bb304d05b1b140c7ae30eb510f00d3fc894 /sesman/sesman.c | |
| parent | 0afbd57638cbba35d6c081e91262b7c267d04c17 (diff) | |
| parent | 0a9b58633234f73ab594614305fd4449136facf1 (diff) | |
| download | xrdp-proprietary-27b58884fd6fafd5a34237a110dbb44e338662ca.tar.gz xrdp-proprietary-27b58884fd6fafd5a34237a110dbb44e338662ca.zip | |
Merge pull request #629 from proski/cmdline
Improve command line documentation for xrdp and xrdp-sesman
Diffstat (limited to 'sesman/sesman.c')
| -rw-r--r-- | sesman/sesman.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/sesman/sesman.c b/sesman/sesman.c index c9666943..8bebaa39 100644 --- a/sesman/sesman.c +++ b/sesman/sesman.c @@ -131,6 +131,19 @@ sesman_main_loop(void) } /******************************************************************************/ +void +print_usage(int retcode) +{ + g_printf("xrdp-sesman - xrdp session manager\n\n"); + g_printf("Usage: xrdp-sesman [options]\n"); + g_printf(" -n, --nodaemon run as foreground process\n"); + g_printf(" -k, --kill kill running xrdp-sesman\n"); + g_printf(" -h, --help show this help\n"); + g_deinit(); + g_exit(retcode); +} + +/******************************************************************************/ int DEFAULT_CC main(int argc, char **argv) { @@ -166,16 +179,7 @@ main(int argc, char **argv) (0 == g_strcasecmp(argv[1], "-help")) || (0 == g_strcasecmp(argv[1], "-h")))) { - /* help screen */ - g_printf("sesman - xrdp session manager\n\n"); - g_printf("usage: sesman [command]\n\n"); - g_printf("command can be one of the following:\n"); - g_printf("-n, -ns, --nodaemon starts sesman in foreground\n"); - g_printf("-k, --kill kills running sesman\n"); - g_printf("-h, --help shows this help\n"); - g_printf("if no command is specified, sesman is started in background"); - g_deinit(); - g_exit(0); + print_usage(0); } else if ((2 == argc) && ((0 == g_strcasecmp(argv[1], "--kill")) || (0 == g_strcasecmp(argv[1], "-kill")) || @@ -229,16 +233,13 @@ main(int argc, char **argv) else { /* there's something strange on the command line */ - g_printf("sesman - xrdp session manager\n\n"); - g_printf("error: invalid command line\n"); - g_printf("usage: sesman [ --nodaemon | --kill | --help ]\n"); - g_deinit(); - g_exit(1); + g_printf("Error: invalid command line arguments\n\n"); + print_usage(1); } if (g_file_exist(pid_file)) { - g_printf("sesman is already running.\n"); + g_printf("xrdp-sesman is already running.\n"); g_printf("if it's not running, try removing "); g_printf("%s", pid_file); g_printf("\n"); |
