This commit is contained in:
Jorge Bucaran 2016-02-20 22:19:25 +09:00
parent 4132d600a0
commit 5d38c7b566
2 changed files with 10 additions and 27 deletions

View File

@ -15,10 +15,10 @@
.br
.
.SH "DESCRIPTION"
\fBGetopts\fR is a command line parser implemented in \fBawk(1)\fR, designed to process command line arguments in the easiest way possible\.
\fBGetopts\fR is a command line options parser for fish\.
.
.SH "USAGE"
The best way to understand how \fBgetopts\fR work is by studying a simple example\.
The best way to understand how getopts work is by studying a basic example\.
.
.IP "" 4
.
@ -50,7 +50,7 @@ _ baz
The items on the left represent the option flags or \fIkeys\fR associated with the CLI\. The items on the right are the option \fIvalues\fR\. The underscore \fB_\fR character is the default \fIkey\fR for arguments without a key\.
.
.P
Use \fBread(1)\fR to process the generated stream and \fBswitch(1)\fR to match patterns:
Use read(1) to process the generated stream and switch(1) to match patterns:
.
.IP "" 4
.
@ -69,11 +69,8 @@ end
.
.IP "" 0
.
.SH "OPTIONS"
None\.
.
.SH "EXAMPLES"
The following is a mock of \fBfish(1)\fR CLI missing the implementation:
The following is a mock of fish(1) CLI\.
.
.IP "" 4
.
@ -122,17 +119,11 @@ end
.
.IP "" 0
.
.SH "BUGS"
.
.IP "\(bu" 4
getopts does \fInot\fR read the standard input\. Use getopts to collect options and the standard input to process a stream of data relevant to your program\.
.SH "NOTES"
.
.IP "\(bu" 4
A double dash, \fB\-\-\fR, marks the end of options\. Arguments after this sequence are placed in the default underscore key, \fB_\fR\.
.
.IP "\(bu" 4
The getopts described in this document is \fInot\fR equivalent to the getopts \fIbuiltin\fR found in other shells\.
.
.IP "" 0
.
.SH "AUTHORS"

View File

@ -8,11 +8,11 @@ getopts(1) -- Parse CLI options
## DESCRIPTION
`Getopts` is a command line parser implemented in `awk(1)`, designed to process command line arguments in the easiest way possible.
**Getopts** is a command line options parser for fish.
## USAGE
The best way to understand how `getopts` work is by studying a simple example.
The best way to understand how getopts work is by studying a basic example.
```
getopts -ab1 --foo=bar baz
@ -29,7 +29,7 @@ _ baz
The items on the left represent the option flags or *keys* associated with the CLI. The items on the right are the option *values*. The underscore `_` character is the default *key* for arguments without a key.
Use `read(1)` to process the generated stream and `switch(1)` to match patterns:
Use read(1) to process the generated stream and switch(1) to match patterns:
```
getopts -ab1 --foo=bar baz | while read -l key option
@ -42,13 +42,9 @@ getopts -ab1 --foo=bar baz | while read -l key option
end
```
## OPTIONS
None.
## EXAMPLES
The following is a mock of `fish(1)` CLI missing the implementation:
The following is a mock of fish(1) CLI.
```
function fish
@ -91,14 +87,10 @@ function fish
end
```
## BUGS
* getopts does *not* read the standard input. Use getopts to collect options and the standard input to process a stream of data relevant to your program.
## NOTES
* A double dash, `--`, marks the end of options. Arguments after this sequence are placed in the default underscore key, `_`.
* The getopts described in this document is *not* equivalent to the getopts *builtin* found in other shells.
## AUTHORS
Jorge Bucaran <j@bucaran.me>.