nushell/crates/nu-command/src/commands/command.rs

22 lines
543 B
Rust
Raw Normal View History

use crate::prelude::*;
use nu_engine::Command;
use nu_errors::ShellError;
use parking_lot::Mutex;
use std::sync::atomic::AtomicBool;
2019-05-10 18:59:12 +02:00
2019-08-02 21:15:07 +02:00
pub struct RunnableContext {
pub input: InputStream,
2019-08-09 06:51:21 +02:00
pub shell_manager: ShellManager,
pub host: Arc<parking_lot::Mutex<Box<dyn Host>>>,
pub ctrl_c: Arc<AtomicBool>,
pub current_errors: Arc<Mutex<Vec<ShellError>>>,
pub scope: Scope,
pub name: Tag,
2019-08-02 21:15:07 +02:00
}
impl RunnableContext {
pub fn get_command(&self, name: &str) -> Option<Command> {
self.scope.get_command(name)
}
2019-08-02 21:15:07 +02:00
}