1 unstable release

0.0.1 Jul 8, 2023

#28 in #aliases

24 downloads per month

MIT/Apache

10KB
249 lines

simple-shell

A simple shell for no_std Rust.

Usage

fn run_shell() -> ! {
  let (print, read) = (|s: &str| print!(s), || None);
  let mut shell = Shell::new(print, read);

  commands.insert(
      "help",
      ShellCommand {
          help: "print this help message",
          func: |_, shell| {
              shell.print_help_screen();
              Ok(())
          },
          aliases: &["?", "h"],
      },
  );

  // Also supports async
  // shell.run_async().await;

  shell.run()
}

No runtime deps