opter 0.2.0

Turn a series of strings into options exposed as an iterator.
Documentation
  • Coverage
  • 0%
    0 out of 9 items documented0 out of 5 items with examples
  • Size
  • Source code size: 9.78 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.12 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • iamtyler/opter
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • iamtyler

opter

Turn a series of strings into options exposed as an iterator.

Build Status Coverage Status

Option

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:

  • Flag is a name without a value
  • Ordinal is a value without a name
  • Named is a value with a name
  • Value is simply a raw input string

Names

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.

Special Values

- 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.

Using opter

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.