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

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] [slock][PATCH] Improve option parsing routine

2016-10-29 Thread Ali H. Fardan
On 2016-10-29 21:35, Laslo Hunhold wrote: The "problem" with dmenu is that it takes "long" flags, and given so many scripts depend on it we just cannot change it that easily. when did I suggest using arg.h for dmenu? --- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org

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])) {

Re: [hackers] [slock][PATCH] Remove arg.h, simplify option parsing

2016-10-29 Thread Laslo Hunhold
On Fri, 28 Oct 2016 22:56:14 +0200 Klemens Nanni wrote: Hey Klemens, > arg.h is really ugly code and way to complex for tools like slock that > have such minimal synopsis. it's a bit of "macro magic", but not really that complex if you think about it. Also, the usage within

Re: [hackers] [slock][PATCH] Improve option parsing routine

2016-10-29 Thread Laslo Hunhold
On Sat, 29 Oct 2016 13:11:27 +0300 "Ali H. Fardan" wrote: Hey Ali, > uhm, like the dmenu one?[0] > > [0]: http://git.suckless.org/dmenu/tree/dmenu.c#n649 this has already been discussed; I wrote a patch for that a long time ago and we came to the conclusion that changing the

Re: [hackers] [slock][PATCH] Improve option parsing routine

2016-10-29 Thread Hiltjo Posthuma
On Sat, Oct 29, 2016 at 12:11 PM, Ali H. Fardan wrote: > On 2016-10-29 12:40, Hiltjo Posthuma wrote: >> >> This is total bullshit: it is less readable and it makes no sense to >> optimize this case. Please fix real bugs. > > > uhm, like the dmenu one?[0] > > [0]:

Re: [hackers] [slock][PATCH] Improve option parsing routine

2016-10-29 Thread Ali H. Fardan
On 2016-10-29 12:40, Hiltjo Posthuma wrote: This is total bullshit: it is less readable and it makes no sense to optimize this case. Please fix real bugs. uhm, like the dmenu one?[0] [0]: http://git.suckless.org/dmenu/tree/dmenu.c#n649 --- () ascii ribbon campaign - against html e-mail /\

Re: [hackers] [slock][PATCH] Remove arg.h, simplify option parsing

2016-10-29 Thread Ali H. Fardan
On 2016-10-28 23:56, Klemens Nanni wrote: arg.h is really ugly code and way to complex for tools like slock that have such minimal synopsis. it's not ugly, you just can't wrap your head around it, it's just a unix port of the plan 9 option parser[0] [0]:

Re: [hackers] [slock][PATCH] Improve option parsing routine

2016-10-29 Thread Hiltjo Posthuma
On Sat, Oct 29, 2016 at 12:32 AM, Klemens Nanni wrote: > This reduces the amount of strcmp() calls and comparisons in general to > a minimum. > --- > slock.c | 13 ++--- > 1 file changed, 6 insertions(+), 7 deletions(-) > > diff --git a/slock.c b/slock.c > index