diff options
| author | mat <github@matdoes.dev> | 2022-04-17 14:03:21 -0500 |
|---|---|---|
| committer | mat <github@matdoes.dev> | 2022-04-17 14:03:21 -0500 |
| commit | 82ed6baea5c4e0d00f5fc2bbeb45cbb2838a3784 (patch) | |
| tree | ee2423b2b9f97b2f31eb4040102a42ef78506a77 /azalea-brigadier/src | |
| parent | a72a47ced76065caf739898954cd18edbc39174b (diff) | |
| download | azalea-drasl-82ed6baea5c4e0d00f5fc2bbeb45cbb2838a3784.tar.xz | |
Clean up some old stuff
Diffstat (limited to 'azalea-brigadier/src')
| -rw-r--r-- | azalea-brigadier/src/main.rs | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/azalea-brigadier/src/main.rs b/azalea-brigadier/src/main.rs deleted file mode 100644 index 53f2efa8..00000000 --- a/azalea-brigadier/src/main.rs +++ /dev/null @@ -1,38 +0,0 @@ -use std::rc::Rc; - -use rust_command_parser::{ - builder::{literal_argument_builder::literal, required_argument_builder::argument}, - dispatcher::CommandDispatcher, - parsers::integer, -}; - -struct CommandSourceStack { - player: String, -} - -pub fn main() { - let mut dispatcher = CommandDispatcher::<Rc<CommandSourceStack>>::new(); - - let source = Rc::new(CommandSourceStack { - player: "player".to_string(), - }); - - dispatcher.register( - literal("foo") - .then(argument("bar", integer()).executes(|c| { - // println!("Bar is {}", get_integer(c, "bar")); - 2 - })) - .executes(|c| { - println!("Called foo with no arguments"); - 1 - }), - ); - - let parse = dispatcher.parse("foo 123".to_string().into(), source); - println!("{:?}", parse); - println!( - "{}", - CommandDispatcher::<Rc<CommandSourceStack>>::execute(parse).unwrap() - ); -} |
