summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--login-utils/login.13
-rw-r--r--login-utils/login.c5
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"));