* cygserver.cc (print_usage): Align output to utilities in utils

directory.
	(print_version): Ditto.
This commit is contained in:
Corinna Vinschen 2011-10-10 15:48:54 +00:00
parent f213601cda
commit 9e9bc3a4e4
2 changed files with 29 additions and 26 deletions

View File

@ -1,3 +1,9 @@
2011-10-10 Corinna Vinschen <corinna@vinschen.de>
* cygserver.cc (print_usage): Align output to utilities in utils
directory.
(print_version): Ditto.
2011-08-18 Yaakov Selkowitz <yselkowitz@users.sourceforge.net> 2011-08-18 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
* sysv_shm.cc (ACCESSPERMS): Remove to fix redefined warning, as * sysv_shm.cc (ACCESSPERMS): Remove to fix redefined warning, as

View File

@ -1,6 +1,6 @@
/* cygserver.cc /* cygserver.cc
Copyright 2001, 2002, 2003, 2004, 2005, 2007 Red Hat Inc. Copyright 2001, 2002, 2003, 2004, 2005, 2007, 2011 Red Hat Inc.
Written by Egor Duda <deo@logos-m.ru> Written by Egor Duda <deo@logos-m.ru>
@ -449,16 +449,22 @@ static void
print_usage (const char *const pgm) print_usage (const char *const pgm)
{ {
log (LOG_NOTICE, "Usage: %s [OPTIONS]\n" log (LOG_NOTICE, "Usage: %s [OPTIONS]\n"
"\n"
"Cygwin background service daemon\n"
"\n"
"Configuration option:\n" "Configuration option:\n"
"\n"
" -f, --config-file <file> Use <file> as config file. Default is\n" " -f, --config-file <file> Use <file> as config file. Default is\n"
" " DEF_CONFIG_FILE "\n" " " DEF_CONFIG_FILE "\n"
"\n" "\n"
"Performance options:\n" "Performance options:\n"
"\n"
" -c, --cleanup-threads <num> Number of cleanup threads to use.\n" " -c, --cleanup-threads <num> Number of cleanup threads to use.\n"
" -p, --process-cache <num> Size of process cache.\n" " -p, --process-cache <num> Size of process cache.\n"
" -r, --request-threads <num> Number of request threads to use.\n" " -r, --request-threads <num> Number of request threads to use.\n"
"\n" "\n"
"Logging options:\n" "Logging options:\n"
"\n"
" -d, --debug Log debug messages to stderr.\n" " -d, --debug Log debug messages to stderr.\n"
" -e, --stderr Log to stderr (default if stderr is a tty).\n" " -e, --stderr Log to stderr (default if stderr is a tty).\n"
" -E, --no-stderr Don't log to stderr (see -y, -Y options).\n" " -E, --no-stderr Don't log to stderr (see -y, -Y options).\n"
@ -467,14 +473,16 @@ print_usage (const char *const pgm)
" -Y, --no-syslog Don't log to syslog (See -e, -E options).\n" " -Y, --no-syslog Don't log to syslog (See -e, -E options).\n"
"\n" "\n"
"Support options:\n" "Support options:\n"
"\n"
" -m, --no-sharedmem Don't start XSI Shared Memory support.\n" " -m, --no-sharedmem Don't start XSI Shared Memory support.\n"
" -q, --no-msgqueues Don't start XSI Message Queue support.\n" " -q, --no-msgqueues Don't start XSI Message Queue support.\n"
" -s, --no-semaphores Don't start XSI Semaphore support.\n" " -s, --no-semaphores Don't start XSI Semaphore support.\n"
"\n" "\n"
"Miscellaneous:\n" "Miscellaneous:\n"
"\n"
" -S, --shutdown Shutdown the daemon.\n" " -S, --shutdown Shutdown the daemon.\n"
" -h, --help Output usage information and exit.\n" " -h, --help Output usage information and exit.\n"
" -v, --version Output version information and exit." " -V, --version Output version information and exit.\n"
, pgm); , pgm);
} }
@ -485,27 +493,16 @@ print_usage (const char *const pgm)
static void static void
print_version () print_version ()
{ {
char buf[200]; log (LOG_INFO,
snprintf (buf, sizeof (buf), "%d.%d.%d(%d.%d/%d/%d)-(%d.%d.%d.%d) %s", "cygserver (cygwin) %d.%d.%d\n"
cygwin_version.dll_major / 1000, "Cygwin background service daemon\n"
cygwin_version.dll_major % 1000, "Copyright (C) 2001 - %s Red Hat, Inc.\n"
cygwin_version.dll_minor, "This is free software; see the source for copying conditions. There is NO\n"
cygwin_version.api_major, "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.",
cygwin_version.api_minor, CYGWIN_VERSION_DLL_MAJOR / 1000,
cygwin_version.shared_data, CYGWIN_VERSION_DLL_MAJOR % 1000,
CYGWIN_SERVER_VERSION_MAJOR, CYGWIN_VERSION_DLL_MINOR,
CYGWIN_SERVER_VERSION_API, strrchr (__DATE__, ' ') + 1);
CYGWIN_SERVER_VERSION_MINOR,
CYGWIN_SERVER_VERSION_PATCH,
cygwin_version.mount_registry,
cygwin_version.dll_build_date);
log (LOG_INFO, "(cygwin) %s\n"
"API version %s\n"
"Copyright 2001, 2002, 2003, 2004, 2005 Red Hat, Inc.\n"
"Compiled on %s\n"
"Default configuration file is %s",
SERVER_VERSION, buf, __DATE__, DEF_CONFIG_FILE);
} }
/* /*
@ -529,13 +526,13 @@ main (const int argc, char *argv[])
{"request-threads", required_argument, NULL, 'r'}, {"request-threads", required_argument, NULL, 'r'},
{"no-semaphores", no_argument, NULL, 's'}, {"no-semaphores", no_argument, NULL, 's'},
{"shutdown", no_argument, NULL, 'S'}, {"shutdown", no_argument, NULL, 'S'},
{"version", no_argument, NULL, 'v'}, {"version", no_argument, NULL, 'V'},
{"syslog", no_argument, NULL, 'y'}, {"syslog", no_argument, NULL, 'y'},
{"no-syslog", no_argument, NULL, 'Y'}, {"no-syslog", no_argument, NULL, 'Y'},
{0, no_argument, NULL, 0} {0, no_argument, NULL, 0}
}; };
const char opts[] = "c:deEf:hl:mp:qr:sSvyY"; const char opts[] = "c:deEf:hl:mp:qr:sSVyY";
long cleanup_threads = 0; long cleanup_threads = 0;
long request_threads = 0; long request_threads = 0;
@ -630,7 +627,7 @@ main (const int argc, char *argv[])
shutdown = true; shutdown = true;
break; break;
case 'v': case 'V':
print_version (); print_version ();
return 0; return 0;