Add example for cd,transpose,detect columns,split column and split row (#4549)

This commit is contained in:
Justin Ma
2022-02-19 23:24:48 +08:00
committed by GitHub
parent 3ecf17e7af
commit ac99ac003a
6 changed files with 189 additions and 11 deletions

View File

@ -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,
}]
}
}