Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

Commit

Permalink
docs: update readme example
Browse files Browse the repository at this point in the history
  • Loading branch information
Fyko committed Aug 16, 2020
1 parent b5ce85e commit d8118b2
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,16 @@ kwp = "0.1.0"

## example
```rust
// cargo run -- +my,-keywords,+here

use kwp::{Parser, Prefixes};
use std::env;

fn main() {
let input = env::args_os()
.nth(1)
.expect("No input provided.")
.into_string()
.unwrap();
let input = "+foo,-bar,+baz,-bak";

let parser = Parser::new(
&input,
Prefixes::default()
);
let (pos, neg, other) = parser.parse();
println!(
"Input: {}\nPositive: {:#?}\nNegative: {:#?}\nOther: {:#?}",
input, pos, neg, other
);
let res = parser.parse();
println!("{:#?}", res);
}
```

0 comments on commit d8118b2

Please sign in to comment.