mirror of
https://github.com/nushell/nushell
synced 2025-01-14 14:14:13 +00:00
add the standard help
to the prelude as std help ...
(#8794)
Related to #8505. # Description as #8505 has been landed, this PR fixes the prelude TODO and uses the `help` commands from the standard library in the prelude. # User-Facing Changes can now access `std help ...` to use the `help` implementations from the standard library # Tests + Formatting ``` $nothing ``` # After Submitting ``` $nothing ```
This commit is contained in:
parent
a3ea0c304a
commit
d881481758
2 changed files with 9 additions and 23 deletions
15
src/run.rs
15
src/run.rs
|
@ -79,16 +79,13 @@ fn load_standard_library(
|
||||||
report_error(&working_set, err);
|
report_error(&working_set, err);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: change this when #8505 is merged
|
|
||||||
// NOTE: remove the assert and uncomment the `help`s
|
|
||||||
let prelude = vec![
|
let prelude = vec![
|
||||||
("assert", "assert"),
|
("std help", "help"),
|
||||||
// ("help", "help"),
|
("std help commands", "help commands"),
|
||||||
// ("help commands", "help commands"),
|
("std help aliases", "help aliases"),
|
||||||
// ("help aliases", "help aliases"),
|
("std help modules", "help modules"),
|
||||||
// ("help modules", "help modules"),
|
("std help externs", "help externs"),
|
||||||
// ("help externs", "help externs"),
|
("std help operators", "help operators"),
|
||||||
// ("help operators", "help operators"),
|
|
||||||
];
|
];
|
||||||
|
|
||||||
load_prelude(&mut working_set, prelude, &module);
|
load_prelude(&mut working_set, prelude, &module);
|
||||||
|
|
|
@ -10,26 +10,15 @@ fn library_loaded() -> TestResult {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn prelude_loaded() -> TestResult {
|
fn prelude_loaded() -> TestResult {
|
||||||
run_test(
|
run_test("std help commands | where name == open | length", "1")
|
||||||
"help assert | lines | first 1 | to text",
|
|
||||||
"Universal assert command",
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn prelude_run() -> TestResult {
|
|
||||||
run_test("assert true; print 'it works'", "it works")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn not_loaded() -> TestResult {
|
fn not_loaded() -> TestResult {
|
||||||
fail_test("help log info", "")
|
fail_test("log info", "")
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn use_command() -> TestResult {
|
fn use_command() -> TestResult {
|
||||||
run_test(
|
run_test("use std assert; assert true; print 'it works'", "it works")
|
||||||
"use std 'log info'; log info 'this is some information'",
|
|
||||||
"",
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue