Re: [PATCH] uuidparse: add new command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux