mirror of
https://github.com/nushell/nushell.git
synced 2024-12-23 07:30:13 +01:00
slight improvement
This commit is contained in:
parent
d2577acccd
commit
273f964293
16
src/eval.rs
16
src/eval.rs
@ -343,6 +343,22 @@ fn eval_call(state: &State, stack: Stack, call: &Call) -> Result<Value, ShellErr
|
||||
Ok(Value::Nothing {
|
||||
span: call.positional[0].span,
|
||||
})
|
||||
} else if decl.signature.name == "vars" {
|
||||
state.parser_state.print_vars();
|
||||
Ok(Value::Nothing {
|
||||
span: call.positional[0].span,
|
||||
})
|
||||
} else if decl.signature.name == "decls" {
|
||||
state.parser_state.print_decls();
|
||||
Ok(Value::Nothing { span: call.head })
|
||||
} else if decl.signature.name == "blocks" {
|
||||
state.parser_state.print_blocks();
|
||||
Ok(Value::Nothing { span: call.head })
|
||||
} else if decl.signature.name == "stack" {
|
||||
stack.print_stack();
|
||||
Ok(Value::Nothing { span: call.head })
|
||||
} else if decl.signature.name == "def" {
|
||||
Ok(Value::Nothing { span: call.head })
|
||||
} else {
|
||||
Err(ShellError::Unsupported(call.head))
|
||||
}
|
||||
|
12
src/main.rs
12
src/main.rs
@ -177,18 +177,6 @@ fn main() -> std::io::Result<()> {
|
||||
Signal::Success(s) => {
|
||||
if s.trim() == "exit" {
|
||||
break;
|
||||
} else if s.trim() == "vars" {
|
||||
parser_state.borrow().print_vars();
|
||||
continue;
|
||||
} else if s.trim() == "decls" {
|
||||
parser_state.borrow().print_decls();
|
||||
continue;
|
||||
} else if s.trim() == "blocks" {
|
||||
parser_state.borrow().print_blocks();
|
||||
continue;
|
||||
} else if s.trim() == "stack" {
|
||||
stack.print_stack();
|
||||
continue;
|
||||
}
|
||||
// println!("input: '{}'", s);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user