forked from extern/nushell
Add examples for env,let-env,rm,touch and date list-timezone (#4531)
* feat: update #4518, add examples for env,let-env,rm,touch and date list-timezone * fix typo * update example for `date list-timezone` command
This commit is contained in:
10
crates/nu-command/src/env/let_env.rs
vendored
10
crates/nu-command/src/env/let_env.rs
vendored
@@ -1,7 +1,7 @@
|
||||
use nu_engine::{current_dir, eval_expression_with_input, CallExt};
|
||||
use nu_protocol::ast::Call;
|
||||
use nu_protocol::engine::{Command, EngineState, Stack};
|
||||
use nu_protocol::{Category, PipelineData, Signature, SyntaxShape, Value};
|
||||
use nu_protocol::{Category, Example, PipelineData, Signature, SyntaxShape, Value};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct LetEnv;
|
||||
@@ -58,4 +58,12 @@ impl Command for LetEnv {
|
||||
}
|
||||
Ok(PipelineData::new(call.head))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
vec![Example {
|
||||
description: "Create an environment variable and display it",
|
||||
example: "let-env MY_ENV_VAR = 1; $env.MY_ENV_VAR",
|
||||
result: Some(Value::test_int(1)),
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user