diff options
Diffstat (limited to 'src/lib/libc/stdlib/getopt.3')
| -rw-r--r-- | src/lib/libc/stdlib/getopt.3 | 23 | 
1 files changed, 13 insertions, 10 deletions
diff --git a/src/lib/libc/stdlib/getopt.3 b/src/lib/libc/stdlib/getopt.3 index 57d2c3668b..3c8779d788 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 | .\" $OpenBSD: getopt.3,v 1.8 1999/05/27 13:09:09 aaron Exp $ | 32 | .\" $OpenBSD: getopt.3,v 1.9 1999/06/29 18:36:20 aaron Exp $ | 
| 33 | .\" | 33 | .\" | 
| 34 | .Dd April 19, 1994 | 34 | .Dd April 19, 1994 | 
| 35 | .Dt GETOPT 3 | 35 | .Dt GETOPT 3 | 
| @@ -132,22 +132,25 @@ When all options have been processed (i.e., up to the first non-option | |||
| 132 | argument), | 132 | argument), | 
| 133 | .Fn getopt | 133 | .Fn getopt | 
| 134 | returns \-1. | 134 | returns \-1. | 
| 135 | .Sh SEE ALSO | ||
| 136 | .Xr getopt 1 , | ||
| 137 | .Xr getsubopt 3 | ||
| 135 | .Sh DIAGNOSTICS | 138 | .Sh DIAGNOSTICS | 
| 136 | If the | 139 | If the | 
| 137 | .Fn getopt | 140 | .Fn getopt | 
| 138 | function encounters a character not found in the string | 141 | function encounters a character not found in the string | 
| 139 | .Va optstring | 142 | .Va optstring | 
| 140 | or detects | 143 | or detects | 
| 141 | a missing option argument it writes an error message to | 144 | a missing option argument it writes an error message to | 
| 142 | .Em stderr | 145 | .Em stderr | 
| 143 | and returns | 146 | and returns | 
| 144 | .Ql ? . | 147 | .Ql ? . | 
| 145 | Setting | 148 | Setting | 
| 146 | .Va opterr | 149 | .Va opterr | 
| 147 | to a zero will disable these error messages. | 150 | to a zero will disable these error messages. | 
| 148 | If | 151 | If | 
| 149 | .Va optstring | 152 | .Va optstring | 
| 150 | has a leading | 153 | has a leading | 
| 151 | .Ql \&: | 154 | .Ql \&: | 
| 152 | then a missing option argument causes a | 155 | then a missing option argument causes a | 
| 153 | .Ql \&: | 156 | .Ql \&: | 
| @@ -202,17 +205,17 @@ function appeared | |||
| 202 | The | 205 | The | 
| 203 | .Fn getopt | 206 | .Fn getopt | 
| 204 | function was once specified to return | 207 | function was once specified to return | 
| 205 | .Dv EOF | 208 | .Dv EOF | 
| 206 | instead of \-1. | 209 | instead of \-1. | 
| 207 | This was changed by | 210 | This was changed by | 
| 208 | .St -p1003.2-92 | 211 | .St -p1003.2-92 | 
| 209 | to decouple | 212 | to decouple | 
| 210 | .Fn getopt | 213 | .Fn getopt | 
| 211 | from | 214 | from | 
| 212 | .Pa <stdio.h> . | 215 | .Pa <stdio.h> . | 
| 213 | .Pp | 216 | .Pp | 
| 214 | A single dash | 217 | A single dash | 
| 215 | .Dq Li - | 218 | .Pq Ql - | 
| 216 | may be specified as a character in | 219 | may be specified as a character in | 
| 217 | .Fa optstring , | 220 | .Fa optstring , | 
| 218 | however it should | 221 | however it should | 
| @@ -221,7 +224,7 @@ have an argument associated with it. | |||
| 221 | This allows | 224 | This allows | 
| 222 | .Fn getopt | 225 | .Fn getopt | 
| 223 | to be used with programs that expect | 226 | to be used with programs that expect | 
| 224 | .Dq Li - | 227 | .Ql - | 
| 225 | as an option flag. | 228 | as an option flag. | 
| 226 | This practice is wrong, and should not be used in any current development. | 229 | This practice is wrong, and should not be used in any current development. | 
| 227 | It is provided for backward compatibility | 230 | It is provided for backward compatibility | 
