shrs_command_timer 0.0.6

shrs plugin to time how long the previous command took to run
Documentation
use shrs::prelude::{StyledBuf, *};
use shrs_command_timer::{CommandTimerPlugin, CommandTimerState};

fn prompt_left() -> StyledBuf {
    styled_buf!("> ")
}

fn prompt_right(state: State<CommandTimerState>) -> StyledBuf {
    let time_str = state
        .command_time()
        .map(|x| format!("{x:?}"))
        .unwrap_or(String::new());
    styled_buf!(time_str.reset())
}

fn main() {
    let prompt = Prompt::from_sides(prompt_left, prompt_right);

    let myshell = ShellBuilder::default()
        .with_plugin(CommandTimerPlugin)
        .with_prompt(prompt)
        .build()
        .unwrap();

    myshell.run().expect("Shell Failed");
}