diff options
Diffstat (limited to 'src/lib/libc/stdlib/getopt.3')
-rw-r--r-- | src/lib/libc/stdlib/getopt.3 | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/lib/libc/stdlib/getopt.3 b/src/lib/libc/stdlib/getopt.3 index f843881afd..4340ff54fd 100644 --- a/src/lib/libc/stdlib/getopt.3 +++ b/src/lib/libc/stdlib/getopt.3 | |||
@@ -29,7 +29,7 @@ | |||
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
30 | .\" SUCH DAMAGE. | 30 | .\" SUCH DAMAGE. |
31 | .\" | 31 | .\" |
32 | .\" @(#)getopt.3 8.4 (Berkeley) 4/19/94 | 32 | .\" $OpenBSD: getopt.3,v 1.6 1998/05/05 19:36:03 deraadt Exp $ |
33 | .\" | 33 | .\" |
34 | .Dd April 19, 1994 | 34 | .Dd April 19, 1994 |
35 | .Dt GETOPT 3 | 35 | .Dt GETOPT 3 |
@@ -137,12 +137,12 @@ returns \-1. | |||
137 | If the | 137 | If the |
138 | .Fn getopt | 138 | .Fn getopt |
139 | function encounters a character not found in the string | 139 | function encounters a character not found in the string |
140 | .Va optarg | 140 | .Va optstring |
141 | or detects | 141 | or detects |
142 | a missing option argument it writes an error message and returns | 142 | a missing option argument it writes an error message to |
143 | .Ql ? | 143 | .Em stderr |
144 | to the | 144 | and returns |
145 | .Em stderr . | 145 | .Ql ? . |
146 | Setting | 146 | Setting |
147 | .Va opterr | 147 | .Va opterr |
148 | to a zero will disable these error messages. | 148 | to a zero will disable these error messages. |
@@ -174,8 +174,8 @@ extern int optind; | |||
174 | int bflag, ch, fd; | 174 | int bflag, ch, fd; |
175 | 175 | ||
176 | bflag = 0; | 176 | bflag = 0; |
177 | while ((ch = getopt(argc, argv, "bf:")) != -1) | 177 | while ((ch = getopt(argc, argv, "bf:")) != -1) { |
178 | switch(ch) { | 178 | switch (ch) { |
179 | case 'b': | 179 | case 'b': |
180 | bflag = 1; | 180 | bflag = 1; |
181 | break; | 181 | break; |
@@ -189,6 +189,7 @@ while ((ch = getopt(argc, argv, "bf:")) != -1) | |||
189 | case '?': | 189 | case '?': |
190 | default: | 190 | default: |
191 | usage(); | 191 | usage(); |
192 | } | ||
192 | } | 193 | } |
193 | argc -= optind; | 194 | argc -= optind; |
194 | argv += optind; | 195 | argv += optind; |
@@ -213,7 +214,7 @@ from | |||
213 | .Pp | 214 | .Pp |
214 | A single dash | 215 | A single dash |
215 | .Dq Li - | 216 | .Dq Li - |
216 | may be specified as an character in | 217 | may be specified as a character in |
217 | .Fa optstring , | 218 | .Fa optstring , |
218 | however it should | 219 | however it should |
219 | .Em never | 220 | .Em never |