ishell 0.1.0

Pseudo-interactive shell interface for Rust
Documentation

IShell - (pseudo)interactive shell

The main goal was to make a shell interface that remembers cd commands.

You can create a new shell by simply doing:

// Parameter here is an Option<String> corresponding to
// the initial directory, from where the command will be ran.
let shell = IShell::new(None);

You can also specify where to open the shell initially:

// No matter from where you run the program,
// the shell will always be created at ~/Desktop
let desktop_shell = IShell::new("~/Desktop");

To run a command through your shell, you can do the following:

shell.run_command("echo 'Hello, World!'");

The run_command method also returns std::process::Output type.

You can also call

shell.forget_current_directory();

To make the shell set current directory to the initial directory specified. If initial directory wasn't specified, then this sets the current shell directory to the $PWD of the terminal running the program.