kwp 0.2.0

An input parser for positive and negative keywords input (e.g: +foo,-bar,+baz)
Documentation

kw-parser

An input parser for positive and negative keywords input (e.g: +foo,-bar,+baz)
Actions Crate Downloads

installation

# within Cargo.toml

kwp = "0.1.0"

example

// 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 parser = Parser::new(
        &input,
        Prefixes::default()
    );
    let (pos, neg, other) = parser.parse();
    println!(
        "Input: {}\nPositive: {:#?}\nNegative: {:#?}\nOther: {:#?}",
        input, pos, neg, other
    );
}