]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
chsh: use -h as shorthand for --help instead of -u
authorAndreas Henriksson <andreas@fatal.se>
Thu, 19 Jan 2017 22:04:47 +0000 (23:04 +0100)
committerAndreas Henriksson <andreas@fatal.se>
Thu, 19 Jan 2017 22:11:42 +0000 (23:11 +0100)
The -u is still supported (but no longer documented).

(This matches the switches used by shadow chsh.)

login-utils/chsh.1
login-utils/chsh.c

index d63c23e695be814f36f01769c1ee150492258f35..c03ef65e51040d21bf0f1247ec7624c1780d31ba 100644 (file)
@@ -14,7 +14,7 @@ chsh \- change your login shell
 .RB [ \-s
 .IR shell ]
 .RB [ \-l ]
-.RB [ \-u ]
+.RB [ \-h ]
 .RB [ \-v ]
 .RI [ username ]
 .SH DESCRIPTION
@@ -38,7 +38,7 @@ Print the list of shells listed in
 .I /etc/shells
 and exit.
 .TP
-.BR \-u , " \-\-help"
+.BR \-h , " \-\-help"
 Display help text and exit.
 .TP
 .BR \-v , " \-\-version"
index 79fc19d2c0b0936c6862a9ed569882ba50fe381b..c7defd49f60fa4479cc017ede4a29ac6c86a515b 100644 (file)
@@ -131,18 +131,19 @@ static void parse_argv(int argc, char **argv, struct sinfo *pinfo)
        static const struct option long_options[] = {
                {"shell", required_argument, 0, 's'},
                {"list-shells", no_argument, 0, 'l'},
-               {"help", no_argument, 0, 'u'},
+               {"help", no_argument, 0, 'h'},
                {"version", no_argument, 0, 'v'},
                {NULL, no_argument, 0, '0'},
        };
        int c;
 
-       while ((c = getopt_long(argc, argv, "s:luv", long_options, NULL)) != -1) {
+       while ((c = getopt_long(argc, argv, "s:lhuv", long_options, NULL)) != -1) {
                switch (c) {
                case 'v':
                        printf(UTIL_LINUX_VERSION);
                        exit(EXIT_SUCCESS);
-               case 'u':
+               case 'u': /* deprecated */
+               case 'h':
                        usage(stdout);
                case 'l':
                        get_shell_list(NULL);