From 92b499acff8a35d64ec0f9b27b5df06209656ca9 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 10 Oct 2011 14:57:48 +0000 Subject: * Align usage output, version output, as well as usage and version option handling to use the same style throughout all Cygwin utils. Throughout use program_invocation_short_name to refer to current process name in Cygwin executables. * utils.sgml: Align documentation to above change. Add missing sections for getconf, ldd, and setmetamode. * strace.cc (proc_child): Avoid compiler warning. --- winsup/utils/cygcheck.cc | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) (limited to 'winsup/utils/cygcheck.cc') diff --git a/winsup/utils/cygcheck.cc b/winsup/utils/cygcheck.cc index a05a846..01b017c 100644 --- a/winsup/utils/cygcheck.cc +++ b/winsup/utils/cygcheck.cc @@ -22,9 +22,11 @@ #include "path.h" #include "wide_path.h" #include +#include "cygwin/include/cygwin/version.h" #include "cygwin/include/sys/cygwin.h" #include "cygwin/include/mntent.h" #include "cygwin/cygprops.h" +#include "cygwin/version.h" #undef cygwin_internal #include "loadlib.h" @@ -64,8 +66,6 @@ void dump_dodgy_apps (int verbose); /* Forward declaration */ static void usage (FILE *, int); -static const char version[] = "$Revision$"; - static const char *known_env_vars[] = { "c_include_path", "compiler_path", @@ -2237,24 +2237,15 @@ static char opts[] = "cdsrvkflphV"; static void print_version () { - const char *v = strchr (version, ':'); - int len; - if (!v) - { - v = "?"; - len = 1; - } - else - { - v += 2; - len = strchr (v, ' ') - v; - } - printf ("\ -cygcheck version %.*s\n\ -System Checker for Cygwin\n\ -Copyright (C) 1998 - 2008 Red Hat, Inc.\n\ -Compiled on %s\n\ -", len, v, __DATE__); + printf ("cygcheck (cygwin) %d.%d.%d\n" + "System Checker for Cygwin\n" + "Copyright (C) 1998 - %s Red Hat, Inc.\n" + "This is free software; see the source for copying conditions. There is NO\n" + "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n", + CYGWIN_VERSION_DLL_MAJOR / 1000, + CYGWIN_VERSION_DLL_MAJOR % 1000, + CYGWIN_VERSION_DLL_MINOR, + strrchr (__DATE__, ' ') + 1); } void @@ -2376,8 +2367,10 @@ main (int argc, char **argv) print_version (); exit (0); default: - usage (stderr, 1); - /*NOTREACHED*/} + fprintf (stderr, "Try `cygcheck --help' for more information.\n"); + exit (1); + /*NOTREACHED*/ + } argc -= optind; argv += optind; if (posixly == NULL) -- cgit v1.1