Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: err_return inside function who's return value is checked
- X-seq: zsh-users 17510
- From: Russell Harmon <russ@xxxxxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: err_return inside function who's return value is checked
- Date: Sun, 30 Dec 2012 15:55:20 -0500
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=gbKrkbI4wJfRkfhB+5jef7g7/WDr94cf0ZyTWVteGxc=; b=QgJDmvvDGDrFsY8DdNuxJbkHqPv7iQNPLWN1a3Y89AebN95kWL0uzGLvUuVK4/GgUP 3ewCdsr3QyDvslWfzrOmBmMNd3ObQtecGyjyvyBsGFEgXIn0xmREiI5R+EfZj+bC84N9 2rUfcORJfZk66KmEyLCobwhJMvDuE0ssXJjBME7pO+ISqGAetCIrrFfgdUXBSsIRF+lN CDBEGPpCC2hLU4+Ooi7Jckk/kp4SY743grDjULF0EC56cuwUbY25bl3U8Dp3f3d9hKBe CLq7IRk+91lh3ORV/8h6RV4eYQiqi4uH/rBbwctKB/w5eZe3ALrn3IKiMNIxPnTnRoGI keXg==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eatnumber1.com; s=google; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=gbKrkbI4wJfRkfhB+5jef7g7/WDr94cf0ZyTWVteGxc=; b=UZsyBmQHt6YPY0u65fcqjhOijdol6g47VPZee/z5zzBfEjOdoOFivoYvFQTlbK1nkY PRQu/l1natw7Mce6dd5+KmEP8zHUcpUPtv7NghOMzV0Q5VINmEFlbyPcli/MQ+I/iNIA NogwEVqdqqOYstEzFE6INCLzz7ocw0Qo0A180=
- In-reply-to: <121230113526.ZM967@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CA+zrezS6d0m9QiCeF4A4bBZam4r9anhpQqsVMBAUAKKOtCoXeA@mail.gmail.com> <121230113526.ZM967@torch.brasslantern.com>
- Sender: eatnumber1@xxxxxxxxx
On Sun, Dec 30, 2012 at 2:35 PM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> This obviously is a case where err_return might be permitted to behave
> differently without causing too much consternation, but that's not how
> it has been defined.
Can this be arranged? It would enable idioms like the following to be used:
function get_major_version {
setopt err_return
[[ $(program -V) =~ "version ([[:digit:]]+)\." ]]
REPLY=$match[1]
}
which I think is quite nice
Messages sorted by:
Reverse Date,
Date,
Thread,
Author