home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / mod.std.unix.v1 / text0003.txt < prev    next >
Encoding:
Internet Message Format  |  1987-06-30  |  5.7 KB

  1. From: John Quarterman (moderator) <ut-sally!std-unix>
  2.  
  3. Topic: getopt (command line arguments)
  4.  
  5. The previous posting about standardization of command line options
  6. produced several comments about getopt, one of which I have already
  7. posted.  I've picked out new information from the others and included
  8. them here, after an excerpt from the original posting.
  9.  
  10. If your mail isn't excerpted here, it's not that I'm ignoring you:  it's
  11. merely that either yours duplicated what earlier mail had already said,
  12. or it was mailed to ut-sally!jsq rather than ut-sally!std-unix
  13. and I haven't gotten confirmation, or it never got to me.
  14.  
  15. ----------------------------------------------------------------------
  16.  
  17. Date: Thu, 27 Jun 85 18:08:26 bst
  18. From: Douglas Spencer <seismo!mcvax!daisy!maugg>
  19. Subject: Re: mod.std.unix created
  20. To: ut-sally!jsq
  21.  
  22. > some commands take arguments as
  23. > command -abcdefg filename
  24. > and some as
  25. > command -a -b -c -d -e -f -g filename
  26. > It would be great if this was standardised.
  27.  
  28. ------------------------------
  29.  
  30. Date: Sat, 29 Jun 85 08:42:41 edt
  31. From: Marty Shannon <seismo!allegra!eagle!mjs>
  32. Subject: Re: command line arguments
  33. To: ut-sally!jsq
  34.  
  35. Perhaps this should really be a followup rather than a reply, but there is a
  36. fairly strong move to standardize command argument parsing by using the getopt
  37. routine.  It deals quite well with the problem, as well as providing a great
  38. deal of flexibility.
  39.  
  40.     Marty Shannon
  41. UUCP:    ihnp4!eagle!mjs
  42. Phone:    +1 201 522 6063
  43.  
  44. [ Someone else notes in mail that the AT&T command line argument standard
  45. is included in the System V Interface Definition, page 343 of the Spring
  46. 1985 edition, and getopt conforms to this standard. -mod]
  47.  
  48. ------------------------------
  49.  
  50. Date: 29 Jun 85 23:49:35 CDT (Sat)
  51. From: Henry Spencer <ihnp4!utzoo!henry>
  52. Subject: Re: command line arguments
  53. To: ihnp4!ut-sally!std-unix
  54.  
  55. There is an AT&T standard for command argument syntax, and the getopt(3)
  56. parser which encourages its use.  (Incidentally, the standard says that
  57. both (for example) "ls -al" and "ls -a -l" are legit.)  AT&T has published
  58. its own getopt() sources to encourage use of getopt, and there is also
  59. an explicitly public-domain implementation that was published on the net
  60. some time ago (by me).
  61.  
  62. [ I find the following articles in net.sources about getopt:
  63.  
  64. >From: henry@utzoo.UUCP (Henry Spencer)
  65. Subject: public-domain getopt
  66. Message-ID: <3745@utzoo.UUCP>
  67. Date: Thu, 12-Apr-84 16:41:58 CST
  68.  
  69. >From: hansen@pegasus.UUCP (Tony L. Hansen)
  70. Subject: Re: public domain getopt
  71. Message-ID: <1253@pegasus.UUCP>
  72. Date: Tue, 1-May-84 09:54:16 CDT
  73.  
  74. >From: henry@utzoo.UUCP (Henry Spencer)
  75. Subject: minor bug in public-domain getopt
  76. Message-ID: <4188@utzoo.UUCP>
  77. Date: Tue, 7-Aug-84 15:31:16 CDT
  78.  
  79. >From: keith@seismo.UUCP (Keith Bostic)
  80. Subject: public domain getopt(3)
  81. Message-ID: <3360@seismo.UUCP>
  82. Date: Fri, 24-Aug-84 07:54:08 CDT
  83.  
  84. The first one is Henry's code, the next two are bug fixes to that,
  85. and the last one is a reimplementation by Keith Bostic.  -mod ]
  86.  
  87. Here at utzoo, most any time that we do significant work on a Bell program,
  88. we retrofit it with getopt unless its established syntax is seriously
  89. incompatible with this.  And of course all our own code uses it.  Getopt
  90. and its syntax have some defects, but uniformity is such a huge win that
  91. it's overwhelmingly worth it.
  92.  
  93.                 Henry Spencer @ U of Toronto Zoology
  94.                 {allegra,ihnp4,linus,decvax}!utzoo!henry
  95.  
  96. ------------------------------
  97.  
  98. Date:    Sun, 30 Jun 85  01:00 EDT
  99. From: George M. Weaver <ihnp4!psuvax1!GMW@PSUVM.BITNET>
  100. Subject: Re: command line arguments
  101. To: ut-sally!std-unix
  102.  
  103.      Frank da Cruz's new C-Kermit adopts a set of command line argument
  104. standards that are worth looking at.  He outlines them briefly, and gives
  105. credit to their creators in the Kermit User Manual, part of which I've
  106. included here (without permission -- hope you don't mind, Frank).
  107.  
  108. ===============================================================================
  109.  
  110. The C-Kermit command line syntax has been changed from that of earlier releases
  111. of Unix Kermit to conform to the "Proposed Syntax  Standards  for  Unix  System
  112. Commands"  put  forth  by  Kathy  Hemenway  and  Helene  Armitage  of AT&T Bell
  113. Laboratories in Unix/World, Vol.1, No.3, 1984.  The rules that apply are:
  114.  
  115.    - Command names must be between 2 and 9 characters ("kermit" is 6).
  116.    - Command names must include lower case letters and digits only.
  117.    - An option name is a single character.
  118.    - Options are delimited by '-'.
  119.    - Options with  no  arguments  may  be  grouped  (bundled)  behind  one
  120.      delimiter.
  121.    - Option-arguments cannot be optional.
  122.    - Arguments immediately follow options, separated by whitespace.
  123.    - The order of options does not matter.
  124.    - '-' preceded and followed by whitespace means standard input.
  125.  
  126. A group of bundled options may end with an option that has an argument.
  127.  
  128. ===============================================================================
  129.  
  130.  
  131. George M. Weaver
  132. Penn State Astronomy Dept.
  133. GMW at PSUVM.BITNET
  134. ...!allegra!psuvax1!gmw@psuvm.bitnet
  135.  
  136. ------------------------------
  137.  
  138. The moderated newsgroup mod.std.unix is for discussions of UNIX standards,
  139. in particular the one in progress by the IEEE P1003 "UNIX Standards" Committee.
  140.  
  141. Please mail submissions to mod.std.unix to ut-sally!std-unix,
  142. and comments about the newsgroup to ut-sally!std-unix-request.
  143. Permission for posting to the newsgroup is assumed for mail
  144. to the former address, but mail to the latter address will
  145. not be posted unless explicit permission is included, or obtained
  146. by later negotiation.  Mail to ut-sally!jsq concerning mod.std.unix
  147. will be treated like mail to ut-sally!std-unix-request.
  148. -- 
  149.  
  150. John Quarterman, jsq@ut-sally.ARPA, {ihnp4,seismo,ctvax}!ut-sally!jsq
  151.  
  152.  
  153. Volume-Number: Volume 1, Number 04
  154.  
  155.