azalea/azalea-brigadier
2023-05-16 23:57:06 -05:00
..
src fix warnings 2023-05-12 18:53:08 +00:00
tests more brigadier docs 2023-05-07 02:50:52 -05:00
Cargo.toml chore: Release 2023-05-16 23:57:06 -05:00
README.md more brigadier docs 2023-05-07 02:50:52 -05:00

Azalea Brigadier

A Rust port of Mojang's Brigadier command parsing and dispatching library.

Examples

use azalea_brigadier::prelude::*;
use std::sync::Arc;

#[derive(Debug, PartialEq)]
struct CommandSource {}

let mut subject = CommandDispatcher::new();
subject.register(literal("foo").executes(|_| 42));

assert_eq!(
    subject
        .execute("foo", Arc::new(CommandSource {}))
        .unwrap(),
    42
);

See the tests for more.