ec6808b7a1936414067f9163b9e7f7936e1e5c5a
[mmh] / man / ap.man
1 .\"
2 .\" %nmhwarning%
3 .\" $Id$
4 .\"
5 .TH AP %manext8% "%nmhdate%" MH.6.8 [%nmhversion%]
6 .SH NAME
7 ap \- parse addresses 822-style
8 .SH SYNOPSIS
9 .HP 5
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 .IR addrs " ..."
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 .BI \-format " string"
39 or
40 .BI \-format " file"
41 switches are used.  This permits individual fields of
42 the address to be extracted with ease.  The string is simply a format
43 string, and the file is simply a format file.  See
44 .BR mh\-format (5)
45 for the details.
46 .PP
47 In addition to the standard escapes,
48 .B ap
49 also recognizes the following additional escape:
50 .PP
51 .RS 5
52 .fc ^ ~
53 .nf
54 .ta \w'Escape  'u +\w'Returns  'u
55 .I Escape       Returns Description
56 error   string  A diagnostic if the parse failed
57 .RE
58 .fi
59 .PP
60 If the
61 .B \-normalize
62 switch is given,
63 .B ap
64 will try to track down
65 the official hostname of the address.
66 .PP
67 Here is the default format string used by
68 .BR ap :
69 .PP
70 .RS 5
71 %<{error}%{error}: %{text}%|%(putstr(proper{text}))%>
72 .RE
73 .PP
74 which says that if an error was detected, print the error, a `:', and
75 the address in error.  Otherwise, output the 822\-proper format of
76 the address.
77
78 .SH FILES
79 .fc ^ ~
80 .nf
81 .ta \w'/usr/local/nmh/etc/ExtraBigFileName  'u
82 ^$HOME/\&.mh\(ruprofile~^The user profile
83 ^%etcdir%/mts.conf~^nmh mts configuration file
84
85 .SH "PROFILE COMPONENTS"
86 None
87
88 .SH "SEE ALSO"
89 dp(8),
90 .IR "Standard for the Format of ARPA Internet Text Messages" " (RFC\-822)"
91
92 .SH "DEFAULTS"
93 .nf
94 .RB ` \-format "' defaults as described above"
95 .RB ` \-normalize '
96 .RB ` \-width "' defaults to the width of the terminal"
97
98 .SH CONTEXT
99 None
100
101 .SH BUGS
102 The argument to the
103 .B \-format
104 switch must be interpreted as a single token
105 by the shell that invokes
106 .BR ap .
107 Therefore,
108 one must usually place the argument to this switch inside double\-quotes.