From: Andreas Henriksson Date: Thu, 19 Jan 2017 22:04:47 +0000 (+0100) Subject: chsh: use -h as shorthand for --help instead of -u X-Git-Tag: v2.30-rc1~288^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=631a195412;p=thirdparty%2Futil-linux.git 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.) --- diff --git a/login-utils/chsh.1 b/login-utils/chsh.1 index d63c23e695..c03ef65e51 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 79fc19d2c0..c7defd49f6 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);