Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] print errors to stderr
- X-seq: zsh-workers 38752
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [PATCH] print errors to stderr
- Date: Thu, 23 Jun 2016 12:04:45 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1466676286; bh=l9Un99+zp4pH3IQRmFb1zdGHDbqSWlQKUOsq20Ms1/A=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=Kxl2pmj8XVnXBbziivlsUrX94WZKAdzAT8F2+eGWL0OItGVK8/+A1XF1bcEiIWgKqq8iuJWJbIrhgAs/efnZudXMSbVNxDjX6cxLtUP7ZfXpyWpg91DKhcToSHApkBf8YbEqpZvUa6kl+nMBAp5LlU7ZDKfX9q/iCPbGF0V3aXxL5d2JRl33PXOUL/cXFIEoBJ7ynFFVAEFVe17z2chJbIbu7BChUHHKqxQXTJ6BHDvJEEYG1Leux6h579hvZycz1C2prZdlbiokVj0QyqXhFoImV9L08VjtiIDZcCb3fkVljLI/ujKrbbYccvtbpjTSoA7rpJ1xgChFPqkIppMjqA==
- In-reply-to: <160622101417.ZM12222@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <576a3601.43921c0a.46393.50ee@mx.google.com> <23718.1466581326@thecus.kiddle.eu> <160622101417.ZM12222@torch.brasslantern.com>
Bart wrote:
> } I think this behaviour is actually intentional. It is arguably not an
> } error - the whence command's purpose is to search for something and
> } report on whether it is found. So it doesn't rely on finding it. Also,
> } this is compatible with csh and tcsh - the which command was a csh thing
> } first.
>
> Maybe it's time for either the doc or a code comment to explain this,
Sounds sensible.
Oliver
diff --git a/Src/builtin.c b/Src/builtin.c
index c2fb81e..bfb9e69 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -3633,6 +3633,7 @@ bin_whence(char *nam, char **argv, Options ops, int func)
}
}
if (!informed && (wd || v || csh)) {
+ /* this is information and not an error so, as in csh, use stdout */
zputs(*argv, stdout);
puts(wd ? ": none" : " not found");
returnval = 1;
@@ -3652,7 +3653,7 @@ bin_whence(char *nam, char **argv, Options ops, int func)
}
informed = 1;
} else {
- /* Not found at all. */
+ /* Not found at all. That's not an error as such so this goes to stdout */
if (v || csh || wd)
zputs(*argv, stdout), puts(wd ? ": none" : " not found");
returnval = 1;
Messages sorted by:
Reverse Date,
Date,
Thread,
Author