Re: [hackers] [dwm][PATCH] Do not call die() upon '-v' invocation

From: Klemens Nanni <kl3_AT_posteo.org>
Date: Sat, 29 Oct 2016 22:38:16 +0200

On Sat, Oct 29, 2016 at 08:42:12PM +0200, Laslo Hunhold wrote:
>On Fri, 28 Oct 2016 14:40:01 +0200
>Klemens Nanni <kl3_AT_posteo.org> wrote:
>
>> Returning -1 upon a valid invocation like 'dwm -v' is just wrong.
>
>I agree, but we should get rid of this EXIT_* stuff altogether.
>My proposal:
>
> if (argc == 2 && !strcmp("-v", argv[1])) {
> fputs("dwm-"VERSION, stdout);
> return 0;
> } else if (argc != 1)
> die("usage: dwm [-v]");
>
>What do you guys think about it?

I'm used to seeing/printing version information on stderr as it's more
of a debug information than normal output.

EXIT_* aren't really needed imho either.
Received on Sat Oct 29 2016 - 22:38:16 CEST

This archive was generated by hypermail 2.3.0 : Sat Oct 29 2016 - 22:48:15 CEST