Fixed dist(1): The link() must fail, because m_mktemp2() creates the file.
[mmh] / man / ap.man8
1 .\"
2 .\" %nmhwarning%
3 .\"
4 .TH AP %manext8% "%nmhdate%" MH.6.8 [%nmhversion%]
5 .SH NAME
6 ap \- parse addresses 822-style
7 .SH SYNOPSIS
8 .HP 5
9 .na
10 .B %libdir%/ap
11 .RB [ \-form
12 .IR formatfile ]
13 .RB [ \-format
14 .IR string ]
15 .RB [ \-normalize " | " \-nonormalize ]
16 .RB [ \-width
17 .IR columns ]
18 .RB [ \-version ]
19 .RB [ \-help ]
20 .I addrs
21 \&...
22 .ad
23 .SH DESCRIPTION
24 .B Ap
25 is a program that parses addresses according to the ARPA
26 Internet standard.  It also understands many non\-standard formats.
27 It is useful for seeing how
28 .B nmh
29 will interpret an address.
30 .PP
31 The
32 .B ap
33 program treats each argument as one or more addresses, and
34 prints those addresses out in the official 822\-format.  Hence, it is
35 usually best to enclose each argument in double\-quotes for the shell.
36 .PP
37 To override the output format used by
38 .BR ap ,
39 the
40 .B \-format
41 .I string
42 or
43 .B \-format
44 .I file
45 switches are used.  This permits individual fields of
46 the address to be extracted with ease.  The string is simply a format
47 string, and the file is simply a format file.  See
48 .BR mh\-format (5)
49 for the details.
50 .PP
51 In addition to the standard escapes,
52 .B ap
53 also recognizes the following additional escape:
54 .PP
55 .RS 5
56 .nf
57 .ta \w'Escape  'u +\w'Returns  'u
58 .I Escape       Returns Description
59 error   string  A diagnostic if the parse failed
60 .RE
61 .fi
62 .PP
63 If the
64 .B \-normalize
65 switch is given,
66 .B ap
67 will try to track down
68 the official hostname of the address.
69 .PP
70 Here is the default format string used by
71 .BR ap :
72 .PP
73 .RS 5
74 %<{error}%{error}: %{text}%|%(putstr(proper{text}))%>
75 .RE
76 .PP
77 which says that if an error was detected, print the error, a `:', and
78 the address in error.  Otherwise, output the 822\-proper format of
79 the address.
80
81 .SH FILES
82 .fc ^ ~
83 .nf
84 .ta \w'%etcdir%/ExtraBigFileName  'u
85 ^$HOME/.mmh/profile~^The user profile
86 .fi
87
88 .SH "PROFILE COMPONENTS"
89 None
90
91 .SH "SEE ALSO"
92 dp(8),
93 .I "Standard for the Format of ARPA Internet Text Messages"
94 (RFC\-822)
95
96 .SH DEFAULTS
97 .nf
98 .RB ` \-format "' defaults as described above"
99 .RB ` \-normalize '
100 .RB ` \-width "' defaults to the width of the terminal"
101 .fi
102
103 .SH CONTEXT
104 None
105
106 .SH BUGS
107 The argument to the
108 .B \-format
109 switch must be interpreted as a single token
110 by the shell that invokes
111 .BR ap .
112 Therefore,
113 one must usually place the argument to this switch inside double\-quotes.