diff options
Diffstat (limited to 'src/repl/mod.rs')
| -rw-r--r-- | src/repl/mod.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/repl/mod.rs b/src/repl/mod.rs index 311ca72..7c99757 100644 --- a/src/repl/mod.rs +++ b/src/repl/mod.rs @@ -17,7 +17,7 @@ use anyhow::{Context, Result}; use reedline::Signal; use std::rc::Rc; -pub const REPL_COMMANDS: [(&str, &str); 13] = [ +pub const REPL_COMMANDS: [(&str, &str); 14] = [ (".info", "Print system-wide information"), (".set", "Modify the configuration temporarily"), (".model", "Choose a model"), @@ -31,6 +31,7 @@ pub const REPL_COMMANDS: [(&str, &str); 13] = [ (".clear history", "Clear the history"), (".help", "Print this help message"), (".exit", "Exit the REPL"), + (".read", "Read the contents of a file into the prompt"), ]; impl Repl { @@ -118,6 +119,10 @@ impl Repl { Some(name) => handler.handle(ReplCmd::SetRole(name.to_string()))?, None => print_now!("Usage: .role <name>\n\n"), }, + ".read" => match args { + Some(file) => handler.handle(ReplCmd::ReadFile(file.to_string()))?, + None => print_now!("Usage: .read <file name>\n\n"), + }, ".info" => { handler.handle(ReplCmd::ViewInfo)?; } |
