Updating ali-mh_alias
[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 .I addrs
21 \&...
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 822\-format.  Hence, it is
34 usually best to enclose each argument in double\-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 .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 %<{error}%{error}: %{text}%|%(putstr(proper{text}))%>
74 .RE
75 .PP
76 which says that if an error was detected, print the error, a `:', and
77 the address in error.  Otherwise, output the 822\-proper format of
78 the address.
79
80 .SH FILES
81 .fc ^ ~
82 .nf
83 .ta \w'/usr/local/nmh/etc/ExtraBigFileName  'u
84 ^$HOME/\&.mh\(ruprofile~^The user profile
85 ^%etcdir%/mts.conf~^nmh mts configuration file
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.