forked from extern/nushell
# Description This will only display the list of subcommands. Prompted by a question on Discord why completions may be missing. With standard completion settings getting the subcommands doesn't seem to be a problem but we could add this command for good measure. # User-Facing Changes New command `dfr` that does nothing apart from displaying the subcommands and hogging a space in the completions # Tests + Formatting (-)
37 lines
888 B
Rust
37 lines
888 B
Rust
mod eager;
|
|
mod expressions;
|
|
mod lazy;
|
|
mod series;
|
|
mod stub;
|
|
mod utils;
|
|
mod values;
|
|
|
|
pub use eager::add_eager_decls;
|
|
pub use expressions::add_expressions;
|
|
pub use lazy::add_lazy_decls;
|
|
pub use series::add_series_decls;
|
|
|
|
use nu_protocol::engine::{EngineState, StateWorkingSet};
|
|
|
|
pub fn add_dataframe_context(mut engine_state: EngineState) -> EngineState {
|
|
let delta = {
|
|
let mut working_set = StateWorkingSet::new(&engine_state);
|
|
working_set.add_decl(Box::new(stub::Dfr));
|
|
add_series_decls(&mut working_set);
|
|
add_eager_decls(&mut working_set);
|
|
add_expressions(&mut working_set);
|
|
add_lazy_decls(&mut working_set);
|
|
|
|
working_set.render()
|
|
};
|
|
|
|
if let Err(err) = engine_state.merge_delta(delta) {
|
|
eprintln!("Error creating dataframe command context: {err:?}");
|
|
}
|
|
|
|
engine_state
|
|
}
|
|
|
|
#[cfg(test)]
|
|
mod test_dataframe;
|