aboutsummaryrefslogtreecommitdiff
path: root/winsup/utils/cygcheck.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2011-10-10 14:57:48 +0000
committerCorinna Vinschen <corinna@vinschen.de>2011-10-10 14:57:48 +0000
commit92b499acff8a35d64ec0f9b27b5df06209656ca9 (patch)
tree028b13e0eb9c8522daa2a868f0593a76d32e5adb /winsup/utils/cygcheck.cc
parent4fc8a5c90acb2501178613b04bca32492953884a (diff)
downloadnewlib-92b499acff8a35d64ec0f9b27b5df06209656ca9.zip
newlib-92b499acff8a35d64ec0f9b27b5df06209656ca9.tar.gz
newlib-92b499acff8a35d64ec0f9b27b5df06209656ca9.tar.bz2
* 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.
Diffstat (limited to 'winsup/utils/cygcheck.cc')
-rw-r--r--winsup/utils/cygcheck.cc37
1 files changed, 15 insertions, 22 deletions
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 <getopt.h>
+#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)