diff --git a/tools/cli/src/mentat_cli/input.rs b/tools/cli/src/mentat_cli/input.rs index 267b3cf4..8bd8d0dd 100644 --- a/tools/cli/src/mentat_cli/input.rs +++ b/tools/cli/src/mentat_cli/input.rs @@ -8,7 +8,7 @@ // CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. -use std::io::{self, stdin, BufRead, BufReader}; +use std::io::{stdin, BufReader}; use linefeed::Reader; use linefeed::terminal::DefaultTerminal; @@ -18,7 +18,7 @@ use self::InputResult::*; /// Possible results from reading input from `InputReader` #[derive(Clone, Debug)] pub enum InputResult { - /// rusti command as input; (name, rest of line) + /// mentat command as input; (name, rest of line) Command(String, Option), /// An empty line Empty, @@ -88,7 +88,7 @@ impl InputReader { Some(ref mut r) => { r.set_prompt(prompt); r.read_line().ok().and_then(|line| line) - } + }, None => self.read_stdin() } } diff --git a/tools/cli/src/mentat_cli/lib.rs b/tools/cli/src/mentat_cli/lib.rs index 41d196fd..53ab0126 100644 --- a/tools/cli/src/mentat_cli/lib.rs +++ b/tools/cli/src/mentat_cli/lib.rs @@ -7,6 +7,7 @@ // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR // CONDITIONS OF ANY KIND, either express or implied. See the License for the // specific language governing permissions and limitations under the License. + #![crate_name = "mentat_cli"] #[macro_use] extern crate log; diff --git a/tools/cli/src/mentat_cli/repl.rs b/tools/cli/src/mentat_cli/repl.rs index d7b95f58..f2954380 100644 --- a/tools/cli/src/mentat_cli/repl.rs +++ b/tools/cli/src/mentat_cli/repl.rs @@ -13,9 +13,8 @@ use input::InputResult::{Command, Empty, More, Eof}; /// Starting prompt const DEFAULT_PROMPT: &'static str = "mentat=> "; /// Prompt when further input is being read +// TODO: Should this actually reflect the current open brace? const MORE_PROMPT: &'static str = "mentat.> "; -/// Prompt when a `.block` command is in effect -const BLOCK_PROMPT: &'static str = "mentat+> "; /// Executes input and maintains state of persistent items. pub struct Repl { @@ -27,7 +26,6 @@ impl Repl { Repl{} } - /// Runs the REPL interactively. pub fn run(&mut self) { let mut more = false; @@ -35,12 +33,6 @@ impl Repl { loop { let res = input.read_input(if more { MORE_PROMPT } else { DEFAULT_PROMPT }); - // let res = if self.read_block { - // self.read_block = false; - // input.read_block_input(BLOCK_PROMPT) - // } else { - // input.read_input(if more { MORE_PROMPT } else { DEFAULT_PROMPT }) - // }; match res { Command(name, args) => {