home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume29 / parseargs / part01 / doc / caveats.inc < prev    next >
Encoding:
Text File  |  1992-05-19  |  1.7 KB  |  60 lines

  1. .\"----------------------------------------------------------------------------
  2. .\"-- This text was extracted using the following command:
  3. .\"--   xdoc -man -n -p '[ \t]*' -I CAVEATS ../xparse.c
  4. .\"----------------------------------------------------------------------------
  5. .SH CAVEATS
  6. .PP
  7. Because of the way argument parsing is implemented under \s-1UNIX\s+1,
  8. \s-1MS-DOS\s+1, and \s-1OS/2\s+1,
  9. option arguments which contain a leading dash (`\-') (or whatever the
  10. option prefix character is defined to be) may \fInot\fP be specified
  11. as a separate argument on the command line, it must be part of the
  12. same argument. That is to say that if a program has a \fB\-f\fP option
  13. that requires a string argument, then the following:
  14. .sp 4p
  15. .RS
  16. .ft 4
  17. \-f\-arg
  18. .ft R
  19. .RE
  20. .sp 4p
  21. will properly assign the string ``\fB\-arg\fP'' to the option whereas
  22. the following:
  23. .sp 4p
  24. .RS
  25. .ft 4
  26. \-f\0\-arg
  27. .RE
  28. .sp 4p
  29. will be interpreted by \fIparseargs\fP as two option strings: the first
  30. of which (``\fB\-f\fP'') is missing a required argument and the second of
  31. which (``\fB\-arg\fP'') will most likely be flagged as an invalid option.
  32. .PP
  33. Similarly, if the user requires an \s-1\fIARGLIST\fP\s+1 option
  34. to take multiple arguments with leading dashes then the following
  35. method must be used: It is a ``feature'' of \fIparseargs\fP that
  36. \s-1\fIARGLIST\fP\s+1 arguments are always appended to the current
  37. list of arguments for the given option. Thus, if ``\fB\-f\fP'' is
  38. an option taking a list of arguments, then the following are all
  39. equivalent:
  40. .sp 8p
  41. .RS
  42. .ft 4
  43. \-farg1 arg2
  44. .sp 4p
  45. \-f arg1 arg2
  46. .sp 4p
  47. \-farg1 \-farg2
  48. .sp 4p
  49. \-f arg1 \-f arg2
  50. .ft R
  51. .RE
  52. .sp 8p
  53. Hence multiple ``leading dash'' arguments may specified as follows:
  54. .sp 4p
  55. .RS
  56. .ft 4
  57. \-f\-dash_arg1 \-f\-dash_arg2  ...
  58. .ft R
  59. .RE
  60.