From: Ruediger Meier <sweet_f_a@gmx.de>
To: Karel Zak <kzak@redhat.com>
Cc: Sami Kerola <kerolasa@iki.fi>, util-linux@vger.kernel.org
Subject: Re: [PATCH] uuidparse: add new command
Date: Mon, 19 Jun 2017 11:55:22 +0200 [thread overview]
Message-ID: <201706191155.23149.sweet_f_a@gmx.de> (raw)
In-Reply-To: <20170619092813.evirrk3zy6omv6xi@ws.net.home>
On Monday 19 June 2017, Karel Zak wrote:
> On Mon, Jun 19, 2017 at 11:22:48AM +0200, Ruediger Meier wrote:
> > > +static void __attribute__((__noreturn__)) usage(FILE *out)
> >
> > Do we really need this FILE argument? You are using only stdout in
> > uuidparse and that's good and should never change ;) I can't
> > imagine any good reason why usage should ever go to stderr and
> > exit(1).
> >
> > BTW currently I'm going through the whole project to correct all
> > commands where we spam the whole usage in case of errors.
>
> That's legacy from time we used usage(stderr) for command line
> parsing errors. Now we use errtryhelp().
Yes I know, but there are still a few commands where we could
correct --help, etc.
FYI I've made a little script to find candidates to fix, see below. I
will send some patches.
$ ./tools/check_help.sh
flock: --help, no stdout
flock: --help, non-empty stderr
getopt: --help, returns error
kill: --unknownopt, stderr too short: 1
mkfs.cramfs: --help, returns error
mkfs.cramfs: --version, returns error
whereis: --help, returns error
whereis: --version, returns error
whereis: --unknownopt, stderr too long: 18
agetty: --unknownopt, stderr too long: 45
blockdev: --unknownopt, stderr too long: 28
fsck: --help, returns error
fsck: --version, returns error
fsck: --unknownopt, non-empty stdout
fsck: --unknownopt, stderr too long: 18
login: --help, returns error
login: --version, returns error
login: --unknownopt, stderr too long: 4
lsipc: --unknownopt, stderr too long: 77
mkfs: --unknownopt, stderr too long: 8
more: --help, returns error
more: --version, returns error
more: --unknownopt, stderr too long: 21
nologin: --help, returns error
nologin: --version, returns error
pg: --unknownopt, stderr too long: 23
renice: --unknownopt, stderr too long: 18
rtcwake: --unknownopt, non-empty stdout
rtcwake: --unknownopt, stderr too long: 21
sulogin: --unknownopt, stderr too long: 17
write: --unknownopt, stderr too long: 12
(There are also some false positives like nologin.)
cu,
Rudi
next prev parent reply other threads:[~2017-06-19 9:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-18 17:25 [PATCH] uuidparse: add new command Sami Kerola
2017-06-19 8:41 ` Karel Zak
2017-06-20 19:43 ` Sami Kerola
2017-06-26 12:53 ` Karel Zak
2017-06-19 9:22 ` Ruediger Meier
2017-06-19 9:28 ` Karel Zak
2017-06-19 9:55 ` Ruediger Meier [this message]
2017-06-19 18:14 ` J William Piggott
2017-06-19 19:03 ` Ruediger Meier
2017-06-19 19:47 ` J William Piggott
2017-06-19 20:39 ` remove stderr usage (was: [PATCH] uuidparse) Rüdiger Meier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201706191155.23149.sweet_f_a@gmx.de \
--to=sweet_f_a@gmx.de \
--cc=kerolasa@iki.fi \
--cc=kzak@redhat.com \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox