mirror of
https://github.com/nushell/nushell.git
synced 2025-08-25 17:45:46 +02:00
Add a simple scope variable
This commit is contained in:
15
src/main.rs
15
src/main.rs
@@ -225,21 +225,6 @@ fn main() -> Result<()> {
|
||||
Ok(Signal::Success(s)) => {
|
||||
if s.trim() == "exit" {
|
||||
break;
|
||||
} else if s.trim() == "vars" {
|
||||
engine_state.print_vars();
|
||||
continue;
|
||||
} else if s.trim() == "decls" {
|
||||
engine_state.print_decls();
|
||||
continue;
|
||||
} else if s.trim() == "blocks" {
|
||||
engine_state.print_blocks();
|
||||
continue;
|
||||
} else if s.trim() == "stack" {
|
||||
stack.print_stack();
|
||||
continue;
|
||||
} else if s.trim() == "contents" {
|
||||
engine_state.print_contents();
|
||||
continue;
|
||||
}
|
||||
|
||||
eval_source(
|
||||
|
@@ -801,3 +801,8 @@ fn long_flag() -> TestResult {
|
||||
fn help_works_with_missing_requirements() -> TestResult {
|
||||
run_test(r#"each --help | lines | length"#, "10")
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn scope_variable() -> TestResult {
|
||||
run_test(r"let x = 3; $scope.vars.0", "$x")
|
||||
}
|
||||
|
Reference in New Issue
Block a user