Module Name: src Committed By: wiz Date: Mon Jan 27 19:12:11 UTC 2025
Modified Files: src/usr.bin/getnameinfo: getnameinfo.1 getnameinfo.c Log Message: Sort options in usage and descriptions. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/usr.bin/getnameinfo/getnameinfo.1 \ src/usr.bin/getnameinfo/getnameinfo.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/getnameinfo/getnameinfo.1 diff -u src/usr.bin/getnameinfo/getnameinfo.1:1.1 src/usr.bin/getnameinfo/getnameinfo.1:1.2 --- src/usr.bin/getnameinfo/getnameinfo.1:1.1 Mon Jan 27 18:30:19 2025 +++ src/usr.bin/getnameinfo/getnameinfo.1 Mon Jan 27 19:12:11 2025 @@ -1,4 +1,4 @@ -.\" $NetBSD: getnameinfo.1,v 1.1 2025/01/27 18:30:19 christos Exp $ +.\" $NetBSD: getnameinfo.1,v 1.2 2025/01/27 19:12:11 wiz Exp $ .\" .\" Copyright (c) 2025 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -35,7 +35,7 @@ .Nd resolve IP addresses and ports to host and service names .Sh SYNOPSIS .Nm -.Op Fl 46rufnNHS +.Op Fl 46fHNnrSu .Op Fl p Ar port .Ar IP-address .Sh DESCRIPTION @@ -63,48 +63,48 @@ configuration, it is not intended to rep .Xr dig 1 . .Pp The following options are available: -.Bl -tag -width Ds +.Bl -tag -width 8n .It Fl 4 Restrict the lookup to IPv4 addresses only. .It Fl 6 Restrict the lookup to IPv6 addresses only. -.It Fl r -Ensure that a name is returned. -If no name can be resolved, an error is reported. -This is equivalent to the -.Dv NI_NAMEREQD -flag in -.Xr getnameinfo 3 . -.It Fl u -Use UDP instead of the default TCP. -This is equivalent to the -.Dv NI_DGRAM -flag in -.Xr getnameinfo 3 . .It Fl f Suppress the fully-qualified domain name (FQDN). This is equivalent to the .Dv NI_NOFQDN flag in .Xr getnameinfo 3 . +.It Fl H +Display only the hostname, omitting the service name. +.It Fl N +Display the numeric service name instead of resolving to a service name. +This is equivalent to the +.Dv NI_NUMERICSERV +flag in +.Xr getnameinfo 3 . .It Fl n Display the numeric host address instead of resolving to a hostname. This is equivalent to the .Dv NI_NUMERICHOST flag in .Xr getnameinfo 3 . -.It Fl N -Display the numeric service name instead of resolving to a service name. +.It Fl p Ar port +Specify the port number to be used in the lookup. +.It Fl r +Ensure that a name is returned. +If no name can be resolved, an error is reported. This is equivalent to the -.Dv NI_NUMERICSERV +.Dv NI_NAMEREQD flag in .Xr getnameinfo 3 . -.It Fl H -Display only the hostname, omitting the service name. .It Fl S Display only the service name, omitting the hostname. -.It Fl p Ar port -Specify the port number to be used in the lookup. +.It Fl u +Use UDP instead of the default TCP. +This is equivalent to the +.Dv NI_DGRAM +flag in +.Xr getnameinfo 3 . .El .Sh EXIT STATUS .Ex -std getnameinfo Index: src/usr.bin/getnameinfo/getnameinfo.c diff -u src/usr.bin/getnameinfo/getnameinfo.c:1.1 src/usr.bin/getnameinfo/getnameinfo.c:1.2 --- src/usr.bin/getnameinfo/getnameinfo.c:1.1 Mon Jan 27 18:30:19 2025 +++ src/usr.bin/getnameinfo/getnameinfo.c Mon Jan 27 19:12:11 2025 @@ -1,4 +1,4 @@ -/* $NetBSD: getnameinfo.c,v 1.1 2025/01/27 18:30:19 christos Exp $ */ +/* $NetBSD: getnameinfo.c,v 1.2 2025/01/27 19:12:11 wiz Exp $ */ /* * Copyright (c) 2025 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: getnameinfo.c,v 1.1 2025/01/27 18:30:19 christos Exp $"); +__RCSID("$NetBSD: getnameinfo.c,v 1.2 2025/01/27 19:12:11 wiz Exp $"); #endif #include <sys/types.h> @@ -54,18 +54,18 @@ __RCSID("$NetBSD: getnameinfo.c,v 1.1 20 * similar to the getnameinfo function in the standard library. * * usage: - * getnameinfo [-46rufnNHS] [-p port] <IP-address> + * getnameinfo [-46fHNnrSu] [-p port] <IP-address> * * -4: Restrict lookup to IPv4 addresses only * -6: Restrict lookup to IPv6 addresses only - * -r: Ensure that the name is returned (error if no name is found) - * -u: Use UDP instead of the default TCP * -f: Suppress the fully-qualified domain name (FQDN) - * -n: Display the numeric host address instead of the hostname - * -N: Display the numeric service name instead of the service name * -H: Display only the hostname, omitting the service name - * -S: Display only the service name, omitting the hostname + * -N: Display the numeric service name instead of the service name + * -n: Display the numeric host address instead of the hostname * -p: Specify the port number to be used in the lookup + * -r: Ensure that the name is returned (error if no name is found) + * -S: Display only the service name, omitting the hostname + * -u: Use UDP instead of the default TCP */ @@ -257,6 +257,6 @@ static void __dead usage(void) { (void)fprintf(stderr, "Usage: %s", getprogname()); - (void)fprintf(stderr, " [-46rufnNHS] [-p port] <IP-address>\n"); + (void)fprintf(stderr, " [-46fHNnrSu] [-p port] <IP-address>\n"); exit(EXIT_FAILURE); }