use once_cell::sync::OnceCell; use std::io; use yozuk::Yozuk; use yozuk_sdk::prelude::*; pub fn yozuk_global() -> &'static Yozuk { static INSTANCE: OnceCell = OnceCell::new(); INSTANCE.get_or_init(|| { Yozuk::builder() .add_redirection( tk!(["test", "command", "redirect"]), vec!["test", "redirect"], ) .build() }) } #[allow(dead_code)] pub fn cmd(tokens: Vec) -> Option { let stream = InputStream::new(io::empty(), media_type!(APPLICATION / OCTET_STREAM)); yozuk_global() .get_commands(&tokens, &[stream]) .into_iter() .next() }