~savoy/mailcap

6a856bfa99ba6f3ba4690c78168b671db962860c — savoy 2 years ago 0e05469
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>
1 files changed, 2 insertions(+), 2 deletions(-)

M src/lib.rs
M src/lib.rs => src/lib.rs +2 -2
@@ 219,8 219,8 @@ impl Entry {
        &self.mime_type
    }

    pub fn viewer(&self) -> &String {
        &self.viewer
    pub fn viewer(&self, filename: &str) -> String {
        self.viewer.replace("%s", filename)
    }

    pub fn compose(&self) -> &Option<String> {