shi 0.1.5

A Rust library for crafting shell interfaces.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use shi::command::EchoCommand;
use shi::leaf;
use shi::shell::Shell;

use anyhow::Result;

fn main() -> Result<()> {
    // Instantiate a shell, with the prompt '| '.
    let mut shell = Shell::new("| ");

    shell.register(leaf!(EchoCommand::new()))?;

    // Start the shell run loop. This will make the program begin its input-output loop.
    shell.run()?;

    Ok(())
}