INNER CODE UNIT · Rust
run_repl
databricks/click · src/command_processor.rs:225
pub fn run_repl(&mut self) {
while !self.env.quit {
let mut writer = ClickWriter::new();
if self.env.need_new_editor {
self.rl = get_editor(self.env.get_rustyline_conf(), &self.hist_path);
Rc::get_mut(&mut self.env).unwrap().need_new_editor = false;
}
// we set and unset the pointer to the env in the helper here so the get_mut below works
let helper_env = Some(self.env.clone());
if let Some(h) = self.rl.helper_mut() {
h.set_env(helper_env)
}
let readline = self.rl.readline(self.env.prompt.as_str());
if let Some(h) = self.rl.helper_mut() {
h.set_env(None)
}
match readline {