Small restructuring

This commit is contained in:
Yehuda Katz
2019-05-22 21:30:43 -07:00
parent 261d7a793f
commit 31dd579d6f
17 changed files with 354 additions and 274 deletions

View File

@@ -11,7 +11,7 @@ impl ClassifiedCommand {
crate fn run(
self,
input: VecDeque<Value>,
context: &mut crate::Context,
context: &mut Context,
) -> Result<VecDeque<Value>, ShellError> {
match self {
ClassifiedCommand::Internal(internal) => {
@@ -22,7 +22,7 @@ impl ClassifiedCommand {
for v in result {
match v {
ReturnValue::Action(action) => match action {
crate::CommandAction::ChangeCwd(cwd) => context.env.cwd = cwd,
CommandAction::ChangeCwd(cwd) => context.env.cwd = cwd,
},
ReturnValue::Value(v) => next.push_back(v),

View File

@@ -1,12 +1,11 @@
use crate::errors::ShellError;
use crate::object::Value;
use crate::prelude::*;
use crate::Context;
use std::path::PathBuf;
pub struct CommandArgs<'caller> {
pub host: &'caller mut dyn Host,
pub env: &'caller crate::Environment,
pub env: &'caller Environment,
pub args: Vec<Value>,
pub input: VecDeque<Value>,
}