GithubHelp home page GithubHelp logo

opter's Introduction

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
  • Raw is simply a raw input string

Names

Names come in two different types: short (1 char) and long (2+ chars). 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 Raw 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.

opter's People

Contributors

iamtyler avatar

Watchers

James Cloos avatar

opter's Issues

chains library on NPM

@iamtyler I'm reaching out about the chains library on NPM - I'm interested in building an open source package and was wondering if you would be open to talking about some kind of transfer of that NPM name. No worries if you're thinking about building it further!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.