|
|
@ -5,6 +5,7 @@ use execute::interpret; |
|
|
|
use rustyline::completion::FilenameCompleter;
|
|
|
|
use rustyline::config::Configurer;
|
|
|
|
use rustyline::error::ReadlineError;
|
|
|
|
use rustyline::hint::HistoryHinter;
|
|
|
|
use rustyline::{CompletionType, Config, Editor, Result};
|
|
|
|
use rustyline_derive::{Completer, Helper, Highlighter, Hinter, Validator};
|
|
|
|
use whoami::username;
|
|
|
@ -20,6 +21,8 @@ mod prompt; |
|
|
|
struct EditorHelper {
|
|
|
|
#[rustyline(Completer)]
|
|
|
|
completer: FilenameCompleter,
|
|
|
|
#[rustyline(Hinter)]
|
|
|
|
hinter: HistoryHinter,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() -> Result<()> {
|
|
|
@ -34,6 +37,7 @@ fn main() -> Result<()> { |
|
|
|
|
|
|
|
let helper = EditorHelper {
|
|
|
|
completer: FilenameCompleter::new(),
|
|
|
|
hinter: HistoryHinter {},
|
|
|
|
};
|
|
|
|
|
|
|
|
let mut rl = Editor::with_config(config)?;
|
|
|
|