Re: Order getopt arguments

2022-12-12 Thread Peter Eisentraut
On 05.12.22 18:04, Robert Haas wrote: On Mon, Dec 5, 2022 at 11:51 AM Tom Lane wrote: Robert Haas writes: I was only talking about the actual argument to getopt(), not the order of the code stanzas. I'm not sure what we ought to do about the latter. 100% agreed that the getopt argument

Re: Order getopt arguments

2022-12-05 Thread Robert Haas
On Mon, Dec 5, 2022 at 11:51 AM Tom Lane wrote: > Robert Haas writes: > > I was only talking about the actual argument to getopt(), not the > > order of the code stanzas. I'm not sure what we ought to do about the > > latter. > > 100% agreed that the getopt argument should just be alphabetical.

Re: Order getopt arguments

2022-12-05 Thread Tom Lane
Robert Haas writes: > I was only talking about the actual argument to getopt(), not the > order of the code stanzas. I'm not sure what we ought to do about the > latter. 100% agreed that the getopt argument should just be alphabetical. But the bulk of Peter's patch is rearranging switch cases to

Re: Order getopt arguments

2022-12-05 Thread Robert Haas
On Mon, Dec 5, 2022 at 11:14 AM Tom Lane wrote: > Robert Haas writes: > > +1 for Peter's proposal to just alphabetize. That's easy to maintain, > > at least in theory. > > Agreed for single-letter options. Long options complicate matters: > are we going to order their code stanzas by the actual

Re: Order getopt arguments

2022-12-05 Thread Tom Lane
Robert Haas writes: > +1 for Peter's proposal to just alphabetize. That's easy to maintain, > at least in theory. Agreed for single-letter options. Long options complicate matters: are we going to order their code stanzas by the actual long name, or by the character/number returned by getopt?

Re: Order getopt arguments

2022-12-05 Thread Robert Haas
On Mon, Dec 5, 2022 at 3:42 AM Fabien COELHO wrote: > > I had noticed that most getopt() or getopt_long() calls had their letter > > lists in pretty crazy orders. There might have been occasional attempts > > at grouping, but those then haven't been maintained as new options were > > added. To

Re: Order getopt arguments

2022-12-05 Thread Fabien COELHO
Hello Peter, I had noticed that most getopt() or getopt_long() calls had their letter lists in pretty crazy orders. There might have been occasional attempts at grouping, but those then haven't been maintained as new options were added. To restore some sanity to this, I went through and