]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lastlog2: besides -v, recognize also the standard -V for --version
authorBenno Schulenberg <bensberg@telfort.nl>
Mon, 14 Apr 2025 09:45:34 +0000 (11:45 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 15 Apr 2025 11:53:43 +0000 (13:53 +0200)
The --help text already proclaimed that -V would work.

CC: Stefan Schubert <schubi@suse.de>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
misc-utils/lastlog2.8.adoc
misc-utils/lastlog2.c

index 6471cae1cd74bba22ac7793a7524323512de4f2c..4857cfdce89c85604a5fc06b878f6737eb5bc62a 100644 (file)
@@ -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
 
index 91ba699cf27e6dd27c4815d7bf69a3626919bfee..e973b54615c02b6223ff3e6df2085932fcc69f16 100644 (file)
@@ -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;