onGetopts
ByTheWay (henceforth btw) here is a note on the roots of getopts:
Two things from that note.:
- I found it by searching: "getopts helen armitage"; she is now (possibly just retired) as VP of IBM Systems Group. she and Hemmenway were the System Engineers at AT&T Unix System Labs who gave us "getopts". I supported it in the standard because it served to regularize the mess of command interface. Though my preference was and is for the DIY method, of which Paul's is as regular as i've seen.
- the P1003 mentioned in the note is the IEEE Portable Operating System Inter(active|face?) eXecutive standard (hence "posix") of which I was a voting member on "dot 1", the System Interface and a committee member (contributed content) to "dot 3", the test methods. "dot 2" is where the command line and available commands of the day belonged. the latter two took 3,4 years to separate themselves.
While at my last employer, a young programmer came to me about similar functionality in Tcl, our systems language; I pointed him at the getopts man page. His implementation served us well since it added clarity to an area where 100 programmers were running in every direction.
in the p.s. dept: note the email addresses of the day, where quarterman offers both, to show how they have evolved:
jsq@ut-sally.ARPA, {ihnp4,seismo,ctvax}!ut-sally!jsq
AT&T (thru uucp) was using the ! delimiter, and the individual's login id was at the right end, where it belongs. the {…} were a short list of well-known hubs which the sender had to route to, so if you had a company mail-server (cosrv, say) your address therefore to jsq might be:
cosrv!seismo!ut-sally!jsq
if your sysadm had told you "use seismo as the gateway". noting the first hop (ihnp4) in the list, i can tell you, using the ATT building code the machine was in Indian Hill, NaPerville (Ilinois), machine #4, which was the company's midwestern email hub.
one can appreciate this doesn't scale so well.
if you are interested in how command options evolved, read the email chain.
also, here is a paper in progress: On Command Arguments