[PATCH 8/8] lastlog2: besides -v, recognize also the standard -V for --version

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The --help text already proclaimed that -V would work.

CC: Stefan Schubert <schubi@xxxxxxx>
Signed-off-by: Benno Schulenberg <bensberg@xxxxxxxxxx>
---
 misc-utils/lastlog2.8.adoc | 6 +-----
 misc-utils/lastlog2.c      | 5 +++--
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/misc-utils/lastlog2.8.adoc b/misc-utils/lastlog2.8.adoc
index e14e6b9cc..8a4b604ae 100644
--- a/misc-utils/lastlog2.8.adoc
+++ b/misc-utils/lastlog2.8.adoc
@@ -70,11 +70,7 @@ Print only last-login records more recent than _days_.
 *-u*, *--user* _login_::
 Print (or modify) the last-login record of the user _login_.
 
-*-h*, *--help*::
-Display help text and exit.
-
-*-v*, *--version*::
-Display version and exit.
+include::man-common/help-version.adoc[]
 
 == FILES
 
diff --git a/misc-utils/lastlog2.c b/misc-utils/lastlog2.c
index 91ba699cf..e973b5461 100644
--- a/misc-utils/lastlog2.c
+++ b/misc-utils/lastlog2.c
@@ -147,7 +147,7 @@ int main(int argc, char **argv)
 		{"set",      no_argument,       NULL, 'S'},
 		{"time",     required_argument, NULL, 't'},
 		{"user",     required_argument, NULL, 'u'},
-		{"version",  no_argument,       NULL, 'v'},
+		{"version",  no_argument,       NULL, 'V'},
 		{NULL, 0, NULL, '\0'}
 	};
 	char *error = NULL;
@@ -163,7 +163,7 @@ int main(int argc, char **argv)
 
 	int c;
 
-	while ((c = getopt_long(argc, argv, "ab:Cd:hi:r:sSt:u:v", longopts, NULL)) != -1) {
+	while ((c = getopt_long(argc, argv, "ab:Cd:hi:r:sSt:u:vV", longopts, NULL)) != -1) {
 		switch (c) {
 		case 'a': /* active; print lastlog excluding '**Never logged in**' users */
 			aflg = 1;
@@ -214,6 +214,7 @@ int main(int argc, char **argv)
 			uflg = 1;
 			user = optarg;
 			break;
+		case 'V':
 		case 'v': /* version; Print version number and exit */
 			print_version(EXIT_SUCCESS);
 			break;
-- 
2.48.1





[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux