b0ae6150b8e5b4a9c07b559a98f342bb80ca2eee
[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 [ \-normalize " | " \-nonormalize ]
14 .RB [ \-width
15 .IR columns ]
16 .RB [ \-version ]
17 .RB [ \-help ]
18 .I addrs
19 \&...
20 .ad
21 .SH DESCRIPTION
22 .B Ap
23 is a program that parses addresses according to the ARPA
24 Internet standard.  It also understands many non\-standard formats.
25 It is useful for seeing how
26 .B nmh
27 will interpret an address.
28 .PP
29 The
30 .B ap
31 program treats each argument as one or more addresses, and
32 prints those addresses out in the official 822\-format.  Hence, it is
33 usually best to enclose each argument in double\-quotes for the shell.
34 .PP
35 To override the output format used by
36 .BR ap ,
37 the
38 .B \-form
39 .I file
40 switch is used.  This permits individual fields of
41 the address to be extracted with ease.
42 The
43 .I file
44 is either the name of a format file or it may be
45 a format string directly, if prepended with an equal sign `='.
46 See
47 .BR 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 If the
63 .B \-normalize
64 switch is given,
65 .B ap
66 will try to track down
67 the official hostname of the address.
68 .PP
69 Here is the default format string used by
70 .BR ap :
71 .PP
72 .RS 5
73 .nf
74 %<{error}%{error}: %{text}%|%(putstr(proper{text}))%>
75 .fi
76 .RE
77 .PP
78 which says that if an error was detected, print the error, a `:', and
79 the address in error.  Otherwise, output the 822\-proper format of
80 the address.
81
82 .SH FILES
83 .fc ^ ~
84 .nf
85 .ta \w'%etcdir%/ExtraBigFileName  'u
86 ^$HOME/.mmh/profile~^The user profile
87 .fi
88
89 .SH "PROFILE COMPONENTS"
90 None
91
92 .SH "SEE ALSO"
93 dp(8),
94 .I "Standard for the Format of ARPA Internet Text Messages"
95 (RFC\-822)
96
97 .SH DEFAULTS
98 .nf
99 .RB ` \-form "' defaults as described above"
100 .RB ` \-normalize '
101 .RB ` \-width "' defaults to the width of the terminal"
102 .fi
103
104 .SH CONTEXT
105 None
106
107 .SH BUGS
108 The argument to the
109 .B \-form
110 switch must be interpreted as a single token
111 by the shell that invokes
112 .BR ap .
113 Therefore,
114 one must usually place the argument to this switch inside double\-quotes.