]> diplodocus.org Git - nmh/blobdiff - man/fmttest.man
lock_file.c: close(2) file descriptor on failure, avoiding leak.
[nmh] / man / fmttest.man
index 59626da3ef1361e269ba7219139bb855e421c67e..ae3413ae91f6a4cecf2eb154f57aed9b87806325 100644 (file)
@@ -1,29 +1,27 @@
-.TH FMTTEST %manext1% "February 19, 2013" "%nmhversion%"
-.\"
+.TH FMTTEST %manext1% 2014-08-31 "%nmhversion%"
+.
 .\" %nmhwarning%
-.\"
-.SH FMTTEST
-fmttest \- test tool for the
-.IR mh-format (5)
-language
+.
+.SH NAME
+fmttest \- test programs in nmh's \fImh-format\fP\^(5) language
 .SH SYNOPSIS
 .HP 5
 .na
 .B fmttest
+.RB [ \-help ]
+.RB [ \-version ]
 .RB [ \-form
 .IR formatfile ]
 .RB [ \-format
 .IR formatstring ]
 .RB [ \-address " | " \-raw " | " \-date " | " \-message ]
+.RB [ \-file " | " \-nofile ]
 .RB [ \-\|\-component
 .IR component-text ]
 .RB [ \-dupaddrs " | " \-nodupaddrs ]
 .RB [ \-ccme " | " \-noccme ]
-.RB [ \-normalize " | " \-nonormalize ]
 .RB [ \-outsize
 .IR size-in-characters ]
-.RB [ \-bufsize
-.IR size-in-bytes ]
 .RB [ \-width
 .IR column-width ]
 .RB [ \-msgnum
@@ -40,7 +38,7 @@ language
 .RI [ msgs " | " strings ]
 .ad
 .SH DESCRIPTION
-.B Fmttest
+.B fmttest
 is used to test programs written for the
 .B nmh
 format language as specified by
@@ -51,42 +49,40 @@ It is also intended to replace the
 and
 .B fmtdump
 programs.
-.PP
-.SS FORMAT PROGRAM SELECTION
+.SS Format Program Selection
 The
 .B \-format
 .I string
 and
 .B \-form
 .I formatfile
-switches may be used to specify a format string or a format file to read.
-If given a format string, it must be specified as a single argument to
-the
+specify a format string or file to read.
+A format string, if given, must be a single argument to the
 .B \-format
-switch.  If given a format file name with
+switch.  If a format file name is passed to the
 .BR \-form ,
-the file is searched for using the normal
+switch, the file is searched for using the normal
 .B nmh
 rules: absolute pathnames are accessed directly, tilde expansion is
 done on usernames, and files are searched for in the user's
 .I Mail
 directory as specified in their profile.  If not found there, the directory
-.RI \*(lq %etcdir% \*(rq
+.RI \*(lq %nmhetcdir% \*(rq
 is checked.
-.SS MODE SELECTION AND COMPONENT SPECIFICATION
-.B Fmttest
-has four operating modes: address mode, raw mode, date mode, and message
-mode.  These modes are selected by the
+.SS Mode Selection and Component Specification
+.B fmttest
+has four operating modes - address, raw, date, and message -
+which are selected by the
 .BR \-address ,
 .BR \-raw ,
 .BR \-date ,
 and
 .B \-message
-switches respectively.
+switches, respectively.
 .PP
-Address mode treats every argument as an email address and processes it
-with nmh's email parser.  Each argument is processed with the specified
-format program with the parsed email address available as a special
+Address mode treats every argument as an email address to be processed
+by nmh's email parser using the specified format program.
+The parsed address is made available as a special
 .RI %{ text }
 component escape, and the output from the program is printed on standard output.
 If there was an error parsing the email address the error message is
@@ -101,9 +97,7 @@ following default program is used:
 .fi
 .RE
 .PP
-In this mode
-.B fmttest
-is equivalent to
+Address mode is equivalent to
 .IR ap (8).
 .PP
 In raw mode, no processing of the specified arguments is done.  Each argument
@@ -131,7 +125,7 @@ Date mode is equivalent to
 In message mode the arguments to
 .B fmttest
 are interpreted as an optional folder and messages.
-.B Fmttest
+.B fmttest
 will read each specified message and make all of the components in the
 message available to the format program.  Also, the appropriate information
 for the
@@ -140,7 +134,15 @@ for the
 .RI %( unseen ),
 and
 .RI %( size )
-function escapes will be made available for each message.
+function escapes will be made available for each message.  If the
+.B \-file
+switch is given, the arguments are interpreted as filenames instead of
+message numbers, but otherwise the behavior is the same (except that the
+.RI %( msg ),
+.RI %( cur ),
+and
+.RI %( unseen )
+function escapes will not provide any useful information).
 .PP
 The default format used in address mode is the default format used by
 .BR scan .
@@ -157,8 +159,7 @@ fmttest \-nodupaddrs \-form replcomps \-outsize max [+folder] message
 Regardless of the mode, other components can be provided to the format
 program by the use of the
 .B \-\|\-component
-switch.  For example, the following program will test out the use of
-the
+switch.  For example, the following program will test the use of the
 .RB \*(lq encrypted \*(rq
 component:
 .PP
@@ -168,9 +169,9 @@ fmttest \-\|\-encrypted yes \-message cur
 .fi
 .RE
 .PP
-In message mode components supplied on the command line will override
+In message mode, components supplied on the command line will override
 components from messages.
-.SS ADDITIONAL SWITCHES
+.SS Additional Switches
 The
 .B \-dupaddrs
 and
@@ -198,15 +199,6 @@ and only applies if
 is in effect.
 .PP
 The
-.B \-normalize
-and
-.B \-nonormalize
-switches control whether or not email addresses are normalized by the
-address parsing routines.  This is only functional when in address
-mode and is designed to replicate the switch of the same name to
-.IR ap (8).
-.PP
-The
 .B \-outsize
 switch controls the maximum number of printable characters that the format
 engine will produce.  Characters marked as non-printing by the format
@@ -216,25 +208,20 @@ characters with zero width, and extra bytes that are
 part of a multibyte character are not counted against this total.
 Two special values are supported:
 .RI \*(lq max \*(rq,
-which will set the value
-to the size of the output buffer, and
+which means as many characters as the format engine can produce
+(limited by internal buffers), and
 .RI \*(lq width \*(rq,
 which will set the
-value to the width of the terminal.  In message mode it defaults to the
-terminal width, otherwise the default is the output buffer size.
-.PP
-The
-.B \-bufsize
-switch controls the size of the output buffer.  By default it is set
-to the size of the
-.B BUFSIZ
-C preprocessor symbol, which is system-dependent.
+value to the width of the terminal.  In message mode it defaults to
+.RI \*(lq width \*(rq,
+otherwise the default is
+.RI \*(lq max \*(rq.
 .PP
 The
 .B \-width
 switch controls the column width which is used by the
 .RI `%( width )'
-function escape.  By default is set to the terminal width.
+function escape.  It defaults to the terminal width.
 .PP
 The
 .BR \-msgnum ,
@@ -249,9 +236,9 @@ function escapes:
 .RI `%( size )',
 and
 .RI `%( unseen )'.
-If none are supplied these values are taken from the message in message mode;
-in all other modes the default values are 0.
-.SS COMPILING AND TRACING FORMAT PROGRAMS
+If none are supplied, these values are taken from the message in
+message mode; in all other modes the default values are 0.
+.SS Compiling and Tracing Format Programs
 The
 .B \-dump
 switch outputs the complete set of format instructions for the specified
@@ -265,7 +252,7 @@ and
 registers if they have changed from the previous instruction.
 The output buffer is also printed if it has changed from the previous
 instruction.
-.SS FORMAT INSTRUCTIONS
+.SS Format Instructions
 It should be noted that there is not a one-to-one correspondence between
 format escapes and format instructions; many instructions have side
 effects.  Instructions prefixed with
@@ -306,7 +293,7 @@ LV_LIT      Load literal value into \fInum\fR register
 LV_DAT Load value from \fIdat\fR array into \fInum\fR register (see note)
 LV_STRLEN      Set \fInum\fR to the length of \fIstr\fR
 LV_PLUS_L      Add value to \fInum\fR register
-LV_MINUS_L     Substract value from \fInum\fR register
+LV_MINUS_L     Subtract value from \fInum\fR register
 LV_DIVIDE_L    Divide \fInum\fR register by value
 LV_MODULO_L    \fInum\fR modulo value
 LV_CHAR_LEFT   Store remaining number of printable chars in \fInum\fR
@@ -367,7 +354,7 @@ V_EQ        Set \fInum\fR to 1 if \fInum\fR equals value
 V_NE   Set \fInum\fR to 1 if \fInum\fR does not equal value
 V_GT   Set \fInum\fR to 1 if \fInum\fR is greater than value
 V_MATCH        Set \fInum\fR to 1 if \fIstr\fR contains string
-V_AMATCH Set \fInum\fR to 1 if \fIstr\fR starts with string
+V_AMATCH       Set \fInum\fR to 1 if \fIstr\fR starts with string
 .fi
 .PP
 The
@@ -391,9 +378,11 @@ dat[4]     %(\fIunseen\fR)
 .IR repl (1),
 .IR ap (8),
 .IR dp (8),
+.IR fmtdump (8)
 .SH DEFAULTS
 .nf
 .RB ` \-message '
+.RB ` \-nofile '
 .RB ` \-dupaddrs '
 .fi
 .SH BUGS