Util-Linux package development
 help / color / mirror / Atom feed
From: Benno Schulenberg <bensberg@telfort.nl>
To: util-linux@vger.kernel.org
Cc: Stefan Schubert <schubi@suse.de>
Subject: [PATCH 8/8] lastlog2: besides -v, recognize also the standard -V for --version
Date: Mon, 14 Apr 2025 11:45:34 +0200	[thread overview]
Message-ID: <20250414094534.9504-8-bensberg@telfort.nl> (raw)
In-Reply-To: <20250414094534.9504-1-bensberg@telfort.nl>

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 | 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


  parent reply	other threads:[~2025-04-14  9:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-14  9:45 [PATCH 1/8] docs: rewrite the description of --bytes, to be clearer Benno Schulenberg
2025-04-14  9:45 ` [PATCH 2/8] docs: improve and harmonize the description of -H / --list-columns Benno Schulenberg
2025-04-14  9:45 ` [PATCH 3/8] docs: fix a few indentation issues Benno Schulenberg
2025-04-14  9:45 ` [PATCH 4/8] agetty,setterm: (man) remove the mistakenly added -h and -V short options Benno Schulenberg
2025-04-14  9:45 ` [PATCH 5/8] losetup,lscpu: (man) add the missing -h/--help and -V/--version options Benno Schulenberg
2025-04-14  9:45 ` [PATCH 6/8] docs: add -h/--help and -V/--version to three man pages that lacked them Benno Schulenberg
2025-04-14  9:45 ` [PATCH 7/8] lastlog2: (man) fix some broken markup, and lowercase option arguments Benno Schulenberg
2025-04-14  9:45 ` Benno Schulenberg [this message]
2025-04-16  8:23 ` [PATCH 1/8] docs: rewrite the description of --bytes, to be clearer Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250414094534.9504-8-bensberg@telfort.nl \
    --to=bensberg@telfort.nl \
    --cc=schubi@suse.de \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox