Skip to content
This repository was archived by the owner on May 3, 2021. It is now read-only.

Commit e423f71

Browse files
committed
Updated to match reality
1 parent 84a034b commit e423f71

File tree

1 file changed

+31
-19
lines changed

1 file changed

+31
-19
lines changed

README.md

+31-19
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,13 @@ $ maildir-tools maildirs --format '#{name}' | grep debian-packages
9595

9696
The following format-strings are available:
9797

98-
| Flag | Meaning |
99-
| -------- | ------------------------------------------- |
100-
| name | The name of the folder. |
101-
|shortname | The name of the folder, without the prefix. |
102-
| total | The total count of messages in the folder. |
103-
| unread | The count of unread messages in the folder. |
98+
| Flag | Meaning |
99+
| ---------------- | -------------------------------------------------------- |
100+
| name | The name of the folder. |
101+
| shortname | The name of the folder, without the prefix. |
102+
| total | The total count of messages in the folder. |
103+
| unread | The count of unread messages in the folder. |
104+
| unread_highlight | Returns either "[red]" or "" depending on maildir state. |
104105

105106

106107
Flags can be prefixed with a number to denote their width:
@@ -129,13 +130,15 @@ $ maildir-tools messages --format '[#{4flags}] #{from} #{subject}' debian-packag
129130

130131
The following format-strings are available:
131132

132-
| Flag | Meaning |
133-
| -------- | ------------------------------------------ |
134-
| flags | The flags of the message. |
135-
| file | The filename of the message |
136-
| index | The index of the message in the folder. |
137-
| total | The total count of messages in the folder. |
138-
| "header" | The content of the named header. |
133+
| Flag | Meaning |
134+
| ---------------- | -------------------------------------------------------- |
135+
| flags | The flags of the message. |
136+
| file | The filename of the message. |
137+
| index | The index of the message in the folder. |
138+
| total | The total count of messages in the folder. |
139+
| "header" | The content of the named header. |
140+
| unread_highlight | Returns either "[red]" or "" depending on message state. |
141+
139142

140143
Headers are read flexibly, so if you used `#{subject}` the subject-header
141144
would be returned. Similar things work for all other headers.
@@ -146,22 +149,31 @@ Flags can be prefixed with a number to denote their width:
146149
* `#{06index}` means left-pad the `index` field with `0` until it is 6 characters wide.
147150
* `#{20subject}` means truncate the subject at 20 characters if it is longer.
148151

149-
In addition to the padding/truncation there is one more special case which is the support of displaying email addresses. For example if you had a message from: `"Steve Kemp" <steve@steve.fi>` then the contents of `#{from}` would be that string.
152+
In addition to the padding/truncation there is one more special case which is related to formatting email address. For example if you received a message from me and you tried to display the output of the `From:` header using `#{from}` you'd see the following:
153+
154+
* `Steve Kemp <steve@example.fi>`
150155

151-
You might prefer to use:
156+
You might prefer to see only the name, or the email-address, so you could add a suffix to your format-string:
152157

153-
* "`#{from.name}`" to receive the output "Steve Kemp".
154-
* "`#{from.email}`" to receive the output "<steve@steve.fi>".
158+
* "`#{from.name}`" would show "Steve Kemp".
159+
* "`#{from.email}`" would show "<steve@example.fi>".
155160

161+
This works for any of the headers which might contain email-addresses, such as `To:`, `From:`, `Bcc:`, `Cc:`, etc.
156162

157163

158164
## Scripting Usage: Message Display
159165

160-
In the UI there is support for displaying a single message, via the use of:
166+
There is support for displaying a single message, via the use of:
161167

162168
`$ maildir-tools message path/to/maildir/cur/foo:2,S`
163169

164-
The output of this is currently hardwired, but in the future we might allow it to be changed via a template-file.
170+
This subcommand uses an embedded template to control how the message is formatted. If you wish to format the message differently you can specify the path to a template-file to use:
171+
172+
`$ maildir-tools message -template /path/to/template.txt ...`
173+
174+
To help you write a new template you can view the contents of the default one via:
175+
176+
`$ maildir-tools message -dump-template`
165177

166178

167179

0 commit comments

Comments
 (0)