0a5ac5a8fb1ae8eb6a42a696a1fbbf6cd750f17c
[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 ^%etcdir%/mts.conf~^nmh mts configuration file
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 ` \-format "' 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 \-format
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.