mirror of
https://github.com/nushell/nushell.git
synced 2025-04-27 14:48:21 +02:00
Full std imports; limited prelude
This commit is contained in:
parent
a76cd758c1
commit
2ffde2acab
@ -17,12 +17,16 @@ pub fn load_standard_library(
|
|||||||
let std_dir = PathBuf::from("std");
|
let std_dir = PathBuf::from("std");
|
||||||
|
|
||||||
let mut std_files = vec![
|
let mut std_files = vec![
|
||||||
("mod.nu", include_str!("../std/mod.nu")),
|
// Loaded at startup
|
||||||
("core", include_str!("../std/core.nu")),
|
("core", include_str!("../std/core.nu")),
|
||||||
|
// std module - Loads all commands and submodules
|
||||||
|
("mod.nu", include_str!("../std/mod.nu")),
|
||||||
|
// Faster - Loads a subset of commands and submodules
|
||||||
|
("prelude", include_str!("../std/prelude.nu")),
|
||||||
|
// std submodules
|
||||||
("assert", include_str!("../std/assert.nu")),
|
("assert", include_str!("../std/assert.nu")),
|
||||||
("bench", include_str!("../std/bench.nu")),
|
("bench", include_str!("../std/bench.nu")),
|
||||||
("dirs", include_str!("../std/dirs.nu")),
|
("dirs", include_str!("../std/dirs.nu")),
|
||||||
("deprecated_dirs", include_str!("../std/deprecated_dirs.nu")),
|
|
||||||
("dt", include_str!("../std/dt.nu")),
|
("dt", include_str!("../std/dt.nu")),
|
||||||
("formats", include_str!("../std/formats.nu")),
|
("formats", include_str!("../std/formats.nu")),
|
||||||
("help", include_str!("../std/help.nu")),
|
("help", include_str!("../std/help.nu")),
|
||||||
@ -32,6 +36,8 @@ pub fn load_standard_library(
|
|||||||
("math", include_str!("../std/math.nu")),
|
("math", include_str!("../std/math.nu")),
|
||||||
("lib", include_str!("../std/lib.nu")),
|
("lib", include_str!("../std/lib.nu")),
|
||||||
("xml", include_str!("../std/xml.nu")),
|
("xml", include_str!("../std/xml.nu")),
|
||||||
|
// Remove in following release
|
||||||
|
("deprecated_dirs", include_str!("../std/deprecated_dirs.nu")),
|
||||||
];
|
];
|
||||||
|
|
||||||
let mut working_set = StateWorkingSet::new(engine_state);
|
let mut working_set = StateWorkingSet::new(engine_state);
|
||||||
|
@ -1,9 +1,26 @@
|
|||||||
# std.nu, `used` to load base standard library components
|
# std.nu, `used` to load all standard library components
|
||||||
|
|
||||||
|
export use lib *
|
||||||
|
export module assert
|
||||||
|
export module bench
|
||||||
|
export use dirs main
|
||||||
|
export module dirs {
|
||||||
|
export use dirs [
|
||||||
|
add
|
||||||
|
drop
|
||||||
|
next
|
||||||
|
prev
|
||||||
|
goto
|
||||||
|
]
|
||||||
|
}
|
||||||
|
export module dt
|
||||||
|
export use dt *
|
||||||
|
export module formats
|
||||||
|
export use formats *
|
||||||
|
export module help
|
||||||
export module input
|
export module input
|
||||||
export module iter
|
export module iter
|
||||||
|
export module log
|
||||||
# Make certain commands available in the top-level namespace
|
export use math *
|
||||||
export use lib *
|
export module xml
|
||||||
export use formats *
|
export use xml *
|
||||||
export use dt *
|
|
9
crates/nu-std/std/prelude.nu
Normal file
9
crates/nu-std/std/prelude.nu
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# std.nu, `used` to load base standard library components
|
||||||
|
|
||||||
|
export module input
|
||||||
|
export module iter
|
||||||
|
|
||||||
|
# Make certain commands available in the top-level namespace
|
||||||
|
export use lib *
|
||||||
|
export use formats *
|
||||||
|
export use dt *
|
Loading…
Reference in New Issue
Block a user