From 85b6104da5b9b7e9ba63d69cdca7badebf2368a4 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sun, 13 Nov 2011 14:06:24 +0100 Subject: chfn: align with howto-usage-function.txt Signed-off-by: Sami Kerola --- login-utils/chfn.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'login-utils/chfn.c') diff --git a/login-utils/chfn.c b/login-utils/chfn.c index 03985089c..30f029b93 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') -- cgit v1.2.3-55-g7522