From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 344995135488 X-Google-Groups: supmua X-Google-Thread: 3030fda1bf,1711719559b2ece4 X-Google-Attributes: gid3030fda1bf,domainid0,public,googlegroup X-Google-NewGroupId: yes X-Received: by 10.112.48.98 with SMTP id k2mr242535lbn.15.1415959989966; Fri, 14 Nov 2014 02:13:09 -0800 (PST) X-BeenThere: supmua@googlegroups.com Received: by 10.152.27.168 with SMTP id u8ls834667lag.103.gmail; Fri, 14 Nov 2014 02:13:09 -0800 (PST) X-Received: by 10.112.163.229 with SMTP id yl5mr18595lbb.23.1415959989186; Fri, 14 Nov 2014 02:13:09 -0800 (PST) Return-Path: Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com. [209.85.217.177]) by gmr-mx.google.com with ESMTPS id sg7si1179924lbb.1.2014.11.14.02.13.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Nov 2014 02:13:08 -0800 (PST) Received-SPF: none (google.com: eg@gaute.vetsj.com does not designate permitted sender hosts) client-ip=209.85.217.177; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: eg@gaute.vetsj.com does not designate permitted sender hosts) smtp.mail=eg@gaute.vetsj.com Received: by mail-lb0-f177.google.com with SMTP id z12so5804908lbi.36 for ; Fri, 14 Nov 2014 02:13:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:subject:to:references:in-reply-to :user-agent:message-id:mime-version:content-type :content-transfer-encoding; bh=1xtNq6SjloJAG+uU9LpPSPyQkMuV6WFpwcHodLdnHnI=; b=EddSUJJK9StKw3xWqyZIdT+lIpZD5fxPHzXPJZLZNcGmSoRVdAYUSXvGWwZ9+U7h9e 4HJVgXTLVin/JteZM/1HH4LfWRee4j0rOkSxDy5fRl6s75Iz0UiN4+ZvJsFfeEFmHNU1 XQi5TQqkH32uA0lmlZiUDdWwgbiAcO99W0DWWyKh9uhNMQJ4I0ce4xo7FAmjpSl/pVhs WizKYV/KJmTG+eB4dCn1maRIP2ZVOYH592pe8PzIoxRLoAT/HIZfjNzNPjIgSR9l2aDU MAOSFra/vXeN0xPmnJrszZwcQxJMpfEAYXZsHEIqr+Jlg3MBE1JfvKYC9jlfnE/zIIgR FB+A== X-Gm-Message-State: ALoCoQmaVfMWfhHRATMO8fT9rsMwtFyGLvsYA55a2tQQrgkTgPolxobDL89eWnaV6cNy6Wy0+Hlm X-Received: by 10.152.116.102 with SMTP id jv6mr7448007lab.40.1415959988848; Fri, 14 Nov 2014 02:13:08 -0800 (PST) Return-Path: Received: from localhost (c2774BF51.dhcp.as2116.net. [81.191.116.39]) by mx.google.com with ESMTPSA id z1sm8076261lad.40.2014.11.14.02.13.06 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Nov 2014 02:13:07 -0800 (PST) Date: Fri, 14 Nov 2014 10:13:10 +0000 From: Gaute Hope Subject: Re: [sup] [PATCH] added command line argument to sup invocation: "sup email-address" invokes sup in command line To: supmua , Ruthard Baudach References: <1415471780-sup-1914@ruthard-lappi> In-Reply-To: <1415471780-sup-1914@ruthard-lappi> User-Agent: astroid/v18cf4a3b (https://github.com/gauteh/astroid) Message-Id: <1415959463-astroid-0-4xu4dq0h0g-7223@strange> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable got a few comments below [btw: it is better to send a completely new patch with your changes squashed together than to send incremental changes to the first patch]. - gaute Excerpts from Ruthard Baudach's message of November 8, 2014 19:37: > --- > History.txt | 5 +++++ > bin/sup | 15 ++++++++++++++- > 2 files changed, 19 insertions(+), 1 deletion(-) >=20 > diff --git a/History.txt b/History.txt > index 27ff788..a59ee50 100644 > --- a/History.txt > +++ b/History.txt > @@ -1,5 +1,10 @@ > =3D=3D > =20 > +* add email command line argument to sup. sup mail.address@isp.tld > + is now equal to sup --compose mail.address@isp.tld > + > +=3D=3D ^^ drop '=3D=3D' here, move the history line below previous news, the '=3D= =3D' is there because I don't know the date/version number of the next release yet, so it is a placeholder for the next header. > + > * You can now unsubscribe from mailinglists using an url, if you have > a goto-hook setup (Timon Vonk). > =20 > 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. > =20 > 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 ^^ i think it would be better to fail if --compose is specified in addition= to an unnamed argument, what happens if i want to specify many addresses? what do you think? > =20 > Options are: > EOS > @@ -46,8 +50,17 @@ EOS > opt :subject, "When composing, use this subject", :type =3D> String, := short =3D> "j" > end > =20 > +## 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 add '.', why different levels of '#' ? try to stay at approx 80 char width. > +# 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 ^^ drop these lines - i guess we dont need super-strict validation since this is user input and not stuff received from somebody else. > +$opts[:compose] =3D ARGV[0] if ARGV[0] =3D~ /.+@.+\..{2,}/ and not $opts= [:compose] > + =20 > Trollop::die :subject, "requires --compose" if $opts[:subject] && !$opts= [:compose] > =20 > + ^^ drop extra newline > Redwood::HookManager.register "startup", < Executes at startup > No variables. > --=20 > 2.1.3 >=20 =