From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 344995135488 X-Google-Groups: supmua X-Google-Thread: 3030fda1bf,1711719559b2ece4,start X-Google-Attributes: gid3030fda1bf,domainid0,public,googlegroup X-Google-NewGroupId: yes X-Received: by 10.181.13.80 with SMTP id ew16mr190959wid.4.1415471870058; Sat, 08 Nov 2014 10:37:50 -0800 (PST) X-BeenThere: supmua@googlegroups.com Received: by 10.180.101.98 with SMTP id ff2ls1586392wib.41.canary; Sat, 08 Nov 2014 10:37:49 -0800 (PST) X-Received: by 10.181.29.201 with SMTP id jy9mr1990619wid.1.1415471869667; Sat, 08 Nov 2014 10:37:49 -0800 (PST) Return-Path: Received: from mout.web.de (mout.web.de. [212.227.15.3]) by gmr-mx.google.com with ESMTPS id l4si312390wif.2.2014.11.08.10.37.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Nov 2014 10:37:49 -0800 (PST) Received-SPF: pass (google.com: domain of ruthard.baudach@web.de designates 212.227.15.3 as permitted sender) client-ip=212.227.15.3; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ruthard.baudach@web.de designates 212.227.15.3 as permitted sender) smtp.mail=ruthard.baudach@web.de Received: from localhost ([92.75.122.25]) by smtp.web.de (mrweb002) with ESMTPSA (Nemesis) id 0LwZ5z-1Y5f2B3tc7-018O3T for ; Sat, 08 Nov 2014 19:37:49 +0100 From: Ruthard Baudach To: supmua Subject: [PATCH] added command line argument to sup invocation: "sup email-address" invokes sup in command line Date: Sat, 08 Nov 2014 19:37:41 +0100 Message-Id: <1415471780-sup-1914@ruthard-lappi> User-Agent: Sup/git Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; boundary="=-1415471867-732703-3513-8010-1-=" X-Provags-ID: V03:K0:QfmUkACKM83HaBPi6nB75Bf2ju+ZiScFay83K7rmfpIHDw55Ik3 24lQN22649hWRtoAt0bG9UpVxZtzCyNOjwFzKtMAC/AItt8npvhyOW2mQUWwwN8NZfrhU13 vTNT2kWhqPXaq/stPkBeZtGo2bTN0oS0rUP6tPivWUusTs7aHngHPxwp37AIFtetpoxp7ob RkZ0JSzAelbRYx37kBEbA== X-UI-Out-Filterresults: notjunk:1; --=-1415471867-732703-3513-8010-1-= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable --- History.txt | 5 +++++ bin/sup | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/History.txt b/History.txt index 27ff788..a59ee50 100644 --- a/History.txt +++ b/History.txt @@ -1,5 +1,10 @@ =3D=3D = +* add email command line argument to sup. sup mail.address@isp.tld + is now equal to sup --compose mail.address@isp.tld + +=3D=3D + * You can now unsubscribe from mailinglists using an url, if you have a goto-hook setup (Timon Vonk). = diff --git a/bin/sup b/bin/sup index 6757312..fba3ea6 100755 --- a/bin/sup +++ b/bin/sup @@ -34,7 +34,11 @@ $opts =3D Trollop::options do Sup is a curses-based email client. = Usage: - sup [options] + sup [options] [to-address] + +Arguments: + to-address: Compose message to this recipient upon startup= + --compose overrides an address passed as argum= ent = Options are: EOS @@ -46,8 +50,17 @@ EOS opt :subject, "When composing, use this subject", :type =3D> String, := short =3D> "j" end = +## Trollop does no command argument parsing, only option parsing. +# After Trollop parsing, ARGV contains only the +rest+ of the command li= ne, +# thus the arguments to our program +## compose message if we have an email address as first command line arg= ument +# I do not use RMail to check the validity of the address, as RMail ten= ds to throw +# exceptions I'm too lazy to handle. Ruthard Baudach +$opts[:compose] =3D ARGV[0] if ARGV[0] =3D~ /.+@.+\..{2,}/ and not $opts= [:compose] + = Trollop::die :subject, "requires --compose" if $opts[:subject] && !$opts= [:compose] = + Redwood::HookManager.register "startup", <