Coder Social home page Coder Social logo

commandlines-rust's Introduction

commandlines for Rust

Crates.io Build Status Build status codecov MIT License

About

commandlines is a command line argument parsing library for Rust command line interface application development. The goal is to support most POSIX/GNU program argument syntax conventions.

The project is in development and the library API is not stable. Please see the developer documentation at https://docs.rs/commandlines.

Current POSIX/GNU Argument Syntax Convention Support

Available

  • Arguments are options if they begin with a hyphen delimiter (-)
  • Option names are single alphanumeric characters
  • Options typically precede other non-option arguments
  • The argument -- terminates all options; any following arguments are treated as non-option arguments, even if they begin with a hyphen
  • Options may be supplied in any order, or appear multiple times. The interpretation is left up to the particular application program
  • Long options consist of -- followed by a name made of alphanumeric characters and dashes. Option names are typically one to three words long, with hyphens to separate words
  • To specify an argument for a long option, write ‘--name=value’. This syntax enables a long option to accept an argument that is itself optional
  • Certain options require an argument. For example, the ‘-o’ command of the ld command requires an argument—an output file name
  • A token consisting of a single hyphen character is interpreted as an ordinary non-option argument. By convention, it is used to specify input from or output to the standard input and output streams.
  • Multiple options may follow a hyphen delimiter in a single token if the options do not take arguments. Thus, -abc is equivalent to -a -b -c

Not Available Yet

  • An option and its argument may or may not appear as separate tokens. (In other words, the whitespace separating them is optional.) Thus, ‘-o foo’ and ‘-ofoo’ are equivalent.

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.