diff options
author | Sami Kerola | 2011-11-13 17:14:51 +0100 |
---|---|---|
committer | Sami Kerola | 2011-11-23 21:37:19 +0100 |
commit | 0effd19e00081fcadb81ba77e912862f27180aff (patch) | |
tree | 543e372cb9a1c42a02f1c81bd35ee364e8f6a75d | |
parent | newgrp: add version and help options (diff) | |
download | kernel-qcow2-util-linux-0effd19e00081fcadb81ba77e912862f27180aff.tar.gz kernel-qcow2-util-linux-0effd19e00081fcadb81ba77e912862f27180aff.tar.xz kernel-qcow2-util-linux-0effd19e00081fcadb81ba77e912862f27180aff.zip |
login: add version printing option
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
-rw-r--r-- | login-utils/login.1 | 3 | ||||
-rw-r--r-- | login-utils/login.c | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/login-utils/login.1 b/login-utils/login.1 index 93ab82c91..d5d372d88 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 002405555..e80b137ba 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")); |