Re: [sane-devel] [PATCH 1/2] use getopt()

2015-09-15 Thread Olaf Meeuwissen
Matteo Croce writes: > 2015-09-14 13:19 GMT+02:00 Olaf Meeuwissen : >> Matteo Croce writes: >> >>> 2015-09-13 7:18 GMT+02:00 Olaf Meeuwissen : Matteo Croce writes: [snip] Code's usage: [ -a [ username ] | -d [ n ] | -s [ n ] ] | -h Manual page : [ -a [ username ] | -d

Re: [sane-devel] [PATCH 1/2] use getopt()

2015-09-14 Thread Matteo Croce
2015-09-14 13:19 GMT+02:00 Olaf Meeuwissen : > Matteo Croce writes: > >> 2015-09-13 7:18 GMT+02:00 Olaf Meeuwissen : >>> Matteo Croce writes: >>> >>> [snip] >>> Code's usage: [ -a [ username ] | -d [ n ] | -s [ n ] ] | -h >>> Manual page : [ -a [ username ] | -d [ n ] | -s [ n ] | -h ] >>> ge

Re: [sane-devel] [PATCH 1/2] use getopt()

2015-09-14 Thread Olaf Meeuwissen
Matteo Croce writes: > 2015-09-13 7:18 GMT+02:00 Olaf Meeuwissen : >> Matteo Croce writes: >> >> [snip] >> Code's usage: [ -a [ username ] | -d [ n ] | -s [ n ] ] | -h >> Manual page : [ -a [ username ] | -d [ n ] | -s [ n ] | -h ] >> getopt : [-a username] [-d n] [-s n] [-h] >> >> An i

Re: [sane-devel] [PATCH 1/2] use getopt()

2015-09-13 Thread Matteo Croce
2015-09-13 7:18 GMT+02:00 Olaf Meeuwissen : > Matteo Croce writes: > >> Sorry about that, I'll fix in a new version, also what do you think >> about a nicer help string like: >> "Usage: %s [-a username] [-d n] [-s n] [-h]\n" > > Your suggestion made me take a second look and I noticed that I totall

Re: [sane-devel] [PATCH 1/2] use getopt()

2015-09-12 Thread Olaf Meeuwissen
Matteo Croce writes: > Sorry about that, I'll fix in a new version, also what do you think > about a nicer help string like: > "Usage: %s [-a username] [-d n] [-s n] [-h]\n" Your suggestion made me take a second look and I noticed that I totally missed the fact that the usage message treats the o

Re: [sane-devel] [PATCH 1/2] use getopt()

2015-09-12 Thread Matteo Croce
Sorry about that, I'll fix in a new version, also what do you think about a nicer help string like: "Usage: %s [-a username] [-d n] [-s n] [-h]\n" The main issue is that it seems that under OS/2 the socket handle is passed as an extra argument, what to do? Handle the extra argument only if HAVE_OS

Re: [sane-devel] [PATCH 1/2] use getopt()

2015-09-11 Thread Olaf Meeuwissen
Hi Matteo, I reviewed this patch and it looks *mostly* okay. The only place where I think you dropped the ball a bit is in the command-line option error handling. The original code outputs a usage message when it finds the help option as well as when it encounters anything unexpected. It also r

[sane-devel] [PATCH 1/2] use getopt()

2015-09-09 Thread Matteo Croce
--- frontend/saned.c | 80 +++- 1 file changed, 38 insertions(+), 42 deletions(-) diff --git a/frontend/saned.c b/frontend/saned.c index 108512d..f1f 100644 --- a/frontend/saned.c +++ b/frontend/saned.c @@ -2923,7 +2923,7 @@ do_bindings (int