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

2016-10-29 Thread Klemens Nanni
On Sat, Oct 29, 2016 at 08:42:12PM +0200, Laslo Hunhold wrote: On Fri, 28 Oct 2016 14:40:01 +0200 Klemens Nanni 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 && !str

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

2016-10-29 Thread Quentin Rameau
> 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

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

2016-10-29 Thread Laslo Hunhold
On Fri, 28 Oct 2016 14:40:01 +0200 Klemens Nanni 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

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

2016-10-28 Thread David Phillips
On Fri, Oct 28, 2016 at 03:58:14PM +0200, Martin Kühne wrote: > IMHO, when failing to parse command line arguments, usage() should be > called before exiting with EXIT_FAILURE. > on invocation with -h|--help, it should exit with EXIT_SUCCESS. > > cheers! > mar77i This sounds sane and solves the p

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

2016-10-28 Thread Martin Kühne
IMHO, when failing to parse command line arguments, usage() should be called before exiting with EXIT_FAILURE. on invocation with -h|--help, it should exit with EXIT_SUCCESS. cheers! mar77i

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

2016-10-28 Thread quinq
> > If not, that's your fault (or the packager you trust do to it for > > you, actually again your responsability). > > Blaming someone else won't solve the issue. Exactly, hence “your responsability”.

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

2016-10-28 Thread Ali H. Fardan
On 2016-10-28 13:21, Quentin Rameau wrote: On 2016-10-28 13:02, Quentin Rameau wrote: > On Fri, Oct 28, 2016 at 12:45:14PM +, Ali H. Fardan wrote: >> actually, imo, I think >> usage() should return success. > Surely not. > The call to usage() is made when wrong options have been passed to > t

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

2016-10-28 Thread Quentin Rameau
> On 2016-10-28 13:02, Quentin Rameau wrote: > > On Fri, Oct 28, 2016 at 12:45:14PM +, Ali H. Fardan wrote: > >> actually, imo, I think > >> usage() should return success. > > Surely not. > > The call to usage() is made when wrong options have been passed to > > the tool, you wouldn't retur

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

2016-10-28 Thread Ali H. Fardan
On 2016-10-28 13:02, Quentin Rameau wrote: On Fri, Oct 28, 2016 at 12:45:14PM +, Ali H. Fardan wrote: actually, imo, I think usage() should return success. Surely not. The call to usage() is made when wrong options have been passed to the tool, you wouldn't return “no error” code when there

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

2016-10-28 Thread Ali H. Fardan
I don't think -v should output to stderr either, actually, imo, I think usage() should return success. On 2016-10-28 12:40, Klemens Nanni wrote: Returning -1 upon a valid invocation like 'dwm -v' is just wrong. --- dwm.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/