From: Sami Kerola Date: Sun, 13 Nov 2011 16:14:51 +0000 (+0100) Subject: login: add version printing option X-Git-Tag: v2.21-rc1~149^2~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0effd19e00081fcadb81ba77e912862f27180aff;p=thirdparty%2Futil-linux.git login: add version printing option Signed-off-by: Sami Kerola --- diff --git a/login-utils/login.1 b/login-utils/login.1 index 93ab82c91f..d5d372d88b 100644 --- a/login-utils/login.1 +++ b/login-utils/login.1 @@ -122,6 +122,9 @@ Used by other servers (i.e., to tell .B login that printing the hostname should be suppressed in the login: prompt. +.TP +.B \-V +Print version and exit. .SH CONFIG FILE ITEMS .B login diff --git a/login-utils/login.c b/login-utils/login.c index 0024055554..e80b137ba3 100644 --- a/login-utils/login.c +++ b/login-utils/login.c @@ -1241,7 +1241,7 @@ int main(int argc, char **argv) * -h is used by other servers to pass the name of the remote * host to login so that it may be placed in utmp and wtmp */ - while ((c = getopt(argc, argv, "fHh:p")) != -1) + while ((c = getopt(argc, argv, "fHh:pV")) != -1) switch (c) { case 'f': cxt.noauth = 1; @@ -1264,6 +1264,9 @@ int main(int argc, char **argv) cxt.keep_env = 1; break; + case 'V': + printf(UTIL_LINUX_VERSION); + return EXIT_SUCCESS; case '?': default: fprintf(stderr, _("usage: login [ -p ] [ -h host ] [ -H ] [ -f username | username ]\n"));