diff --git a/schala-repl/src/repl/directive_actions.rs b/schala-repl/src/repl/directive_actions.rs index 87269a6..bbac3c3 100644 --- a/schala-repl/src/repl/directive_actions.rs +++ b/schala-repl/src/repl/directive_actions.rs @@ -1,5 +1,4 @@ use super::{Repl, InterpreterDirectiveOutput}; -use crate::repl::command_tree::CommandTree; use crate::repl::help::help; use crate::language::{LangMetaRequest, LangMetaResponse, DebugAsk, DebugResponse}; use itertools::Itertools; diff --git a/schala-repl/src/repl/help.rs b/schala-repl/src/repl/help.rs index ec08741..e14af5c 100644 --- a/schala-repl/src/repl/help.rs +++ b/schala-repl/src/repl/help.rs @@ -11,7 +11,7 @@ pub fn help(repl: &mut Repl, arguments: &[&str]) -> InterpreterDirectiveOutput { }; match arguments { - [] => return global_help(repl), + [] => return global_help(repl, &directives), _ => { writeln!(buf, "Command-specific help not available yet").unwrap(); } @@ -19,12 +19,8 @@ pub fn help(repl: &mut Repl, arguments: &[&str]) -> InterpreterDirectiveOutput { Some(buf) } -fn global_help(repl: &mut Repl) -> InterpreterDirectiveOutput { +fn global_help(repl: &mut Repl, directives: &Vec) -> InterpreterDirectiveOutput { let mut buf = String::new(); - let directives = match repl.get_directives() { - CommandTree::Top(children) => children, - _ => panic!("Top-level CommandTree not Top") - }; writeln!(buf, "MetaInterpreter options").unwrap(); writeln!(buf, "-----------------------").unwrap();