|
12 | 12 |
|
13 | 13 | //! Simple getopt alternative.
|
14 | 14 | //!
|
15 |
| -//! Construct a vector of options, either by using `reqopt`, `optopt`, and |
16 |
| -//! `optflag` or by building them from components yourself, and pass them to |
17 |
| -//! `getopts`, along with a vector of actual arguments (not including |
18 |
| -//! `argv[0]`). You'll either get a failure code back, or a match. You'll have |
19 |
| -//! to verify whether the amount of 'free' arguments in the match is what you |
20 |
| -//! expect. Use `opt_*` accessors to get argument values out of the matches |
21 |
| -//! object. |
| 15 | +//! Construct instance of `Options` and configure it by using `reqopt()`, |
| 16 | +//! `optopt()` and other methods that add option configuration. Then call |
| 17 | +//! `parse()` method and pass into it a vector of actual arguments (not |
| 18 | +//! including `argv[0]`). |
| 19 | +//! |
| 20 | +//! You'll either get a failure code back, or a match. You'll have to verify |
| 21 | +//! whether the amount of 'free' arguments in the match is what you expect. Use |
| 22 | +//! `opt_*` accessors to get argument values out of the matches object. |
22 | 23 | //!
|
23 | 24 | //! Single-character options are expected to appear on the command line with a
|
24 | 25 | //! single preceding dash; multiple-character options are expected to be
|
25 | 26 | //! proceeded by two dashes. Options that expect an argument accept their
|
26 | 27 | //! argument following either a space or an equals sign. Single-character
|
27 |
| -//! options don't require the space. |
| 28 | +//! options don't require the space. Everything after double-dash "--" argument |
| 29 | +//! is considered to be a 'free' argument, even if it starts with dash. |
28 | 30 | //!
|
29 | 31 | //! # Usage
|
30 | 32 | //!
|
|
0 commit comments