patch-getopt_1 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. $OpenBSD: patch-getopt_1,v 1.3 2014/12/10 20:46:57 rpe Exp $
  2. --- getopt.1.orig Thu Nov 20 21:13:24 2014
  3. +++ getopt.1 Mon Dec 8 19:09:16 2014
  4. @@ -1,16 +1,16 @@
  5. -.TH GETOPT "1" "June 2012" "Linux" "User Commands"
  6. +.TH GNUGETOPT "1" "June 2012" "Linux" "User Commands"
  7. .SH NAME
  8. -getopt \- parse command options (enhanced)
  9. +gnugetopt \- parse command options (enhanced)
  10. .SH SYNOPSIS
  11. -.BI getopt
  12. +.BI gnugetopt
  13. .I optstring parameters
  14. .br
  15. -.B getopt
  16. +.B gnugetopt
  17. .RI [ options ]
  18. .RB [ \-\- ]
  19. .I optstring parameters
  20. .br
  21. -.B getopt
  22. +.B gnugetopt
  23. .RI [ options ]
  24. .BR \-o | \-\-options
  25. .I optstring
  26. @@ -18,7 +18,7 @@ getopt \- parse command options (enhanced)
  27. .RB [ \-\- ]
  28. .I parameters
  29. .SH DESCRIPTION
  30. -.B getopt
  31. +.B gnugetopt
  32. is used to break up
  33. .RI ( parse )
  34. options in command lines for easy parsing by shell procedures, and to
  35. @@ -28,10 +28,10 @@ check for legal options. It uses the
  36. routines to do this.
  37. .PP
  38. The parameters
  39. -.B getopt
  40. +.B gnugetopt
  41. is called with can be divided into two parts: options which modify
  42. the way
  43. -.B getopt
  44. +.B gnugetopt
  45. will do the parsing
  46. .RI "(the " options
  47. and the
  48. @@ -59,7 +59,7 @@ with a
  49. .RB ' \- ',
  50. the first format in the
  51. .BR SYNOPSIS ),
  52. -.B getopt
  53. +.B gnugetopt
  54. will generate output that is compatible with that of other versions of
  55. .BR getopt (1).
  56. It will still do parameter shuffling and recognize optional arguments
  57. @@ -76,12 +76,12 @@ must once again be interpreted by the shell (usually b
  58. .B eval
  59. command). This has the effect of preserving those characters, but
  60. you must call
  61. -.B getopt
  62. +.B gnugetopt
  63. in a way that is no longer compatible with other versions (the second
  64. or third format in the
  65. .BR SYNOPSIS ).
  66. To determine whether this enhanced version of
  67. -.BR getopt (1)
  68. +.BR gnugetopt (1)
  69. is installed, a special test option
  70. .RB ( \-T )
  71. can be used.
  72. @@ -106,15 +106,15 @@ and by two colons to indicate it has an optional argum
  73. .TP
  74. .BR \-n , " \-\-name \fIprogname\fP"
  75. The name that will be used by the
  76. -.BR getopt (3)
  77. +.BR gnugetopt (3)
  78. routines when it reports errors. Note that errors of
  79. -.BR getopt (1)
  80. -are still reported as coming from getopt.
  81. +.BR gnugetopt (1)
  82. +are still reported as coming from gnugetopt.
  83. .TP
  84. .BR \-o , " \-\-options \fIshortopts\fP"
  85. The short (one\-character) options to be recognized. If this option
  86. is not found, the first parameter of
  87. -.B getopt
  88. +.B gnugetopt
  89. that does not start with a
  90. .RB ' \- '
  91. (and is not an option argument) is used as the short options string.
  92. @@ -132,11 +132,11 @@ section
  93. for details).
  94. .TP
  95. .BR \-q , " \-\-quiet"
  96. -Disable error reporting by getopt(3).
  97. +Disable error reporting by gnugetopt(3).
  98. .TP
  99. .BR \-Q , " \-\-quiet\-output"
  100. Do not generate normal output. Errors are still reported by
  101. -.BR getopt (3),
  102. +.BR gnugetopt (3),
  103. unless you also use
  104. .BR \-q .
  105. .TP
  106. @@ -155,12 +155,12 @@ and
  107. Do not quote the output. Note that whitespace and special
  108. (shell\-dependent) characters can cause havoc in this mode (like they
  109. do with other
  110. -.BR getopt (1)
  111. +.BR gnugetopt (1)
  112. implementations).
  113. .TP
  114. .BR \-T , " \-\-test"
  115. Test if your
  116. -.BR getopt (1)
  117. +.BR gnugetopt (1)
  118. is this enhanced version or an old version. This generates no
  119. output, and sets the error status to 4. Other implementations of
  120. .BR getopt (1),
  121. @@ -175,7 +175,7 @@ Display version information and exit. No other output
  122. .SH PARSING
  123. This section specifies the format of the second part of the
  124. parameters of
  125. -.B getopt
  126. +.B gnugetopt
  127. (the
  128. .I parameters
  129. in the
  130. @@ -186,11 +186,11 @@ describes the output that is generated. These paramet
  131. typically the parameters a shell function was called with. Care must
  132. be taken that each parameter the shell function was called with
  133. corresponds to exactly one parameter in the parameter list of
  134. -.B getopt
  135. +.B gnugetopt
  136. (see the
  137. .BR EXAMPLES ).
  138. All parsing is done by the GNU
  139. -.BR getopt (3)
  140. +.BR gnugetopt (3)
  141. routines.
  142. .PP
  143. The parameters are parsed from left to right. Each parameter is
  144. @@ -371,9 +371,9 @@ is written to be as compatible as possible to other ve
  145. Usually you can just replace them with this version without any
  146. modifications, and with some advantages.
  147. .PP
  148. -If the first character of the first parameter of getopt is not a
  149. +If the first character of the first parameter of gnugetopt is not a
  150. .RB ' \- ',
  151. -.B getopt
  152. +.B gnugetopt
  153. goes into compatibility mode. It will interpret its first
  154. parameter as the string of short options, and all other arguments
  155. will be parsed. It will still do parameter shuffling (i.e. all
  156. @@ -385,7 +385,7 @@ is set.
  157. The environment variable
  158. .B GETOPT_COMPATIBLE
  159. forces
  160. -.B getopt
  161. +.B gnugetopt
  162. into compatibility mode. Setting both this environment variable and
  163. .B POSIXLY_CORRECT
  164. offers 100% compatibility for 'difficult' programs. Usually, though,
  165. @@ -397,13 +397,13 @@ and
  166. .RB ' + '
  167. characters in the short options string are ignored.
  168. .SH RETURN CODES
  169. -.B getopt
  170. +.B gnugetopt
  171. returns error code
  172. .B 0
  173. for successful parsing,
  174. .B 1
  175. if
  176. -.BR getopt (3)
  177. +.BR gnugetopt (3)
  178. returns errors,
  179. .B 2
  180. if it does not understand its own parameters,
  181. @@ -414,15 +414,13 @@ if it is called with
  182. .BR \-T .
  183. .SH EXAMPLES
  184. Example scripts for (ba)sh and (t)csh are provided with the
  185. -.BR getopt (1)
  186. +.BR gnugetopt (1)
  187. distribution, and are optionally installed in
  188. -.BR /usr/local/share/getopt/
  189. -or
  190. -.BR /usr/share/getopt/ .
  191. +.BR /usr/local/share/examples/gnugetopt/.
  192. .SH ENVIRONMENT
  193. .IP POSIXLY_CORRECT
  194. This environment variable is examined by the
  195. -.BR getopt (3)
  196. +.BR gnugetopt (3)
  197. routines. If it is set, parsing stops as soon as a parameter is
  198. found that is not an option or an option argument. All remaining
  199. parameters are also interpreted as non\-option parameters, regardless
  200. @@ -430,15 +428,15 @@ whether they start with a
  201. .RB ' \- '.
  202. .IP GETOPT_COMPATIBLE
  203. Forces
  204. -.B getopt
  205. +.B gnugetopt
  206. to use the first calling format as specified in the
  207. .BR SYNOPSIS .
  208. .SH BUGS
  209. -.BR getopt (3)
  210. +.BR gnugetopt (3)
  211. can parse long options with optional arguments that are given an
  212. empty optional argument (but can not do this for short options).
  213. This
  214. -.BR getopt (1)
  215. +.BR gnugetopt (1)
  216. treats optional arguments that are empty as if they were not present.
  217. .PP
  218. The syntax if you do not want any short option variables at all is
  219. @@ -449,11 +447,11 @@ string).
  220. Frodo Looijaard
  221. .ME
  222. .SH "SEE ALSO"
  223. -.BR getopt (3),
  224. +.BR gnugetopt (3),
  225. .BR bash (1),
  226. .BR tcsh (1).
  227. .SH AVAILABILITY
  228. -You can download the latest getopt from
  229. +You can download the latest gnugetopt from
  230. .UR http://frodo.looijaard.name/project/getopt
  231. the author's home page
  232. .UE .