|
@ -6,12 +6,15 @@ use std::{io, thread}; |
|
|
use crate::builtins::{execute_builtin, is_builtin, BuiltinConfig};
|
|
|
use crate::builtins::{execute_builtin, is_builtin, BuiltinConfig};
|
|
|
use crate::error::ShellError;
|
|
|
use crate::error::ShellError;
|
|
|
use crate::parse::parse_line;
|
|
|
use crate::parse::parse_line;
|
|
|
|
|
|
use crate::preprocess::preprocess;
|
|
|
|
|
|
|
|
|
pub fn interpret(
|
|
|
pub fn interpret(
|
|
|
line: String,
|
|
|
|
|
|
|
|
|
mut line: String,
|
|
|
config: &mut BuiltinConfig,
|
|
|
config: &mut BuiltinConfig,
|
|
|
ctrlc_recv: Receiver<()>,
|
|
|
ctrlc_recv: Receiver<()>,
|
|
|
) -> Result<(), ShellError> {
|
|
|
) -> Result<(), ShellError> {
|
|
|
|
|
|
line = preprocess(line)?;
|
|
|
|
|
|
|
|
|
if line.is_empty() {
|
|
|
if line.is_empty() {
|
|
|
return Err(ShellError::EmptyLine);
|
|
|
return Err(ShellError::EmptyLine);
|
|
|
}
|
|
|
}
|
|
|