simple-shell

Crates.iosimple-shell
lib.rssimple-shell
version0.0.1
sourcesrc
created_at2023-07-08 11:09:02.217759
updated_at2023-07-08 11:09:02.217759
descriptionA simple no_std shell for embedded systems
homepagehttps://github.com/explodingcamera/pogos/tree/main/crates/simple-shell
repositoryhttps://github.com/explodingcamera/pogos.git
max_upload_size
id911422
size9,493
Henry Gressmann (explodingcamera)

documentation

README

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()
}
Commit count: 28

cargo fmt