# man > fmttest(1mh)

---
type: CommandReference
command: fmttest
mode: man
section: 1mh
source: man-pages
---

## Quick Reference

- `fmttest -address user@example.com` — test address parsing
- `fmttest -date "Mon, 01 Jan 2024 12:00:00 -0500"` — test date parsing
- `fmttest -raw -format "%{text}" hello` — raw mode with custom format
- `fmttest -message +inbox 42` — test message with default format
- `fmttest -form replcomps -nodupaddrs -outsize max +folder 1` — replicate `repl` behavior
- `fmttest -dump -format "..."` — dump compiled format instructions
- `fmttest -trace -format "..."` — trace format execution
- `fmttest --component encrypted yes -message cur` — override message component

## Name

Test programs in nmh's `mh-format` language.

## Synopsis

shell
fmttest [-help] [-version] [-form formatfile] [-format formatstring] [-address | -raw | -date | -message] [-file | -nofile] [--component component-text] [-dupaddrs | -nodupaddrs] [-ccme | -noccme] [-outsize size-in-characters] [-width column-width] [-msgnum number] [-msgcur flag] [-msgsize size] [-unseen flag] [-dump | -nodump] [-trace | -notrace] [+folder] [msgs | strings]
## Options

### Mode Selection
- `-address` — treat arguments as email addresses; parse with nmh's email parser.
- `-raw` — no processing; each argument is available as `%{text}`.
- `-date` — like raw, but default format parses and pretty-prints dates.
- `-message` — read messages; all components are available to format program.

### Format Program
- `-format string` — specify format string directly (single argument).
- `-form formatfile` — read format from file (searched via nmh rules: absolute, tilde, user's Mail dir, then `/etc/nmh`).

### Component Override
- `--component component-text` — provide an extra component (e.g., `--encrypted yes`). Overrides message components in message mode.

### Address Handling
- `-dupaddrs` / `-nodupaddrs` — allow or suppress duplicate addresses in `FORMATADDR` (like `repl`).
- `-ccme` / `-noccme` — include or exclude local mailbox as duplicate (only when `-nodupaddrs` is active).

### Output Control
- `-outsize size` — max printable characters; `max` for unlimited, `width` for terminal width. Default: `width` in message mode, `max` otherwise.
- `-width columns` — column width for `%(_width_)` escape. Default: terminal width.

### Message Simulation
- `-msgnum number` — value for `%(_num_)` escape.
- `-msgcur flag` — value for `%(_cur_)` escape.
- `-msgsize size` — value for `%(_size_)` escape.
- `-unseen flag` — value for `%(_unseen_)` escape.

### Debugging
- `-dump` — output the complete set of format instructions.
- `-trace` — output each format instruction as it executes, showing register and buffer changes.

### Other
- `-file` / `-nofile` — in message mode, treat arguments as filenames instead of message numbers.
- `-help` — show help.
- `-version` — show version.

## Examples

**Address mode (default format)**:
shell
fmttest -address "John Doe <john@example.com>"
Output: parsed address using `%<{error}%{error}: %{text}%|%(putstr(proper{text}))%>`.

**Date mode**:
shell
fmttest -date "Mon, 01 Jan 2024 12:00:00 -0500"
Uses default format: `%<(nodate{text})error: %{text}%|%(putstr(pretty{text}))%>`.

**Raw mode with custom format**:
shell
fmttest -raw -format "%(putstr{text})" "hello world"
**Message mode with component override**:
shell
fmttest --encrypted yes -message cur
**Replicate `repl` command**:
shell
fmttest -nodupaddrs -form replcomps -outsize max +folder 42
**Dump format instructions**:
shell
fmttest -dump -format "%<(mymbox{from})To: %(proper{from})%>" 
**Trace execution**:
shell
fmttest -trace -format "%<(mymbox{from})To: %(proper{from})%>" -address user@host
## See Also

- [_mh-format_(5)](http://localhost/phpMan.php/man/mh-format/5/markdown)
- [_repl_(1)](http://localhost/phpMan.php/man/repl/1/markdown)
- [_ap_(8)](http://localhost/phpMan.php/man/ap/8/markdown)
- [_dp_(8)](http://localhost/phpMan.php/man/dp/8/markdown)
- [_fmtdump_(8)](http://localhost/phpMan.php/man/fmtdump/8/markdown)