From 307cb0a40b2b6a30af7b42bf850be735de9378c3 Mon Sep 17 00:00:00 2001 From: Matthieu Rakotojaona Date: Mon, 27 Feb 2023 15:27:03 +0100 Subject: [PATCH 1/2] mcom: Allow tilde in attachment --- mcom | 1 + 1 file changed, 1 insertion(+) diff --git a/mcom b/mcom index 397cb5f..7258266 100755 --- a/mcom +++ b/mcom @@ -84,6 +84,7 @@ do_mime() { IFS=$NL msed '/attach/d' "$draft" for f in $(mhdr -M -h attach "$draft"); do + f=$(echo $f | sed "s:^~/:$HOME/:") printf '#%s %s\n' \ "$(file -Lb --mime "$f" | sed 's/ //g')" \ "$f" From 0d5395e934a0e86ba99481f5b18e3e0f28e703ce Mon Sep 17 00:00:00 2001 From: Matthieu Rakotojaona Date: Mon, 27 Feb 2023 15:33:13 +0100 Subject: [PATCH 2/2] mcom: Document how attachments work --- man/mcom.1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/man/mcom.1 b/man/mcom.1 index 957c322..08592c7 100644 --- a/man/mcom.1 +++ b/man/mcom.1 @@ -130,6 +130,13 @@ Delete the draft and quit. Preview the draft, using .Xr mshow 1 . .El +.Sh ATTACHMENTS +From within the editor, attachments are added by setting an Attach: header with the path to the desired files. Multiple Attach: headers can be added. + +To add from the commandline, use +.Sq mcom Fl attach No path/to/file +and the header will be added automatically. +It is possible to use tilde (~) in the file path. .Sh ENVIRONMENT .Bl -tag -width Ds .It Ev EDITOR , Ev VISUAL