version builtin command

This commit is contained in:
Able 2021-05-28 23:36:04 -05:00
parent b79d749ae4
commit 806ea59664

View file

@ -4,7 +4,7 @@ use std::{
path::Path, path::Path,
process::{Child, Command, Stdio}, process::{Child, Command, Stdio},
}; };
const VERSION: &str = env!("CARGO_PKG_VERSION");
fn main() { fn main() {
loop { loop {
// use the `>` character as the prompt // use the `>` character as the prompt
@ -38,6 +38,7 @@ fn main() {
previous_command = None; previous_command = None;
} }
"version" => println!("Rash version: {}", VERSION),
"exit" => return, "exit" => return,
command => { command => {
let stdin = previous_command.map_or(Stdio::inherit(), |output: Child| { let stdin = previous_command.map_or(Stdio::inherit(), |output: Child| {