(WRITTEN_BY): Rename from AUTHORS.
[platform/upstream/coreutils.git] / src / whoami.c
index ec20bb6..be7bc04 100644 (file)
@@ -1,5 +1,5 @@
 /* whoami -- print effective userid
-   Copyright (C) 89,90, 1991-1997, 1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 89,90, 1991-1997, 1999-2002 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
 #include "system.h"
 #include "long-options.h"
-#include "closeout.h"
 
 /* The official name of this program (e.g., no `g' prefix).  */
 #define PROGRAM_NAME "whoami"
 
-#define AUTHORS "Richard Mlynarik"
+#define WRITTEN_BY _("Written by Richard Mlynarik.")
 
 /* The name this program was run with. */
 char *program_name;
@@ -57,7 +56,7 @@ Same as id -un.\n\
 "), stdout);
       fputs (HELP_OPTION_DESCRIPTION, stdout);
       fputs (VERSION_OPTION_DESCRIPTION, stdout);
-      puts (_("\nReport bugs to <bug-sh-utils@gnu.org>."));
+      printf (_("\nReport bugs to <%s>.\n"), PACKAGE_BUGREPORT);
     }
   exit (status);
 }
@@ -69,6 +68,7 @@ main (int argc, char **argv)
   register uid_t uid;
   int c;
 
+  initialize_main (&argc, &argv);
   program_name = argv[0];
   setlocale (LC_ALL, "");
   bindtextdomain (PACKAGE, LOCALEDIR);
@@ -77,7 +77,7 @@ main (int argc, char **argv)
   atexit (close_stdout);
 
   parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION,
-                     AUTHORS, usage);
+                     WRITTEN_BY, usage);
 
   while ((c = getopt_long (argc, argv, "", long_options, NULL)) != -1)
     {
@@ -87,21 +87,21 @@ main (int argc, char **argv)
          break;
 
        default:
-         usage (1);
+         usage (EXIT_FAILURE);
        }
     }
 
   if (optind != argc)
-    usage (1);
+    usage (EXIT_FAILURE);
 
   uid = geteuid ();
   pw = getpwuid (uid);
   if (pw)
     {
       puts (pw->pw_name);
-      exit (0);
+      exit (EXIT_SUCCESS);
     }
   fprintf (stderr, _("%s: cannot find username for UID %u\n"),
           program_name, (unsigned) uid);
-  exit (1);
+  exit (EXIT_FAILURE);
 }