]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
chfn: align with howto-usage-function.txt
authorSami Kerola <kerolasa@iki.fi>
Sun, 13 Nov 2011 13:06:24 +0000 (14:06 +0100)
committerSami Kerola <kerolasa@iki.fi>
Wed, 23 Nov 2011 20:20:11 +0000 (21:20 +0100)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
login-utils/chfn.c

index 03985089c976b959fa546ddf946947f3de09900c..30f029b932dbf6653e9af814c088dfd5e72faf5c 100644 (file)
@@ -93,10 +93,17 @@ static int save_new_data (struct finfo *pinfo);
 
 static void __attribute__((__noreturn__)) usage(FILE *fp)
 {
-    fprintf (fp, _("Usage: %s [ -f full-name ] [ -o office ] "), whoami);
-    fprintf (fp, _("[ -p office-phone ]\n      [ -h home-phone ] "));
-    fprintf (fp, _("[ --help ] [ --version ]\n"));
-
+    fputs(USAGE_HEADER, fp);
+    fprintf(fp, _(" %s [options] [username]\n"), program_invocation_short_name);
+    fputs(USAGE_OPTIONS, fp);
+    fputs(_(" -f, --full-name <full-name>  real name\n"), fp);
+    fputs(_(" -o, --office <office>        office number\n"), fp);
+    fputs(_(" -p, --office-phone <phone>   office phone number\n"), fp);
+    fputs(_(" -h, --home-phone <phone>     home phone number\n"), fp);
+    fputs(USAGE_SEPARATOR, fp);
+    fputs(_(" -u, --help     display this help and exit\n"), fp);
+    fputs(_(" -v, --version  output version information and exit\n"), fp);
+    fprintf(fp, USAGE_MAN_TAIL("chfn(1)"));
     exit(fp == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
 }
 
@@ -241,7 +248,7 @@ static boolean parse_argv(int argc, char *argv[], struct finfo *pinfo)
        if (c == -1) break;
        /* version?  output version and exit. */
        if (c == 'v') {
-           printf ("%s\n", PACKAGE_STRING);
+           printf (UTIL_LINUX_VERSION);
            exit (EXIT_SUCCESS);
        }
        if (c == 'u')