forked from extern/nushell
Add example for cd,transpose,detect columns,split column and split row (#4549)
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
use nu_engine::{current_dir, CallExt};
|
||||
use nu_protocol::ast::{Call, Expr, Expression};
|
||||
use nu_protocol::engine::{Command, EngineState, Stack};
|
||||
use nu_protocol::{Category, PipelineData, ShellError, Signature, SyntaxShape, Value};
|
||||
use nu_protocol::{Category, Example, PipelineData, ShellError, Signature, SyntaxShape, Value};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Cd;
|
||||
@ -138,4 +138,12 @@ impl Command for Cd {
|
||||
stack.add_env_var("PWD".into(), path_value);
|
||||
Ok(PipelineData::new(call.head))
|
||||
}
|
||||
|
||||
fn examples(&self) -> Vec<Example> {
|
||||
vec![Example {
|
||||
description: "Change to your home directory",
|
||||
example: r#"cd ~"#,
|
||||
result: None,
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user