Extract usage information into a separate file.
[oweals/busybox.git] / whoami.c
index da584790d83e1e5c4ccc33263acf0084f5f50c3d..84b27fe58ec472f0b63f9f766fe77bf6b38e6243 100644 (file)
--- a/whoami.c
+++ b/whoami.c
 #include <stdio.h>
 #include <pwd.h>
 
-static const char whoami_usage[] = "whoami\n"
-#ifndef BB_FEATURE_TRIVIAL_HELP
-       "\nPrints the user name associated with the current effective user id.\n"
-#endif
-       ;
-
 extern int whoami_main(int argc, char **argv)
 {
        char *user = xmalloc(9);
@@ -43,7 +37,6 @@ extern int whoami_main(int argc, char **argv)
                puts(user);
                exit(TRUE);
        }
-       fprintf(stderr, "%s: cannot find username for UID %u\n", argv[0],
-                       (unsigned) uid);
-       exit(FALSE);
+       errorMsg("cannot find username for UID %u\n", (unsigned) uid);
+       return(FALSE);
 }