simple--args

Crates.iosimple--args
lib.rssimple--args
version1.1.1
sourcesrc
created_at2022-09-16 18:00:45.585438
updated_at2022-09-16 18:16:53.012284
descriptionA small library for parsing arguments in Rust
homepagehttps://github.com/bennett-sh/simple-args
repositoryhttps://github.com/bennett-sh/simple-args
max_upload_size
id667554
size4,090
Bennett (bennett-sh)

documentation

README

Simple Args

A small library for parsing arguments in Rust


📝Docs

simpleargs::SimpleArgs


fn new(args: Vec<String>) -> SimpleArgs

Creates a new instance using the provided arguments.

fn parse(&self) -> (Vec<String>, Vec<String>, HashMap<String, String>)

Parses the arguments. Returns a tuple with:

  1. Commands (e.g. ./myprogram test)
  2. Flags (e.g. -y -myflag /anotherflag)
  3. Options (e.g. --my-message "Hello world!")

Prefixes like "-", "/" or "--" are not included in the output.


🗒️Examples

Try it out:

cargo build --lib --example [name of example]
./target/debug/examples/[name of example](.exe)
Commit count: 0

cargo fmt