Crate shrs

Source
Expand description

shrs is a framework for building and configuring your own shell in rust.

§Example

The most basic shell can be created very easily:

use shrs::prelude::*;

fn main() {
    let myshell = ShellBuilder::default()
        .build()
        .unwrap();

    myshell.run().unwrap();
}

For more advanced explanation on features and configuration options, see the shrs book

Modules§

alias
Command aliases
anyhow
Re-export of anyhow crate for error handling
builtin
Builtin commands
commands
Command queue for mutating States and Shell in handlers
completion
Shell autocompletion
crossterm
Re-export of crossterm types
env
Environment variables
history
Shell command history
hooks
Shell runtime hooks
jobs
Abstraction layer for processes
keybinding
Keybinding system
lang
Shell command language
plugin
Plugin System
prelude
use shrs::prelude::* to import most commonly used structs and functions
prompt_content_queue
Queue for automatic insertion into prompt
readline
Readline implementation for shrs
shell
Core shell structs and shell config builder
state
Globally accessible state store States are accessible through handlers
theme
Configuration for common color values bundled into a theme

Macros§

all_the_tuples

Structs§

CmdOutput
Describes the output of a command
OutputWriter
Writer for printing to stdout and stderr