From: Sami Kerola Date: Sun, 13 Nov 2011 13:06:24 +0000 (+0100) Subject: chfn: align with howto-usage-function.txt X-Git-Tag: v2.21-rc1~149^2~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=85b6104da5b9b7e9ba63d69cdca7badebf2368a4;p=thirdparty%2Futil-linux.git chfn: align with howto-usage-function.txt Signed-off-by: Sami Kerola --- diff --git a/login-utils/chfn.c b/login-utils/chfn.c index 03985089c9..30f029b932 100644 --- a/login-utils/chfn.c +++ b/login-utils/chfn.c @@ -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 real name\n"), fp); + fputs(_(" -o, --office office number\n"), fp); + fputs(_(" -p, --office-phone office phone number\n"), fp); + fputs(_(" -h, --home-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')