Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 29 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,35 @@
//! whether the amount of 'free' arguments in the match is what you expect. Use
//! `opt_*` accessors to get argument values out of the matches object.
//!
//! Single-character options are expected to appear on the command line with a
//! single preceding dash; multiple-character options are expected to be
//! proceeded by two dashes. Options that expect an argument accept their
//! argument following either a space or an equals sign. Single-character
//! options don't require the space. Everything after double-dash "--" argument
//! is considered to be a 'free' argument, even if it starts with dash.
//! Single-character options use a single dash (e.g. `-u`).
//! Multiple-character options use two dashes (e.g. `--unified`).
//!
//! For multiple-character options:
//! - required arguments may be provided using either a space or `=`
//! - optional arguments must be provided using `=`
//!
//! Examples:
//! ```text
//! --width=80 # required argument via '='
//! --width 80 # required argument via space
//! --unified=3 # optional argument via '='
//! --unified 4 # bad, '4' is treated as a 'free' argument
//! ```
//!
//! For single-character options, arguments may be provided with or without a
//! space, but not using `=`.
//!
//! Examples:
//! ```text
//! -u19 # argument without space
//! -u 19 # argument with space
//! -u=20 # bad, argument is parsed as '=20'
//! ```
//!
//! The double-dash separator `--` terminates option parsing. Everything after it
//! is treated as a 'free' argument, even if it starts with a dash. For example:
//! `--brief -u9 -- plus.txt -.txt`

//!
//! # Usage
//!
Expand Down