]> diplodocus.org Git - nmh/blob - man/ap.man
sbr/utils.c: Add HasSuffix(s, suffix).
[nmh] / man / ap.man
1 .TH AP %manext8% "December 4, 2013" "%nmhversion%"
2 .\"
3 .\" %nmhwarning%
4 .\"
5 .SH NAME
6 ap \- parse addresses RFC 822-style
7 .SH SYNOPSIS
8 .HP 5
9 .na
10 .B %nmhlibexecdir%/ap
11 .RB [ \-help ]
12 .RB [ \-version ]
13 .RB [ \-form
14 .IR formatfile ]
15 .RB [ \-format
16 .IR string ]
17 .RB [ \-width
18 .IR columns ]
19 .I addrs
20 \&...
21 .ad
22 .SH DESCRIPTION
23 .B ap
24 is a program that parses addresses according to the ARPA
25 Internet standard. It also understands many non\-standard formats.
26 It is useful for seeing how
27 .B nmh
28 will interpret an address.
29 .PP
30 The
31 .B ap
32 program treats each argument as one or more addresses, and
33 prints those addresses out in the official RFC 822 format. Hence, it is
34 usually best to enclose each argument in quotes for the shell.
35 .PP
36 To override the output format used by
37 .BR ap ,
38 the
39 .B \-format
40 .I string
41 or
42 .B \-format
43 .I file
44 switches are used. This permits individual fields of
45 the address to be extracted with ease. The string is simply a format
46 string, and the file is simply a format file. See
47 .IR mh\-format (5)
48 for the details.
49 .PP
50 In addition to the standard escapes,
51 .B ap
52 also recognizes the following additional escape:
53 .PP
54 .RS 5
55 .nf
56 .ta \w'Escape 'u +\w'Returns 'u
57 .I "Escape Returns Description"
58 error string A diagnostic if the parse failed
59 .RE
60 .fi
61 .PP
62 Here is the default format string used by
63 .BR ap :
64 .PP
65 .RS 5
66 %<{error}%{error}: %{text}%|%(putstr(proper{text}))%>
67 .RE
68 .PP
69 which says that if an error was detected, print the error, a `:', and
70 the address in error. Otherwise, output the RFC 822\-proper format of
71 the address.
72 .SH FILES
73 .PD 0
74 .TP 20
75 $HOME/\&.mh\(ruprofile
76 The user's profile.
77 .TP
78 %nmhetcdir%/mts.conf
79 The mts configuration file.
80 .PD
81 .SH "PROFILE COMPONENTS"
82 None
83 .SH "SEE ALSO"
84 .IR dp (8)
85 .PP
86 .I
87 Standard for the Format of ARPA Internet Text Messages
88 (RFC 822)
89 .SH DEFAULTS
90 .PD 0
91 .TP 20
92 -format
93 As described above.
94 .TP
95 \-width
96 The width of the terminal.
97 .PD
98 .SH CONTEXT
99 None