mirror of
https://github.com/nushell/nushell.git
synced 2025-02-17 02:50:56 +01:00
Improve internal documentation of save
command (#5704)
- Example for `--append` mode. - Search terms for redirection
This commit is contained in:
parent
7a9bf06005
commit
a75318d7e8
@ -20,7 +20,16 @@ impl Command for Save {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn search_terms(&self) -> Vec<&str> {
|
fn search_terms(&self) -> Vec<&str> {
|
||||||
vec!["save", "write", "write_file"]
|
vec![
|
||||||
|
"write",
|
||||||
|
"write_file",
|
||||||
|
"append",
|
||||||
|
"redirection",
|
||||||
|
"file",
|
||||||
|
"io",
|
||||||
|
">",
|
||||||
|
">>",
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
fn signature(&self) -> nu_protocol::Signature {
|
fn signature(&self) -> nu_protocol::Signature {
|
||||||
@ -214,12 +223,17 @@ impl Command for Save {
|
|||||||
fn examples(&self) -> Vec<Example> {
|
fn examples(&self) -> Vec<Example> {
|
||||||
vec![
|
vec![
|
||||||
Example {
|
Example {
|
||||||
description: "Save a string to foo.txt in current directory",
|
description: "Save a string to foo.txt in the current directory",
|
||||||
example: r#"echo 'save me' | save foo.txt"#,
|
example: r#"echo 'save me' | save foo.txt"#,
|
||||||
result: None,
|
result: None,
|
||||||
},
|
},
|
||||||
Example {
|
Example {
|
||||||
description: "Save a record to foo.json in current directory",
|
description: "Append a string to the end of foo.txt",
|
||||||
|
example: r#"echo 'append me' | save --append foo.txt"#,
|
||||||
|
result: None,
|
||||||
|
},
|
||||||
|
Example {
|
||||||
|
description: "Save a record to foo.json in the current directory",
|
||||||
example: r#"echo { a: 1, b: 2 } | save foo.json"#,
|
example: r#"echo { a: 1, b: 2 } | save foo.json"#,
|
||||||
result: None,
|
result: None,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user