mirror of
https://github.com/nushell/nushell
synced 2025-01-08 19:29:08 +00:00
18 lines
480 B
Rust
18 lines
480 B
Rust
|
use nu_protocol::engine::{EngineState, StateWorkingSet};
|
||
|
|
||
|
use crate::explore::*;
|
||
|
|
||
|
pub fn add_explore_context(mut engine_state: EngineState) -> EngineState {
|
||
|
let delta = {
|
||
|
let mut working_set = StateWorkingSet::new(&engine_state);
|
||
|
working_set.add_decl(Box::new(Explore));
|
||
|
working_set.render()
|
||
|
};
|
||
|
|
||
|
if let Err(err) = engine_state.merge_delta(delta) {
|
||
|
eprintln!("Error creating explore command context: {err:?}");
|
||
|
}
|
||
|
|
||
|
engine_state
|
||
|
}
|