diff options
author | Andreas Henriksson <andreas@fatal.se> | 2017-01-19 23:04:47 +0100 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2017-01-20 13:14:58 +0100 |
commit | feed505ab0c20f5e231af7db3dfac0364ed6e44f (patch) | |
tree | 6bdbba4589b11b5c88efb583b1817294ec0206b6 | |
parent | 749993c70475a2c61074445c36b63153eadb1c65 (diff) | |
download | util-linux-feed505ab0c20f5e231af7db3dfac0364ed6e44f.tar.gz |
chsh: use -h as shorthand for --help instead of -u
The -u is still supported (but no longer documented).
(This matches the switches used by shadow chsh.)
-rw-r--r-- | login-utils/chsh.1 | 4 | ||||
-rw-r--r-- | login-utils/chsh.c | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/login-utils/chsh.1 b/login-utils/chsh.1 index 33082a61a..55804ad57 100644 --- a/login-utils/chsh.1 +++ b/login-utils/chsh.1 @@ -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" diff --git a/login-utils/chsh.c b/login-utils/chsh.c index e9e51832d..ea1c7ba36 100644 --- a/login-utils/chsh.c +++ b/login-utils/chsh.c @@ -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); |