removal of superfluous 'license-file' in Cargo.toml'
Signed-off-by: savoy <git@liberation.red>
preparation for publishing and v0.1.0
The only code diff is the removal of the `note` Entry field, which is
not a field included in RFC 1524.
Signed-off-by: savoy <git@liberation.red>
feature: viewer method returns cmd replaced w/file
The getter method for an Entry's view-command has been upgraded to take
a filename parameter, which replaces the mailcap command's '%s'
placeholder with the file to-be-opened.
Signed-off-by: savoy <git@liberation.red>
field change from Entry.command -> viewer
To match the nomenclature of RFC 1524.
Signed-off-by: savoy <git@liberation.red>
implements the mailcap entry `test` command
Must be called through an unsafe libc system call. As mailcaps are a
UNIX thing, no need to think of Windows/Mac compatibility.
All previous "command" fields have been converted to Option<String>
instead of Option<Vec<String>> as in order to leverage the flexibility
of mailcap vs XDG, being able to run complex shell commands is required.
Signed-off-by: savoy <git@liberation.red>
reversion for Mailcap.data
The value of the mailcap data has reverted back to a single entry per
mime type instead of a vector.
To be implemented is a check for the test command of a mailcap entry.
Entry now returns an Option: entries that fail their test will return
None and (eventually) be logged. When Mailcap::new creates the HashMap
of data, only the passed tests will be included.
If multiple entries exist for a mime type, the previous behavior of the
most recent is included.
Signed-off-by: savoy <git@liberation.red>
refactored helper functions as associated for structs
Signed-off-by: savoy <git@liberation.red>
Mailcap::new returns vector of Entry
As multiple mailcap entries can exist for one mime type, the return type
of Mailcap has changed from HashMap<String, Entry> to HashMap<String,
Vec<Entry>>.
Signed-off-by: savoy <git@liberation.red>
duplicate mailcap entries are accounted for
The check for default locations has now reversed the path entries,
ordered from least to highest priority. In this case if the user as a
~/.mailcap file, mime types listed here will take precedence over those
in other / locations.
Signed-off-by: savoy <git@liberation.red>
pull an Entry from Mailcap based on mime_type key
Signed-off-by: savoy <git@liberation.red>