summaryrefslogtreecommitdiffstats
path: root/login-utils/chsh.c
diff options
context:
space:
mode:
authorSami Kerola2011-11-13 14:31:03 +0100
committerSami Kerola2011-11-23 21:37:19 +0100
commitfbff9d7996c8767cdb023719f6fce3173167aba4 (patch)
tree04439d68523bd5c04c9b6c617ed562ea744abadc /login-utils/chsh.c
parentchfn: use libc error printing facilities (diff)
downloadkernel-qcow2-util-linux-fbff9d7996c8767cdb023719f6fce3173167aba4.tar.gz
kernel-qcow2-util-linux-fbff9d7996c8767cdb023719f6fce3173167aba4.tar.xz
kernel-qcow2-util-linux-fbff9d7996c8767cdb023719f6fce3173167aba4.zip
chsh: align with howto-usage-function.txt
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'login-utils/chsh.c')
-rw-r--r--login-utils/chsh.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/login-utils/chsh.c b/login-utils/chsh.c
index 9ab2ca62a..2cc7304d3 100644
--- a/login-utils/chsh.c
+++ b/login-utils/chsh.c
@@ -82,11 +82,15 @@ static boolean get_shell_list (char *shell);
static void __attribute__((__noreturn__)) usage (FILE *fp)
{
- fprintf (fp,
- _("Usage: %1$s [-s shell] [username]\n"
- " or: %1$s (--list-shells | --help | --version)\n"),
- whoami);
-
+ fputs(USAGE_HEADER, fp);
+ fprintf(fp, _(" %s [options] [username]\n"), program_invocation_short_name);
+ fputs(USAGE_OPTIONS, fp);
+ fputs(_(" -s, --shell <shell> specify login shell\n"), fp);
+ fputs(_(" -l, --list-shells print list of shells and exit\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("chsh(1)"));
exit(fp == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
}
@@ -242,7 +246,7 @@ parse_argv (int argc, char *argv[], struct sinfo *pinfo) {
case -1:
break;
case 'v':
- printf ("%s\n", PACKAGE_STRING);
+ printf (UTIL_LINUX_VERSION);
exit (EXIT_SUCCESS);
case 'u':
usage (stdout);