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

From: Laslo Hunhold <dev_AT_frign.de>
Date: Sat, 29 Oct 2016 20:42:12 +0200

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?

Cheers

Laslo

-- 
Laslo Hunhold <dev_AT_frign.de>
Received on Sat Oct 29 2016 - 20:42:12 CEST

This archive was generated by hypermail 2.3.0 : Sat Oct 29 2016 - 20:48:18 CEST