use shi::shell::Shell;
use shi::{cmd, parent};
use anyhow::Result;
fn main() -> Result<()> {
let mut shell = Shell::new("| ");
shell.register(cmd!("dog", |_, _| { Ok(String::from("woof")) }))?;
shell.register(parent!(
"felid",
cmd!("panther", |_, _| {
Ok(String::from("generic panther sound"))
}),
parent!(
"felinae",
cmd!("domestic-cat", |_, _| { Ok(String::from("meow")) }),
cmd!("dangerous-tiger", |_, _| { Ok(String::from("roar")) }),
)
))?;
shell.run()?;
Ok(())
}