I should have mentioned that the other main advantage is that if you try and merge two branches that have added parameters, the auto-merge doesn't fail. Because it will have differing lines, instead of a change inside a string on the same line.
On Tue, Mar 17, 2009 at 1:54 PM, Clint Webb <[email protected]> wrote: > For readability... can I recommend that we change the getopt() function, > which currently looks like: > >> */* process arguments */**while* ((c = getopt(argc, argv, >> "a:bp:s:U:m:Mc:khirvdl:u:P:f:s:n:t:D:Lw:")) != -1) {*switch* (c) { >> >> > so that it looks something like: > >> */* process arguments */* >> *while* (-1 != (c = getopt(argc, argv, >> "a:" >> "p:" */* TCP listening port */* >> "s:" >> "U:" >> "m:" >> "M" >> "c:" >> "k" >> "hi" >> "r" >> "v" */* Verbose mode */* >> "d" */* Daemon mode */* >> "u:" */* Username to drop to */* >> "l:" */* address to bind to */* >> "P:" */* PID file to write pid to */* >> "f:" >> "s:" >> "n:" >> "t:" >> "D:" >> "L" >> "R:" >> "C" */* Disable CAS */* >> "b:" >> "o:" */* Rarely used Options string */* >> ))) { >> *switch* (c) { >> >> > Of course, the intention is that each line would have a little comment, but > I got a bit lazy for this example. > Some people might find it ugly, but I think it would make it a bit easier > to help identify which bits are which... > > Both versions would compile to the same thing. > > > -- > "Be excellent to each other" > -- "Be excellent to each other"
