summary refs log tree commit diff
path: root/mcomp
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-07-28 13:08:04 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-07-28 13:08:04 +0200
commitad6cec9e16bf41de2798a0d48ae4d08d019235c9 (patch)
tree63de022cd6f208789728a9918fe23d5019bf5acc /mcomp
parent5e1d751f292fbe7dc0d2bdc2b03c6349c5c742f9 (diff)
downloadmblaze-ad6cec9e16bf41de2798a0d48ae4d08d019235c9.tar.gz
mblaze-ad6cec9e16bf41de2798a0d48ae4d08d019235c9.tar.xz
mblaze-ad6cec9e16bf41de2798a0d48ae4d08d019235c9.zip
mhdr: almost-rewrite, use getopt
Diffstat (limited to 'mcomp')
-rwxr-xr-xmcomp22
1 files changed, 11 insertions, 11 deletions
diff --git a/mcomp b/mcomp
index c8d41ac..66980f4 100755
--- a/mcomp
+++ b/mcomp
@@ -19,7 +19,7 @@ draft="snd.$i"
 		echo "Cc: "
 		echo "Bcc: "
 		echo "Subject: "
-		from=$(mhdr -local-mailbox ~/.santoku/profile)
+		from=$(mhdr -h local-mailbox ~/.santoku/profile)
 		[ "$from" ] && echo "From: $from"
 		cat ~/.santoku/headers 2>/dev/null
 		echo
@@ -28,30 +28,30 @@ draft="snd.$i"
 	*mrepl*)
 		[ "$#" -eq 0 ] && set -- .
 		# XXX reply-all
-		echo "To: $(mhdr -from "$1")"
+		echo "To: $(mhdr -h from "$1")"
 		echo "Cc: "
 		echo "Bcc: "
-		s=$(mhdr -subject "$1")
+		s=$(mhdr -d -h subject "$1")
 		os=
 		while [ "$os" != "$s" ]; do
 			os=$s
-			s=${s% }
-			s=${s%[Rr][Ee]:}
-			s=${s%[Aa][Ww]:}
-			s=${s%[Ff][Ww][Dd]:}
+			s=${s# }
+			s=${s#[Rr][Ee]:}
+			s=${s#[Aa][Ww]:}
+			s=${s#[Ff][Ww][Dd]:}
 		done
 		echo "Subject: Re: $s"
 		cat ~/.santoku/headers 2>/dev/null
 		echo -n "References:"
 		{
-			mhdr -references "$1"
-			mhdr -message-id "$1"
+			mhdr -h references "$1"
+			mhdr -h message-id "$1"
 		} | sed 's/^[^<]*//g;s/[^>]*$//g;s/>[^<]*</>\n</g' |
 			uniq | sed 's/^/ /'
-		echo "In-Reply-To: $(mhdr -message-id "$1")"
+		echo "In-Reply-To: $(mhdr -h message-id "$1")"
 		echo
 
-		echo "$(mhdr -from "$1") wrote:"
+		echo "$(mhdr -d -h from "$1") wrote:"
 		mshow -R "$1" |
 			sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' |
 			sed 's/^/> /'