Crates.io | opter |
lib.rs | opter |
version | 0.2.0 |
source | src |
created_at | 2015-05-08 08:44:48.446437 |
updated_at | 2015-12-11 23:54:49.267883 |
description | Turn a series of strings into options exposed as an iterator. |
homepage | |
repository | https://github.com/iamtyler/opter |
max_upload_size | |
id | 2052 |
size | 9,626 |
Turn a series of strings into options exposed as an iterator.
When parsed, input strings are determined to be one of two types: a name or a value. From the sequence of names and values, the type of option is determined. It is one of:
Names come in two different types: short and long names. Long names start with --
and short names with -
. Short name Flags can be stacked, for example -abc
represents the flags a
, b
, and c
.
-
alone is treated as a value. --
signifies the end of options and is not emitted. All strings after --
are passed along as a Value option.
opter
consumes iterators over strings, or Iterator<Item = String>
. To use opter, pass a struct that has an implementation for IntoIterator
to opter::parse
. Parsing command-line options is a common use case that is met by opter::parse_env
.