1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00
azalea/azalea-brigadier
2025-06-27 14:00:26 -09:00
..
src fix unused import warnings when compiling some crates individually 2025-06-16 05:50:06 +05:00
tests typos 2025-06-27 14:00:26 -09:00
Cargo.toml use workspace deps everywhere 2025-06-16 01:20:37 +01:00
README.md remove executable bit from files 2025-04-04 15:56:06 +00: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.