| 1 | ##---------------------------------------------------------------------------## |
| 2 | ## File: |
| 3 | ## $Id: mhusage.pl,v 2.19 2002/06/07 17:45:09 ehood Exp $ |
| 4 | ## Author: |
| 5 | ## Earl Hood mhonarc@mhonarc.org |
| 6 | ## Description: |
| 7 | ## Usage output. Just require the file to have usage info |
| 8 | ## printed to STDOUT. |
| 9 | ##---------------------------------------------------------------------------## |
| 10 | ## MHonArc -- Internet mail-to-HTML converter |
| 11 | ## Copyright (C) 1995-1999 Earl Hood, mhonarc@mhonarc.org |
| 12 | ## |
| 13 | ## This program is free software; you can redistribute it and/or modify |
| 14 | ## it under the terms of the GNU General Public License as published by |
| 15 | ## the Free Software Foundation; either version 2 of the License, or |
| 16 | ## (at your option) any later version. |
| 17 | ## |
| 18 | ## This program is distributed in the hope that it will be useful, |
| 19 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 21 | ## GNU General Public License for more details. |
| 22 | ## |
| 23 | ## You should have received a copy of the GNU General Public License |
| 24 | ## along with this program; if not, write to the Free Software |
| 25 | ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
| 26 | ## 02111-1307, USA |
| 27 | ##---------------------------------------------------------------------------## |
| 28 | |
| 29 | package mhonarc; |
| 30 | |
| 31 | sub mhusage { |
| 32 | my($usefh, $close); |
| 33 | local(*PAGER); |
| 34 | PAGERCHECK: { |
| 35 | if ($UNIX && |
| 36 | (($ENV{'PAGER'} && open(PAGER, "| $ENV{'PAGER'}")) || |
| 37 | (open(PAGER, "| more")))) { |
| 38 | $usefh = \*PAGER; |
| 39 | $close = 1; |
| 40 | last PAGERCHECK; |
| 41 | } |
| 42 | $usefh = \*STDOUT; |
| 43 | $close = 0; |
| 44 | } |
| 45 | my($curfh) = select($usefh); |
| 46 | |
| 47 | print <<EndOfUsage; |
| 48 | Usage: $PROG [<options>] <mailfolder> ... |
| 49 | $PROG -rmm [<options>] <msg> ... |
| 50 | $PROG -annotate [-notetext <text>] <msg> ... |
| 51 | |
| 52 | Description: |
| 53 | MHonArc is a highly customizable Perl program for converting mail, |
| 54 | encoded with MIME, into HTML archives. MHonArc supports the conversion |
| 55 | of UUCP-style mailbox files and MH style mail folders. The -single |
| 56 | option can be used to convert a single mail message to standard output. |
| 57 | |
| 58 | Read the full documentation included with the distribution, or at |
| 59 | <http://www.mhonarc.org/>, for more complete usage information. |
| 60 | |
| 61 | Options: |
| 62 | -add : Add message(s) to archive |
| 63 | -afs : Skip archive directory permission check |
| 64 | -addressmodifycode <exp> : Perl expressions for modifying addresses |
| 65 | -annotate : Add an annotation to message(s) |
| 66 | -archive : Generate archive related files (the default) |
| 67 | -authsort : Sort messages by author |
| 68 | -checknoarchive : Check for "no archive" flags in messages |
| 69 | -conlen : Honor Content-Length fields |
| 70 | -datefields <list> : Fields to determine the date of a message |
| 71 | -decodeheads : Decode decode-only charset data when reading mail |
| 72 | -definevar <varlist> : Define custom resource variables |
| 73 | -dbfile <name> : Name of MHonArc database file |
| 74 | (def: ".mhonarc.db") |
| 75 | -doc : Print link to doc at end of index page |
| 76 | -docurl <url> : URL to MHonArc documentation |
| 77 | (def: "http://www.mhonarc.org/") |
| 78 | -editidx : Edit/change index page(s) and messages, only |
| 79 | -expiredate <date> : Message cut-off date |
| 80 | -expireage <secs> : Time from current when messages expire |
| 81 | -folrefs : Print links to follow-ups/references |
| 82 | -force : Perform archive operations even if unable to lock |
| 83 | -fromfields <list> : Fields to detemine whom the message is from |
| 84 | -genidx : Output index to stdout based upon archive contents |
| 85 | -gmtdatefmt <fmt> : Format for GMT date |
| 86 | -gzipexe <file> : Pathname of Gzip executable |
| 87 | (def: "gzip") |
| 88 | -gzipfiles : Gzip files |
| 89 | -gziplinks : Add ".gz" to filenames in links |
| 90 | -help : This message |
| 91 | -htmlext <ext> : Filename extension for generated HTML files |
| 92 | (def: "html") |
| 93 | -idxfname <name> : Name of index page |
| 94 | (def: "maillist.html") |
| 95 | -idxprefix <string> : Filename prefix for multi-page main index |
| 96 | (def: "mail") |
| 97 | -idxsize <#> : Maximum number of messages shown in indexes |
| 98 | -keeponrmm : Do not delete message files when message is |
| 99 | removed from archive. |
| 100 | -localdatefmt <fmt> : Format for local date |
| 101 | -lock : Do archive locking (default) |
| 102 | -lockdelay <#> : Time delay, in seconds, between lock tries |
| 103 | (def: "3") |
| 104 | -locktries <#> : Maximum number of tries in locking an archive |
| 105 | (def: "10") |
| 106 | -mailtourl <url> : URL to use for e-mail address hyperlinks |
| 107 | (def: "mailto:\$TO\$") |
| 108 | -main : Create a main index |
| 109 | -maxsize <#> : Maximum number of messages allowed in archive |
| 110 | -mhpattern <exp> : Perl expression for message files in a directory |
| 111 | (def: "^\\d+\$") |
| 112 | -modtime : Set modification time on files to message date |
| 113 | -months <list> : Month names |
| 114 | -monthsabr <list> : Abbreviated month names |
| 115 | -msgpgs : Create message pages (the default) |
| 116 | -msgprefix <prefix> : Filename prefix for message HTML files |
| 117 | (def: "msg") |
| 118 | -msgexcfilter <exp> : Perl expression(s) for selective message exclusion |
| 119 | -msgsep <exp> : Message separator (Perl) regex for mbox files |
| 120 | (def: "^From ") |
| 121 | -multipg : Generate multi-page indexes |
| 122 | -news : Add links to newsgroups (the default) |
| 123 | -noarchive : Do not generate archive related files |
| 124 | -noauthsort : Do not sort messages by author |
| 125 | -nochecknoarchive : Ignore "no archive" flags in messages |
| 126 | -noconlen : Ignore Content-Length fields (the default) |
| 127 | -nodecodeheads : Leave message headers "as is" when read |
| 128 | -nodoc : Do not print link to doc at end of index page |
| 129 | -nofolrefs : Do not print links to follow-ups/references |
| 130 | -nogzipfiles : Do not Gzip files (the default) |
| 131 | -nogziplinks : Do not add ".gz" to filenames in links |
| 132 | -nokeeponrmm : Delete message files when message is removed |
| 133 | from archive. |
| 134 | -nolock : Do not lock archive |
| 135 | -nomailto : Do not add in mailto links for e-mail addresses |
| 136 | -nomain : Do not create a main index |
| 137 | -nomodtime : Do not set mod time on files to message date |
| 138 | -nomsgpgs : Do not create message pages |
| 139 | -nomultipg : Do not generate multi-page indexes |
| 140 | -nonews : Do not add links to newsgroups |
| 141 | -noposixstrftime : Do not use POSIX::strftime() to process time |
| 142 | format (the default) |
| 143 | -noreverse : List messages in normal order (the default) |
| 144 | -nosaveresources : Do not save resource values in DB |
| 145 | -nosort : Do not sort messages |
| 146 | -nospammode : Do not obfuscate addresses |
| 147 | -nosubjectthreads : Do not check subjects for threads |
| 148 | -nosubjecttxt <text> : Text to use if message has no subject |
| 149 | -nosubsort : Do not sort messages by subject |
| 150 | -notetext <text> : Text data of annotation if -annotation specified |
| 151 | -nothread : Do not create threaded index |
| 152 | -notreverse : List threads in order (the default) |
| 153 | -notsort : List threads by ordered processed |
| 154 | -notsubsort : Do not list threads by subject |
| 155 | -nourl : Do not make URL hyperlinks |
| 156 | -otherindex <files> : Other rcfile for extra index |
| 157 | -outdir <path> : Destination/location of HTML mail archive |
| 158 | (def: ".") |
| 159 | -pagenum <page> : Output specified page if -genidx and -multipg |
| 160 | -perlinc <list> : List of paths to search for MIME filters |
| 161 | -posixstrftime : Use POSIX::strftime() to process time formats |
| 162 | -quiet : Suppress status messages during execution |
| 163 | -rcfile <file> : Resource file for MHonArc |
| 164 | -reverse : List messages in reverse order |
| 165 | -rmm : Remove messages from archive |
| 166 | -savemem : Write message data while processing |
| 167 | -saveresources : Save resource values in DB (the default) |
| 168 | -scan : List out archive contents to stdout |
| 169 | -single : Convert a single message to HTML (no archive ops) |
| 170 | -sort : Sort messages by date (the default) |
| 171 | -spammode : Obfuscate addresses |
| 172 | -stderr <file> : File to send stderr messages to |
| 173 | -stdin <file> : File to treat as standard input |
| 174 | -stdout <file> : File to send stdout messages to |
| 175 | -subjectarticlerxp <rxp> : Regex for leading articles in subjects |
| 176 | -subjectreplyrxp <rxp> : Regex for leading reply string in subjects |
| 177 | -subjectstripcode <exp> : Perl expressions for modifying subjects |
| 178 | -subjectthreads : Check subjects for threads |
| 179 | -subsort : Sort message by subject |
| 180 | -thread : Create threaded index (the default) |
| 181 | -tidxfname <name> : Filename of threaded index page |
| 182 | (def: "threads.html") |
| 183 | -tidxprefix <string> : Filename prefix for multi-page thread index |
| 184 | (def: "thrd") |
| 185 | -time : Print to stderr CPU time used to process mail |
| 186 | -title <string> : Title of main index page |
| 187 | (def: "Mail Index") |
| 188 | -tlevels <#> : Maximum # of nested lists in threaded index |
| 189 | (def: "3") |
| 190 | -treverse : List threads in reverse order |
| 191 | -tslice <#:#:#> : Set size of thread slice listing |
| 192 | -tslicelevels <#> : Maximum # of nested lists in thread slices |
| 193 | (def: TLEVELS resource value) |
| 194 | -tsort : List threads by date (the default) |
| 195 | -tsubsort : List threads by subject |
| 196 | -ttitle <string> : Title of thread index page |
| 197 | (def: "Mail Thread Index") |
| 198 | -umask <umask> : Umask of MHonArc process (Unix only) |
| 199 | -url : Make URL hyperlinks (the default) |
| 200 | -v : Print version information |
| 201 | -varregex <regex> : Perl regex matching resource variables |
| 202 | -weekdays <list> : Weekday names |
| 203 | -weekdaysabr <list> : Abbreviated weekday names |
| 204 | |
| 205 | The following options can be specified multiple times: -definevar, |
| 206 | -notetext, -otherindex, -perlinc, -rcfile. |
| 207 | |
| 208 | Version: |
| 209 | $VINFO |
| 210 | EndOfUsage |
| 211 | |
| 212 | close($usefh) if $close; |
| 213 | select($curfh); |
| 214 | } |
| 215 | |
| 216 | ##---------------------------------------------------------------------------## |
| 217 | 1; |