Skip to content

Commit 304a0d2

Browse files
committed
Sort options in usage and descriptions.
1 parent 13ee68e commit 304a0d2

2 files changed

Lines changed: 32 additions & 32 deletions

File tree

usr.bin/getnameinfo/getnameinfo.1

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.\" $NetBSD: getnameinfo.1,v 1.1 2025/01/27 18:30:19 christos Exp $
1+
.\" $NetBSD: getnameinfo.1,v 1.2 2025/01/27 19:12:11 wiz Exp $
22
.\"
33
.\" Copyright (c) 2025 The NetBSD Foundation, Inc.
44
.\" All rights reserved.
@@ -35,7 +35,7 @@
3535
.Nd resolve IP addresses and ports to host and service names
3636
.Sh SYNOPSIS
3737
.Nm
38-
.Op Fl 46rufnNHS
38+
.Op Fl 46fHNnrSu
3939
.Op Fl p Ar port
4040
.Ar IP-address
4141
.Sh DESCRIPTION
@@ -63,48 +63,48 @@ configuration, it is not intended to replace DNS-specific tools like
6363
.Xr dig 1 .
6464
.Pp
6565
The following options are available:
66-
.Bl -tag -width Ds
66+
.Bl -tag -width 8n
6767
.It Fl 4
6868
Restrict the lookup to IPv4 addresses only.
6969
.It Fl 6
7070
Restrict the lookup to IPv6 addresses only.
71-
.It Fl r
72-
Ensure that a name is returned.
73-
If no name can be resolved, an error is reported.
74-
This is equivalent to the
75-
.Dv NI_NAMEREQD
76-
flag in
77-
.Xr getnameinfo 3 .
78-
.It Fl u
79-
Use UDP instead of the default TCP.
80-
This is equivalent to the
81-
.Dv NI_DGRAM
82-
flag in
83-
.Xr getnameinfo 3 .
8471
.It Fl f
8572
Suppress the fully-qualified domain name (FQDN).
8673
This is equivalent to the
8774
.Dv NI_NOFQDN
8875
flag in
8976
.Xr getnameinfo 3 .
77+
.It Fl H
78+
Display only the hostname, omitting the service name.
79+
.It Fl N
80+
Display the numeric service name instead of resolving to a service name.
81+
This is equivalent to the
82+
.Dv NI_NUMERICSERV
83+
flag in
84+
.Xr getnameinfo 3 .
9085
.It Fl n
9186
Display the numeric host address instead of resolving to a hostname.
9287
This is equivalent to the
9388
.Dv NI_NUMERICHOST
9489
flag in
9590
.Xr getnameinfo 3 .
96-
.It Fl N
97-
Display the numeric service name instead of resolving to a service name.
91+
.It Fl p Ar port
92+
Specify the port number to be used in the lookup.
93+
.It Fl r
94+
Ensure that a name is returned.
95+
If no name can be resolved, an error is reported.
9896
This is equivalent to the
99-
.Dv NI_NUMERICSERV
97+
.Dv NI_NAMEREQD
10098
flag in
10199
.Xr getnameinfo 3 .
102-
.It Fl H
103-
Display only the hostname, omitting the service name.
104100
.It Fl S
105101
Display only the service name, omitting the hostname.
106-
.It Fl p Ar port
107-
Specify the port number to be used in the lookup.
102+
.It Fl u
103+
Use UDP instead of the default TCP.
104+
This is equivalent to the
105+
.Dv NI_DGRAM
106+
flag in
107+
.Xr getnameinfo 3 .
108108
.El
109109
.Sh EXIT STATUS
110110
.Ex -std getnameinfo

usr.bin/getnameinfo/getnameinfo.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: getnameinfo.c,v 1.1 2025/01/27 18:30:19 christos Exp $ */
1+
/* $NetBSD: getnameinfo.c,v 1.2 2025/01/27 19:12:11 wiz Exp $ */
22

33
/*
44
* Copyright (c) 2025 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
3131

3232
#include <sys/cdefs.h>
3333
#ifndef lint
34-
__RCSID("$NetBSD: getnameinfo.c,v 1.1 2025/01/27 18:30:19 christos Exp $");
34+
__RCSID("$NetBSD: getnameinfo.c,v 1.2 2025/01/27 19:12:11 wiz Exp $");
3535
#endif
3636

3737
#include <sys/types.h>
@@ -54,18 +54,18 @@ __RCSID("$NetBSD: getnameinfo.c,v 1.1 2025/01/27 18:30:19 christos Exp $");
5454
* similar to the getnameinfo function in the standard library.
5555
*
5656
* usage:
57-
* getnameinfo [-46rufnNHS] [-p port] <IP-address>
57+
* getnameinfo [-46fHNnrSu] [-p port] <IP-address>
5858
*
5959
* -4: Restrict lookup to IPv4 addresses only
6060
* -6: Restrict lookup to IPv6 addresses only
61-
* -r: Ensure that the name is returned (error if no name is found)
62-
* -u: Use UDP instead of the default TCP
6361
* -f: Suppress the fully-qualified domain name (FQDN)
64-
* -n: Display the numeric host address instead of the hostname
65-
* -N: Display the numeric service name instead of the service name
6662
* -H: Display only the hostname, omitting the service name
67-
* -S: Display only the service name, omitting the hostname
63+
* -N: Display the numeric service name instead of the service name
64+
* -n: Display the numeric host address instead of the hostname
6865
* -p: Specify the port number to be used in the lookup
66+
* -r: Ensure that the name is returned (error if no name is found)
67+
* -S: Display only the service name, omitting the hostname
68+
* -u: Use UDP instead of the default TCP
6969
*/
7070

7171

@@ -257,6 +257,6 @@ static void __dead
257257
usage(void)
258258
{
259259
(void)fprintf(stderr, "Usage: %s", getprogname());
260-
(void)fprintf(stderr, " [-46rufnNHS] [-p port] <IP-address>\n");
260+
(void)fprintf(stderr, " [-46fHNnrSu] [-p port] <IP-address>\n");
261261
exit(EXIT_FAILURE);
262262
}

0 commit comments

Comments
 (0)