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

  1. From: <jsq@ut-sally.UUCP> John Quarterman (moderator)
  2.  
  3. Topic: getopt (command line arguments) continued
  4.  
  5. This looks like it is going to be a backburner discussion for some time.
  6.  
  7. It has been noted in mail that the other getopt than the one I posted
  8. may be superior, and that it would be good to post whichever is the best
  9. to mod.sources or net.sources again, as those get archived on many hosts.
  10. Negotiations are in progress.
  11.  
  12. Note the address for submissions to mod.std.unix is ihnp4!ut-sally!std-unix.
  13. Mark Horton is very efficient, but he's got his own newsgroups to moderate....
  14.  
  15. ----------------------------------------------------------------------
  16.  
  17. Date: Wed, 3 Jul 85 16:51:43 edt
  18. From: wfmans@ihuxb.uucp
  19. Subject: Re: command line arguments
  20. To: mark@cbosgd.ATT.UUCP
  21. References: <2220@ut-sally.UUCP>
  22.  
  23. > > some commands take arguments as
  24. > > 
  25. > > command -abcdefg filename
  26. > > 
  27. > > and some as
  28. > > 
  29. > > command -a -b -c -d -e -f -g filename
  30. > > 
  31. > > It would be great if this was standardised.
  32.  
  33. The thing that burns me about some commands (and these are usually
  34. experimental tools, mind you, real UNIX commands seem to work ok)
  35. is that while most will accept
  36. command -flag           and        command - flag
  37. some will only accept one or the other.
  38. I suppose that its easier to process the latter with a shell script
  39. if you don't use getopt, but it sure is a pain.
  40.  
  41. ------------------------------
  42.  
  43. Date: Wed, 3 Jul 85 12:58:16 cdt
  44. From: neuro1!baylor!peter@rice.uucp (Peter da Silva)
  45. Subject: Re: Re: command line arguments
  46. Newsgroups: mod.std.unix
  47. To: neuro1!mark@cbosgd.ARPA
  48. References: <2210@ut-sally.UUCP> <2226@ut-sally.UUCP>
  49.  
  50. :-) Look! No quotes!
  51.  
  52. I doubt the necessity and even the wisdom of seperating an argument from
  53. the option by whitespace. I also dislike the blackballing of multicharacter
  54. options.
  55.  
  56. Since no arguments are allowed to be optional there's no point in
  57. distinguishing between '-t/dev/tty4' and '-t /dev/tty4'. Since 't'
  58. requires an argument the parsing is unambiguous.
  59.  
  60. It makes it harder to write transparent shell scripts. Atomic options make
  61. it much easier to pass stuff onto other programs. Parsing options in shell
  62. scripts is pretty much a lossage anyway, so why make things harder?
  63.  
  64. As for multicharater options: do you intend to kill "tail -30"? Since
  65. changing the number of lines is the most common case what's the problem?
  66. At any rate you should allow a simple '-nnn' for a high-usage.
  67.  
  68. [ Since tar is the standard for data interchange (actually, only the
  69. format of the tar data, not the tar program, is currently in the draft
  70. standard), I suspect there will always be anomalies.  The advantage
  71. of getopt is not that it's perfect, just that it's close enough and
  72. widespread enough that it has some chance of being adopted everywhere.
  73.  -mod ]
  74.  
  75. ----------------------------------------------------------------------
  76.  
  77. The moderated newsgroup mod.std.unix is for discussions of UNIX standards,
  78. in particular of the draft standard in progress by the IEEE P1003
  79. "UNIX Standards" Committee.
  80.  
  81. Submissions to the newsgroup to:    ut-sally!std-unix
  82. Comments about the newsgroup to:    ut-sally!std-unix-request
  83. Permission to post to the newsgroup is assumed for mail to the former address,
  84. but not for mail to the latter address, nor for mail to my personal addresses.
  85. -- 
  86.  
  87. John Quarterman, jsq@ut-sally.ARPA, {ihnp4,seismo,ctvax}!ut-sally!jsq
  88.  
  89. Volume-Number: Volume 1, Number 11
  90.  
  91.