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

index 9ab2ca62a3894aa465bc869107a8f729ed1566ef..2cc7304d391060e256388912b7436d2e5c0a026a 100644 (file)
@@ -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);