add help command

pull/3/head
Able 2021-11-06 22:31:21 -05:00
parent 806ea59664
commit 69bdfc2601
1 changed files with 2 additions and 3 deletions

View File

@ -7,10 +7,8 @@ use std::{
const VERSION: &str = env!("CARGO_PKG_VERSION");
fn main() {
loop {
// use the `>` character as the prompt
// need to explicitly flush this to ensure it prints before read_line
print!("~> ");
// need to explicitly flush this to ensure it prints before read_line
stdout().flush().unwrap();
let mut input = String::new();
@ -39,6 +37,7 @@ fn main() {
previous_command = None;
}
"version" => println!("Rash version: {}", VERSION),
"help" => println!("Able Shell help utility"),
"exit" => return,
command => {
let stdin = previous_command.map_or(Stdio::inherit(), |output: Child| {