Re: on the awk(1)/nawk(1) usage synopsis

2007-01-29 Thread Jason McIntyre
On Mon, Jan 29, 2007 at 11:19:11PM +0100, Igor Sobrado wrote: > > I can send the patches to Brian Kernighan, asking him to apply > these changes to the awk(1) source code. Do you agree? If you > prefer sending the patches yourself, let me know. > the changes will be sent upstream next time we

Re: on the awk(1)/nawk(1) usage synopsis

2007-01-29 Thread Igor Sobrado
On Mon, Jan 29, 2007, Jason McIntyre wrote: > ah, ok. it is not 4 options (-s, -a, -f, and -e), but one (-safe, as in > "not in danger"). that's why it is described as a "...first (and not > very reliable) approximation to a ``safe'' version of awk." > > you are confusing that with the -f option, w

Re: on the awk(1)/nawk(1) usage synopsis

2007-01-29 Thread Igor Sobrado
In a private email, Philip Guenther has observed that awk does not completely folow the POSIX option guidelines. [-safe] is not [-s,-a,-f,-e] but a single option! The right patch is then: --- main.c.orig Mon Jan 29 15:01:20 2007 +++ main.c Mon Jan 29 15:52:47 2007 @@ -64,7 +64,7 @@

Re: on the awk(1)/nawk(1) usage synopsis

2007-01-29 Thread Jason McIntyre
On Mon, Jan 29, 2007 at 10:00:51PM +0100, Igor Sobrado wrote: > > Changes introduced by this patch: > > - adds three spaces after the tab character to improve readability > of the usage message. i prefer just to use a single tab to start a new line. otherwise we end up with lots of usage()

Re: on the awk(1)/nawk(1) usage synopsis

2007-01-29 Thread Jason McIntyre
On Mon, Jan 29, 2007 at 10:16:55PM +0100, Igor Sobrado wrote: > > I think that the "-f" option requires an argument. The argument > is not optional, though. It seems that the case block that manages > this option requires an argument. If the argument to "-f" is > optional it can be written as "

Re: on the awk(1)/nawk(1) usage synopsis

2007-01-29 Thread Igor Sobrado
Hi Jason. Sorry for sending the patches before answering to your email. As I am not subscribed to this mailing list I have not read your answer before working on the patches. I think that the "-f" option requires an argument. The argument is not optional, though. It seems that the case block th

Re: on the awk(1)/nawk(1) usage synopsis

2007-01-29 Thread Igor Sobrado
Hi Jason. Thank you very much for managing these small bugs so fast. The first patch is for main.c: --- main.c Mon Jan 29 15:01:20 2007 +++ main.c Mon Jan 29 15:04:28 2007 @@ -63,8 +63,8 @@ setlocale(LC_NUMERIC, "C"); /* for parsing cmdline & prog */ cmdname = __progna

Re: on the awk(1)/nawk(1) usage synopsis

2007-01-29 Thread Jason McIntyre
On Mon, Jan 29, 2007 at 09:11:26PM +0100, Igor Sobrado wrote: > Looking carefully at the switch () {...} structure in main.c > it seems that the option "-f" requires an argument: iff the argument > to "-f" is optional I would write: > > awk [-sae] [-V] [-d[n]] [-F fs] [-v var=value] [prog | -f [

Re: on the awk(1)/nawk(1) usage synopsis

2007-01-29 Thread Igor Sobrado
Jason, you are very fast! I will download the new main.c as soon as I arrive at home and remove the case for the "-m" option. I will remove the "f" option in "[-safe]" as it seems that the argument to it is not optional. I will submit the patch, based on the updated code, later. Two changes:

Re: on the awk(1)/nawk(1) usage synopsis

2007-01-29 Thread Igor Sobrado
Looking carefully at the switch () {...} structure in main.c it seems that the option "-f" requires an argument: iff the argument to "-f" is optional I would write: awk [-sae] [-V] [-d[n]] [-F fs] [-v var=value] [prog | -f [progfile]] file ... But it does not look as an optional argument,

Re: on the awk(1)/nawk(1) usage synopsis

2007-01-29 Thread Jason McIntyre
On Mon, Jan 29, 2007 at 07:37:04PM +0100, Igor Sobrado wrote: > > As a second change, I would suggest changing the usage message > in the binary to fit on a standard 80 columns display. In short, > I propose: > > - synchronizing the usage message returned by awk(1) and the > synopsis in th

on the awk(1)/nawk(1) usage synopsis

2007-01-29 Thread Igor Sobrado
Hello. Just a though... I was writing a simple awk(1) script and looked at the options supported by this utility in the hope to make the code cleaner. It seems that there is a big difference between the synopsis in the manual page: awk [-safe] [-V] [-d[n]] [-F fs] [-v var=value] [prog | -f pr