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

  1. From: John Quarterman (moderator) <jsq@ut-sally.UUCP>
  2. Topic: still more on command line arguments (getopt)
  3.  
  4. ----------------------------------------------------------------------
  5.  
  6. From: seismo!nsc!idi!bene!luke!itkin (Steven List)
  7. Date: Thu, 18 Jul 85 09:20:51 pdt
  8. To: ut-sally.ARPA!std-unix
  9. Subject: extraneous arguments
  10. Organization: Benetics Corp, Mt. View, CA
  11.  
  12. >From: ihnp4!tektronix!uucp@ut-sally.ARPA
  13. >Date: Saturday, 13 Jul 85 18:43:47 PDT
  14. >Subject: What to do about extraneous arguments?
  15. >
  16. >Another aspect of command arguments is: after all the necessary arguments
  17. >have been processed, what if some are left?
  18. >
  19.  
  20. I'm in agreement with tektronix!rdoty.  I believe no program should produce
  21. unexpected results without some explanation.  In the case of programs
  22. like cmp and diff, a diagnostic AND a nonzero exit status would seem to
  23. be appropriate.  The diagnostic message would tend to satisfy checks on
  24. the size of the output being nonzero, and the status would satisfy
  25. status checks.
  26.  
  27. ----------------------------------------------------------------------
  28.  
  29. Date: Wed, 17 Jul 85 12:00:54 cdt
  30. From: neuro1!baylor!peter@rice.uucp (Peter da Silva)
  31. Subject: Re: Re: command line arguments
  32. References: <245@mcc-db.UUCP>
  33.  
  34. > Date: Mon, 8 Jul 85 00:52:46 pdt
  35. > From: nsc!turtlevax!ken@ihnp4.UUCP (Ken Turkowski)
  36. > Subject: Re: command line arguments
  37. > Someone suggested that parsing arguments in shell scripts was difficult.
  38. > I include the following shell scripts, one for the Bourne shell and one
  39. > for the C-shell, which parse arguments of the form:
  40. >     -v -O -o outfile file1 file2 file3
  41. > as well as
  42. >     -vOooutfile file1 file2 file3
  43.  
  44. Sure, you can make shell scripts do almost anything. When I get a source with
  45. that sort of stuff in it I generally rip it out & put up with weirdness. Why?
  46. Well, our system is badly overloaded. Commands like that take 30 seconds to
  47. a minute to start up!
  48.  
  49. ----------------------------------------------------------------------
  50.  
  51. Date: Wed, 17 Jul 85 12:04:53 cdt
  52. From: neuro1!baylor!peter@rice.uucp (Peter da Silva)
  53. Subject: Re: Re: command line arguments
  54. References: <246@mcc-db.UUCP>
  55.  
  56. > > I doubt the necessity and even the wisdom of seperating an argument from
  57. > > the option by whitespace.
  58. > As I recall it, the AT&T standard does it this way on the grounds of
  59. > readability, not necessity.  The "-t/dev/tty" example is an easy one
  60. > to pick out, but what about "-dfaglop"?  Which of those letters are
  61. > options, and which are an option argument?
  62.  
  63. OK, instead of forcing whitespace, how about requiring that there only be one
  64. flag if you are going to do this sort of stuff? I have had shell scripts
  65. totally broken by this requirement, and workarounds take up so much overhead
  66. (yes, some people have systems smaller than vaxen) that it's not worth the
  67. hassle.
  68.  
  69. ----------------------------------------------------------------------
  70.  
  71. This moderated newsgroup, mod.std.unix, and the corresponding ARPA Internet
  72. mailing list, is for discussions of UNIX standards; specifically
  73. the draft standard in progress by the IEEE P1003 Committee.
  74. Submissions to:    ut-sally!std-unix      or std-unix@ut-sally.ARPA
  75. Comments to:    ut-sally!std-unix-request or std-unix-request@ut-sally.ARPA
  76. -- 
  77.  
  78. John Quarterman,   UUCP:  {ihnp4,seismo,harvard,gatech}!ut-sally!jsq
  79. ARPA Internet and CSNET:  jsq@ut-sally.ARPA, soon to be jsq@sally.UTEXAS.EDU
  80.  
  81. Volume-Number: Volume 1, Number 30
  82.  
  83.